git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
82cd902
)
r19689: Fix a NULL dereference found by coverity (the call to strlen).
author
Volker Lendecke
<vlendec@samba.org>
Mon, 13 Nov 2006 10:50:55 +0000
(10:50 +0000)
committer
Gerald (Jerry) Carter
<jerry@samba.org>
Wed, 10 Oct 2007 17:15:47 +0000
(12:15 -0500)
Jerry, please check this. The way I understood alpha_strcpy the last arg needs
to be the size of the target, not of the source.
Thanks,
Volker
(This used to be commit
287d68daab89c78748b90849c9782473784b6a84
)
source3/rpc_server/srv_winreg_nt.c
patch
|
blob
|
history
diff --git
a/source3/rpc_server/srv_winreg_nt.c
b/source3/rpc_server/srv_winreg_nt.c
index a892a9bb8d4c91748b1d41f4e4e154994d36f498..1a130f19b6a560f4dbe4900699dc7372bc017f32 100644
(file)
--- a/
source3/rpc_server/srv_winreg_nt.c
+++ b/
source3/rpc_server/srv_winreg_nt.c
@@
-689,12
+689,14
@@
WERROR _winreg_InitiateSystemShutdownEx(pipes_struct *p, uint16_t *hostname, str
/* pull the message string and perform necessary sanity checks on it */
+ chkmsg[0] = '\0';
+
if ( message && message->name && message->name->name ) {
if ( (msg = talloc_strdup(p->mem_ctx, message->name->name )) == NULL ) {
return WERR_NOMEM;
}
+ alpha_strcpy (chkmsg, msg, NULL, sizeof(chkmsg));
}
- alpha_strcpy (chkmsg, msg?msg:"", NULL, strlen(msg));
fstr_sprintf(str_timeout, "%d", timeout);
fstr_sprintf(r, reboot ? SHUTDOWN_R_STRING : "");