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:
parent
c3d1e5ca0c
commit
027cba6a49
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user