Wrong assertion/comparison: Compare value not pointer
authorOlaf Flebbe <o.flebbe@science-computing.de>
Thu, 12 Apr 2012 09:29:41 +0000 (11:29 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 7 May 2012 16:24:18 +0000 (18:24 +0200)
Fix bug #8859 (Wrong assertion: Checks pointer not value).

source3/registry/reg_parse.c

index 908facabd1fe39764b247d444c53d7fafe182fa7..b8ad4d702e6e50af725192b84658b421d796d4a6 100644 (file)
@@ -793,12 +793,12 @@ handle_iconv_errno(int err, const char* obuf, size_t linenum,
        DEBUG(0, ("Illegal multibyte sequence at line %lu: %s",
                  (long unsigned)(linenum+1), pos));
 
-       assert(ilen > 0);
+       assert((*ilen) > 0);
        do {
                size_t il = 1;
                DEBUGADD(0, ("<%02x>", (unsigned char)**iptr));
 
-               if (olen > 0) {
+               if ((*olen) > 0) {
                        *(*optr)++ = '\?';
                        (*iptr)++;
                        /* Todo: parametrize, e.g. skip: *optr++ = *iptr++; */