Module Name:    src
Committed By:   joerg
Date:           Thu Feb 20 11:08:57 UTC 2014

Modified Files:
        src/sys/netsmb: iconv.c

Log Message:
Don't dereference NULL pointers.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/netsmb/iconv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netsmb/iconv.c
diff -u src/sys/netsmb/iconv.c:1.12 src/sys/netsmb/iconv.c:1.13
--- src/sys/netsmb/iconv.c:1.12	Thu Nov 16 01:33:51 2006
+++ src/sys/netsmb/iconv.c	Thu Feb 20 11:08:57 2014
@@ -1,9 +1,9 @@
-/*	$NetBSD: iconv.c,v 1.12 2006/11/16 01:33:51 christos Exp $	*/
+/*	$NetBSD: iconv.c,v 1.13 2014/02/20 11:08:57 joerg Exp $	*/
 
 /* Public domain */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iconv.c,v 1.12 2006/11/16 01:33:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iconv.c,v 1.13 2014/02/20 11:08:57 joerg Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -60,9 +60,6 @@ iconv_convstr(void *handle, char *dst, c
 		return dst;
 	}
 	inlen = outlen = strlen(src);
-	error = iconv_conv(handle, NULL, NULL, &p, &outlen);
-	if (error)
-		return NULL;
 	error = iconv_conv(handle, &src, &inlen, &p, &outlen);
 	if (error)
 		return NULL;
@@ -85,9 +82,6 @@ iconv_convmem(void *handle, void *dst, c
 		return dst;
 	}
 	inlen = outlen = size;
-	error = iconv_conv(handle, NULL, NULL, &d, &outlen);
-	if (error)
-		return NULL;
 	error = iconv_conv(handle, &s, &inlen, &d, &outlen);
 	if (error)
 		return NULL;

Reply via email to