fixed bug #75; add check for non-zero destlen
authorGerald Carter <jerry@samba.org>
Thu, 8 May 2003 20:19:21 +0000 (20:19 +0000)
committerGerald Carter <jerry@samba.org>
Thu, 8 May 2003 20:19:21 +0000 (20:19 +0000)
source/lib/charcnv.c

index 7acb7147fd64f0d4fb48faab39adf43e6e8652f7..c3360bbb65891b60a29cb4e137b0532a8a8eb58e 100644 (file)
@@ -252,7 +252,7 @@ convert:
        
        destlen = destlen - o_len;
        *dest = (char *)Realloc(ob,destlen);
-       if (!*dest) {
+       if (destlen && !*dest) {
                DEBUG(0, ("convert_string_allocate: out of memory!\n"));
                SAFE_FREE(ob);
                return (size_t)-1;