r25136: When tallocing a string to uppercase remember the terminating
authorJeremy Allison <jra@samba.org>
Thu, 13 Sep 2007 17:25:57 +0000 (17:25 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:30:43 +0000 (12:30 -0500)
'\0' in size calculations.
Jeremy.
(This used to be commit 54c658867db3b6c602080d60936abab3af26e112)

source3/lib/charcnv.c

index 4a2e768d05a6071abf148005f9cd127f7a708802..c481c9a7e2c188390006ab11ab8579377c0ce618 100644 (file)
@@ -841,7 +841,7 @@ char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *s)
                TALLOC_FREE(out_buffer);
 
                size = convert_string_talloc(ctx, CH_UNIX, CH_UTF16LE,
-                               s, strlen(s),
+                               s, strlen(s)+1,
                                (void *)&ubuf,
                                True);
                if (size == (size_t)-1) {