summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-08-07 13:10:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:22 -0500
commit456305325ce0d5d7562e0596ead983009de76143 (patch)
tree39a156341136594752ba273228a95459f8191d4f /source3
parent42c1eca26593246769739da58df7e9a76536f401 (diff)
downloadsamba-456305325ce0d5d7562e0596ead983009de76143.tar.gz
samba-456305325ce0d5d7562e0596ead983009de76143.tar.bz2
samba-456305325ce0d5d7562e0596ead983009de76143.zip
r24268: Fix two crashes for spoolss
strlcpy does not like a NULL source. Fix a use-after-free. (This used to be commit c2a214501788b5f0b6f555bd01ed310d331d07fa)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/connection.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index da8bd89e7a..4b807f7b90 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -206,7 +206,7 @@ BOOL register_message_flags(BOOL doreg, uint32 msg_flags)
doreg ? "adding" : "removing",
(unsigned int)msg_flags ));
- if (!(rec = connections_fetch_entry(NULL, NULL, NULL))) {
+ if (!(rec = connections_fetch_entry(NULL, NULL, ""))) {
DEBUG(0, ("connections_fetch_entry failed\n"));
return False;
}
@@ -225,17 +225,18 @@ BOOL register_message_flags(BOOL doreg, uint32 msg_flags)
status = rec->store(rec, rec->value, TDB_REPLACE);
- TALLOC_FREE(rec);
-
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("register_message_flags: tdb_store failed: %s.\n",
nt_errstr(status)));
+ TALLOC_FREE(rec);
return False;
}
DEBUG(10,("register_message_flags: new flags 0x%x\n",
(unsigned int)pcrec->bcast_msg_flags ));
+ TALLOC_FREE(rec);
+
return True;
}