[PATCH] fixes for ctdb/server/eventscript.c
Michael Adam
obnox at samba.org
Fri Mar 13 09:18:06 MDT 2015
Hi,
On 2015-03-13 at 15:27 +0100, Volker Lendecke wrote:
> Hi!
>
> Attached find some fixes for $SUBJECT. I believe we have a
> real memleak when collecting scripts.
Indeed. Great catch!
> We don't have a crash
> or security problem by using strcpy, because we filtered out
> long script names before. But still I would argue the
> current code is cleaner and more obvious. strcpy raises
> eyebrows :-)
I would give review+ and push but have
one comment and one question first:
> From 73a8f5754cbf8ac6d821480c07445ec034e0c7a2 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Fri, 13 Mar 2015 14:11:20 +0000
> Subject: [PATCH 2/5] ctdb: Make for-loop in ctdb_get_script_list more
> idiomatic
>
> ...
>
> - for (count = 0; count < scripts->num_scripts; count++) {
> - strcpy(scripts->scripts[count].name, namelist[count]->d_name);
> - scripts->scripts[count].status = 0;
> - if (!check_executable(ctdb->event_script_dir, namelist[count]->d_name)) {
> - scripts->scripts[count].status = -errno;
> + for (i = 0; i < count; i++) {
I personally would prefer this as even better to read:
for (i = 0; i < scripts->num_scripts; i++)
but that's just my taste.
> From 36232e0ec01a2617603a2f90903d8cdadb69bc81 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Fri, 13 Mar 2015 14:20:05 +0000
> Subject: [PATCH 5/5] ctdb: Fix 1125613 Destination buffer too small
What is 1125613 ? covetrity id?
Cheers - Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150313/81dcbf9c/attachment.pgp>
More information about the samba-technical
mailing list