git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f891d43
)
working on bug 687; protect against null src strings in alloc_sub_basic()
author
Gerald Carter
<jerry@samba.org>
Mon, 8 Dec 2003 17:42:26 +0000
(17:42 +0000)
committer
Gerald Carter
<jerry@samba.org>
Mon, 8 Dec 2003 17:42:26 +0000
(17:42 +0000)
source/lib/substitute.c
patch
|
blob
|
history
diff --git
a/source/lib/substitute.c
b/source/lib/substitute.c
index ee342964d0ff9f1475c78f6834bac4fdcb7cde30..5dec9808101d957d7340364367183f68167e177b 100644
(file)
--- a/
source/lib/substitute.c
+++ b/
source/lib/substitute.c
@@
-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"));