diff options
author | Jeremy Allison <jra@samba.org> | 2001-10-12 00:01:35 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-10-12 00:01:35 +0000 |
commit | 754c2feee77d9ce0f8de666692f5ffc2cfb11b8a (patch) | |
tree | e8485b0de96753e81bda8f82f9436a3e0a6c32af /source3 | |
parent | cf167fe3c5890986caea50ef2ddfabf257749058 (diff) | |
download | samba-754c2feee77d9ce0f8de666692f5ffc2cfb11b8a.tar.gz samba-754c2feee77d9ce0f8de666692f5ffc2cfb11b8a.tar.xz samba-754c2feee77d9ce0f8de666692f5ffc2cfb11b8a.zip |
Fix for tdb_oob() on TDB_INTERNAL databases.
Jeremy.
(This used to be commit 2b135fba625191a13e4110c68531a0e6d5fb373d)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/tdb/tdb.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c index d0527919bc7..27671580461 100644 --- a/source3/tdb/tdb.c +++ b/source3/tdb/tdb.c @@ -252,8 +252,13 @@ static int tdb_oob(TDB_CONTEXT *tdb, tdb_off len, int probe) struct stat st; if (len <= tdb->map_size) return 0; - if (tdb->flags & TDB_INTERNAL) - return 0; + if (tdb->flags & TDB_INTERNAL) { + if (!probe) { + TDB_LOG((tdb, 0,"tdb_oob len %d beyond internal malloc size %d\n", + (int)len, (int)tdb->map_size)); + } + return TDB_ERRCODE(TDB_ERR_IO, -1); + } if (fstat(tdb->fd, &st) == -1) return TDB_ERRCODE(TDB_ERR_IO, -1); |