From f289851d70ea7a8f66a31e9af7d9fc6e16ebffef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Thu, 5 Feb 2009 16:36:44 +0100 Subject: [PATCH] s3-eventlog: fix Coverity #877. Guenther --- source3/rpc_server/srv_eventlog_lib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source3/rpc_server/srv_eventlog_lib.c b/source3/rpc_server/srv_eventlog_lib.c index 57b3be43adb..d8c5c3d4539 100644 --- a/source3/rpc_server/srv_eventlog_lib.c +++ b/source3/rpc_server/srv_eventlog_lib.c @@ -551,9 +551,11 @@ bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, struct eventlog_Record_tdb entry->sid_length = rpcstr_push_talloc(mem_ctx, &dummy, stop); + if (entry->sid_length == (uint32_t)-1) { + return false; + } entry->sid = data_blob_talloc(mem_ctx, dummy, entry->sid_length); - if (entry->sid_length == (uint32_t)-1 || - entry->sid.data == NULL) { + if (entry->sid.data == NULL) { return false; } } else if ( 0 == strncmp( start, "STR", stop - start ) ) {