[PATCH] tdb: Fix a possible null pointer dereference.

Andreas Schneider asn at samba.org
Thu Nov 22 04:09:45 MST 2012


Signed-off-by: Andreas Schneider <asn at samba.org>
---
 lib/tdb/common/error.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/tdb/common/error.c b/lib/tdb/common/error.c
index 2aaaa81..ddb93af 100644
--- a/lib/tdb/common/error.c
+++ b/lib/tdb/common/error.c
@@ -29,6 +29,10 @@
 
 _PUBLIC_ enum TDB_ERROR tdb_error(struct tdb_context *tdb)
 {
+	if (tdb == NULL) {
+		return TDB_ERR_EINVAL;
+	}
+
 	return tdb->ecode;
 }
 
-- 
1.8.0




More information about the samba-technical mailing list