1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-29 21:47:30 +03:00

Return NULL in strlower_talloc if src is NULL

Prevents strlower_talloc from segfaulting if you pass it a NULL string.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Brendan Powers 2009-12-14 20:28:48 -05:00 committed by Andrew Bartlett
parent c3d1e5ca0c
commit 027cba6a49

View File

@ -430,6 +430,10 @@ _PUBLIC_ char *strlower_talloc(TALLOC_CTX *ctx, const char *src)
char *dest;
struct smb_iconv_convenience *iconv_convenience = get_iconv_convenience();
if(src == NULL) {
return NULL;
}
/* this takes advantage of the fact that upper/lower can't
change the length of a character by more than 1 byte */
dest = talloc_array(ctx, char, 2*(strlen(src))+1);