summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-10-12 00:01:35 +0000
committerJeremy Allison <jra@samba.org>2001-10-12 00:01:35 +0000
commit754c2feee77d9ce0f8de666692f5ffc2cfb11b8a (patch)
treee8485b0de96753e81bda8f82f9436a3e0a6c32af
parentcf167fe3c5890986caea50ef2ddfabf257749058 (diff)
downloadsamba-754c2feee77d9ce0f8de666692f5ffc2cfb11b8a.tar.gz
samba-754c2feee77d9ce0f8de666692f5ffc2cfb11b8a.tar.bz2
samba-754c2feee77d9ce0f8de666692f5ffc2cfb11b8a.zip
Fix for tdb_oob() on TDB_INTERNAL databases.
Jeremy. (This used to be commit 2b135fba625191a13e4110c68531a0e6d5fb373d)
-rw-r--r--source3/tdb/tdb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index d0527919bc..2767158046 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);