1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

Some paranoia checks

(This used to be commit ff644cfa1b)
This commit is contained in:
Volker Lendecke 2007-12-19 16:48:18 +01:00 committed by Volker Lendecke
parent 2197801ef1
commit 0743d384a6

View File

@ -88,6 +88,10 @@ static int traverse_fn(TDB_CONTEXT *ttdb, TDB_DATA kbuf, TDB_DATA dbuf, void *st
{
struct unexpected_key key;
if (kbuf.dsize != sizeof(key)) {
tdb_delete(ttdb, kbuf);
}
memcpy(&key, kbuf.dptr, sizeof(key));
if (lastt - key.timestamp > NMBD_UNEXPECTED_TIMEOUT) {
@ -136,6 +140,10 @@ static int traverse_match(TDB_CONTEXT *ttdb, TDB_DATA kbuf, TDB_DATA dbuf,
int port;
struct packet_struct *p;
if (kbuf.dsize != sizeof(key)) {
return 0;
}
memcpy(&key, kbuf.dptr, sizeof(key));
if (key.packet_type != state->match_type) return 0;