We already assume tmp[] is big enough when using an unsized
sprintf(), considering it contains a single pid number and
is 30 bytes we can assume it was also big enough to hold the
terminating null byte.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
*src = tmp;
*asz += BUF_RESERVE_SIZE;
}
- memcpy((*src) +*sz , tmp, tmplen);
+ memcpy((*src) +*sz , tmp, tmplen+1); /* include the \0 */
*sz += tmplen;
- (*src)[*sz] = '\0';
}
/*