Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netsmb Don't dereference NULL pointers.



details:   https://anonhg.NetBSD.org/src/rev/87c7dbdc43a2
branches:  trunk
changeset: 793586:87c7dbdc43a2
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Feb 20 11:08:57 2014 +0000

description:
Don't dereference NULL pointers.

diffstat:

 sys/netsmb/iconv.c |  10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diffs (35 lines):

diff -r 1fb77b7f502d -r 87c7dbdc43a2 sys/netsmb/iconv.c
--- a/sys/netsmb/iconv.c        Thu Feb 20 11:00:40 2014 +0000
+++ b/sys/netsmb/iconv.c        Thu Feb 20 11:08:57 2014 +0000
@@ -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 @@
                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 @@
                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;



Home | Main Index | Thread Index | Old Index