diff options
author | Jeremy Allison <jra@samba.org> | 2001-05-15 18:12:02 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-05-15 18:12:02 +0000 |
commit | 10211f53f9fa9e21a6ededf892b8be27bad9643e (patch) | |
tree | c2561d44829a4bdcc67909f9c352bcf6a64b053d /source3/lib/messages.c | |
parent | e863446e79350b640e7559e5e5e459184567436e (diff) | |
download | samba-10211f53f9fa9e21a6ededf892b8be27bad9643e.tar.gz samba-10211f53f9fa9e21a6ededf892b8be27bad9643e.tar.xz samba-10211f53f9fa9e21a6ededf892b8be27bad9643e.zip |
Check sizes of data entries in connections.tdb before deciding they're crecs...
We will need this when we use finer grained locking for max connections.
Jeremy.
(This used to be commit c6cd42a6791e26174eb795fd08ddbbd797e5a9cf)
Diffstat (limited to 'source3/lib/messages.c')
-rw-r--r-- | source3/lib/messages.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 3b45a9c305c..b18cebf6cf5 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -361,9 +361,13 @@ static int traverse_fn(TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_DATA dbuf, void struct connections_data crec; struct msg_all *msg_all = (struct msg_all *)state; + if (dbuf.dsize != sizeof(crec)) + return 0; + memcpy(&crec, dbuf.dptr, sizeof(crec)); - if (crec.cnum != -1) return 0; + if (crec.cnum != -1) + return 0; /* if the msg send fails because the pid was not found (i.e. smbd died), * the msg has already been deleted from the messages.tdb.*/ |