svn commit: samba r6235 - in branches/SAMBA_3_0/source/tdb: .
jra at samba.org
jra at samba.org
Thu Apr 7 19:39:35 GMT 2005
Author: jra
Date: 2005-04-07 19:39:34 +0000 (Thu, 07 Apr 2005)
New Revision: 6235
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6235
Log:
Partial fix for bugid #2581. Ensure if realloc fails on an internal
tdb we fail gracefully.
Jeremy.
Modified:
branches/SAMBA_3_0/source/tdb/tdb.c
Changeset:
Modified: branches/SAMBA_3_0/source/tdb/tdb.c
===================================================================
--- branches/SAMBA_3_0/source/tdb/tdb.c 2005-04-07 18:27:28 UTC (rev 6234)
+++ branches/SAMBA_3_0/source/tdb/tdb.c 2005-04-07 19:39:34 UTC (rev 6235)
@@ -832,9 +832,14 @@
tdb->map_size += size;
- if (tdb->flags & TDB_INTERNAL)
- tdb->map_ptr = realloc(tdb->map_ptr, tdb->map_size);
- else {
+ if (tdb->flags & TDB_INTERNAL) {
+ char *new_map_ptr = realloc(tdb->map_ptr, tdb->map_size);
+ if (!new_map_ptr) {
+ tdb->map_size -= size;
+ goto fail;
+ }
+ tdb->map_ptr = new_map_ptr;
+ } else {
/*
* We must ensure the file is remapped before adding the space
* to ensure consistency with systems like OpenBSD where
More information about the samba-cvs
mailing list