================
* Use strncpy for COMM_LEN and make it 18 characters to cover brackets
in name.
+ * don't change COMM_LEN, it breaks matching long commands
+ Debian #661145
* Enable some harden AM_CFLAGS by default, use configure option
--disable-harden-flags to not use it.
case 'y':
NOT_PIDOF_OPTION;
strncpy(yt, optarg, 16);
+ yt[15] = '\0';
if ( 0 >= (younger_than = parse_time_units(yt) ) )
usage(_("Invalid time format"));
break;
case 'o':
NOT_PIDOF_OPTION;
strncpy(ot, optarg, 16);
+ ot[15] = '\0';
if ( 0 >= (older_than = parse_time_units(ot) ) )
usage(_("Invalid time format"));
break;
exit(1);
}
strncpy(new->comm, comm, COMM_LEN+2);
- new->comm[COMM_LEN+2]='\0'; /* make sure nul terminated*/
+ new->comm[COMM_LEN+1]='\0'; /* make sure nul terminated*/
new->pid = pid;
new->uid = uid;
new->flags = 0;
#endif /*WITH_SELINUX */
else {
strncpy(this->comm, comm, COMM_LEN+2);
+ this->comm[COMM_LEN+1];
this->uid = uid;
}
if (args)