Hi,
CHANGELOG of v2:
================
* Specify the buffer size of 'user' instead of strlen().
It actually walks through 'user' twice, once to compute length by
strlen() and then this patch specifies the buffer size of 'user' instead.
Reported-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Reviewed-By: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
newrule->uid = uid;
newrule->gid = gid;
- strncpy(newrule->name, user, strlen(user));
- strncpy(newrule->destination, destination, strlen(destination));
+ strncpy(newrule->name, user, sizeof(newrule->name) - 1);
+ strncpy(newrule->destination, destination,
+ sizeof(newrule->destination) - 1);
newrule->next = NULL;
/* Parse the controller list, and add that to newrule too. */