Fix too small destination buffer in snprintf() call, found by GCC 8

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson 2019-10-12 11:34:11 +02:00
parent d754f91a66
commit 760ec4cc36

View File

@ -1868,7 +1868,7 @@ void logrotate(struct filed *f)
/* bug (mostly harmless): can wrap around if file > 4gb */ /* bug (mostly harmless): can wrap around if file > 4gb */
if (S_ISREG(statf.st_mode) && statf.st_size > f->f_rotatesz) { if (S_ISREG(statf.st_mode) && statf.st_size > f->f_rotatesz) {
if (f->f_rotatecount > 0) { /* always 0..999 */ if (f->f_rotatecount > 0) { /* always 0..999 */
int len = strlen(f->f_un.f_fname) + 10 + 1; int len = strlen(f->f_un.f_fname) + 10 + 5;
int i; int i;
char oldFile[len]; char oldFile[len];
char newFile[len]; char newFile[len];
@ -2783,7 +2783,7 @@ void cfline(char *line, struct filed *f)
struct addrinfo hints, *ai; struct addrinfo hints, *ai;
#endif #endif
char buf[MAXLINE]; char buf[MAXLINE];
char xbuf[200]; char xbuf[MAXLINE + 24];
char *p, *q, *bp; char *p, *q, *bp;
int ignorepri = 0; int ignorepri = 0;
int singlpri = 0; int singlpri = 0;