1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

working on bug 687; protect against null src strings in alloc_sub_basic()

(This used to be commit 6cf91bce40)
This commit is contained in:
Gerald Carter 2003-12-08 17:40:44 +00:00
parent 67db65abf1
commit f141ad1a96

View File

@ -494,6 +494,13 @@ char *alloc_sub_basic(const char *smb_name, const char *str)
struct passwd *pass;
const char *local_machine_name = get_local_machine_name();
/* workaround to prevent a crash while lookinf at bug #687 */
if ( !str ) {
DEBUG(0,("alloc_sub_basic: NULL source string! This should not happen\n"));
return NULL;
}
a_string = strdup(str);
if (a_string == NULL) {
DEBUG(0, ("alloc_sub_specified: Out of memory!\n"));