summaryrefslogtreecommitdiffstats
path: root/source/tdb/tdb.c
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
commit2b135fba625191a13e4110c68531a0e6d5fb373d (patch)
treec17f7b9d73c678c8fac122e80ba747ad0afc5ed6 /source/tdb/tdb.c
parent062bba07f2faedfce7612c8b4a16072fa200349e (diff)
downloadsamba-2b135fba625191a13e4110c68531a0e6d5fb373d.tar.gz
samba-2b135fba625191a13e4110c68531a0e6d5fb373d.tar.xz
samba-2b135fba625191a13e4110c68531a0e6d5fb373d.zip
Fix for tdb_oob() on TDB_INTERNAL databases.
Jeremy.
Diffstat (limited to 'source/tdb/tdb.c')
-rw-r--r--source/tdb/tdb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/tdb/tdb.c b/source/tdb/tdb.c
index d0527919bc7..27671580461 100644
--- a/source/tdb/tdb.c
+++ b/source/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);