Re: Segmentation fault in iproute2 ss -p (versions 4.0.0, 4.1.0 and 4.1.1)

2015-07-20 Thread j...@openmailbox.org
NULL) { if (fscanf(fp, "%*d (%[^)])", procname) == 1) { - sprintf(procname+strlen(procname), "/%d", pid); + snprintf(procname+strlen(procname), +

Re: Segmentation fault in iproute2 ss -p (versions 4.0.0, 4.1.0 and 4.1.1)

2015-07-20 Thread Stephen Hemminger
Patches are always appreciated and this looks like a real bug. But before I can accept it there are a couple of small changes needed. 1. There is no need to check for NULL when calling free(). Glibc free is documented to accept NULL as a valid request and do nothing. 2. Please add a Signed-

Re: Segmentation fault in iproute2 ss -p (versions 4.0.0, 4.1.0 and 4.1.1)

2015-07-21 Thread j...@openmailbox.org
Patch for 4.1.1. Essentially all that is needed to get rid of this issue is the addition of: memset(u, 0, sizeof(*u)); after: if (!(u = malloc(sizeof(*u break; Also patched some other situations (strcpy and sprintf uses) that potentially produce the same results. Note: