lib: Allow NULL converted_size in convert_string_talloc
authorVolker Lendecke <vl@samba.org>
Thu, 23 Jun 2011 12:44:25 +0000 (14:44 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 24 Jun 2011 19:24:17 +0000 (21:24 +0200)
lib/util/charset/convert_string.c

index 51f9fec137a942bcddb899f71301bde7af20051a..8f46c8803919b32476be14b68b4cf036414bac0a 100644 (file)
@@ -376,7 +376,9 @@ bool convert_string_talloc_handle(TALLOC_CTX *ctx, struct smb_iconv_handle *ic,
                        errno = ENOMEM;
                        return false;
                }
-               *converted_size = destlen;
+               if (converted_size != NULL) {
+                       *converted_size = destlen;
+               }
                *dest = ob;
                return true;
        }
@@ -470,7 +472,9 @@ bool convert_string_talloc_handle(TALLOC_CTX *ctx, struct smb_iconv_handle *ic,
                }
        }
 
-       *converted_size = destlen;
+       if (converted_size != NULL) {
+               *converted_size = destlen;
+       }
        return true;
 }