summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-21 15:58:49 +0100
committerGünther Deschner <gd@samba.org>2013-01-02 12:35:37 +0100
commit9b0c1ab07c2c9a3fce1c49ad3d476ca1301182a4 (patch)
tree124eaf34bedf08e0bafdbab22a8d250341ccaab9
parent30e1dc08df8d891e1ab6e17d786a7a239417947f (diff)
downloadsamba-9b0c1ab07c2c9a3fce1c49ad3d476ca1301182a4.tar.gz
samba-9b0c1ab07c2c9a3fce1c49ad3d476ca1301182a4.tar.bz2
samba-9b0c1ab07c2c9a3fce1c49ad3d476ca1301182a4.zip
s3-rpcclient: Fix cmd_eventlog_loginfo() null pointer passing.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Found by Coverity.
-rw-r--r--source3/rpcclient/cmd_eventlog.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/rpcclient/cmd_eventlog.c b/source3/rpcclient/cmd_eventlog.c
index 8acf4173b7..949e02510b 100644
--- a/source3/rpcclient/cmd_eventlog.c
+++ b/source3/rpcclient/cmd_eventlog.c
@@ -510,6 +510,12 @@ static NTSTATUS cmd_eventlog_loginfo(struct rpc_pipe_client *cli,
return status;
}
+ buffer = talloc_array(mem_ctx, uint8_t, bytes_needed);
+ if (buffer == NULL) {
+ status = NT_STATUS_NO_MEMORY;
+ goto done;
+ }
+
status = dcerpc_eventlog_GetLogInformation(b, mem_ctx,
&handle,
0, /* level */
@@ -526,8 +532,8 @@ static NTSTATUS cmd_eventlog_loginfo(struct rpc_pipe_client *cli,
}
buf_size = bytes_needed;
- buffer = talloc_array(mem_ctx, uint8_t, bytes_needed);
- if (!buffer) {
+ buffer = talloc_realloc(mem_ctx, buffer, uint8_t, bytes_needed);
+ if (buffer == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;
}