Fix a NULL ptr dereference (from upstream).

reported by "remco"
ok naddy@ sthen@
This commit is contained in:
ajacoutot 2012-02-07 06:36:39 +00:00
parent 5ee810f609
commit c8731b53b3
2 changed files with 29 additions and 3 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.64 2011/12/21 14:36:15 pea Exp $
# $OpenBSD: Makefile,v 1.65 2012/02/07 06:36:39 ajacoutot Exp $
COMMENT= RFC 2222 SASL (Simple Authentication and Security Layer)
DISTNAME= cyrus-sasl-2.1.25
REVISION= 2
SHARED_LIBS += anonymous 2.22 # 2.25
SHARED_LIBS += crammd5 2.22 # 2.25
@ -20,8 +21,6 @@ SHARED_LIBS += sql 2.22 # 2.25
CATEGORIES= security
REVISION= 1
HOMEPAGE= http://www.cyrusimap.org/
MAINTAINER= Antoine Jacoutot <ajacoutot@openbsd.org>

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-plugins_gssapi_c,v 1.1 2012/02/07 06:36:39 ajacoutot Exp $
From fa289f15ceb2b9c64bdcf057a75469808454190d Mon Sep 17 00:00:00 2001
From: Alexey Melnikov <alexey.melnikov@isode.com>
Date: Fri, 07 Oct 2011 11:22:47 +0000
Subject: Fixed a segfault in gssapi.c (Patch by Phil Pennock)
--- plugins/gssapi.c.orig Wed May 11 21:25:55 2011
+++ plugins/gssapi.c Mon Feb 6 11:48:42 2012
@@ -370,7 +370,7 @@ sasl_gss_encode(void *context, const struct iovec *inv
}
if (output_token->value && output) {
- unsigned char * p = (unsigned char *) text->encode_buf;
+ unsigned char * p;
ret = _plug_buf_alloc(text->utils,
&(text->encode_buf),
@@ -383,6 +383,8 @@ sasl_gss_encode(void *context, const struct iovec *inv
GSS_UNLOCK_MUTEX(text->utils);
return ret;
}
+
+ p = (unsigned char *) text->encode_buf;
p[0] = (output_token->length>>24) & 0xFF;
p[1] = (output_token->length>>16) & 0xFF;