Double the size of new_fmt[] and remove an extraneous break in the

%m handling that was leftover from an earlier edit.
This commit is contained in:
Todd C. Miller
2017-01-13 16:39:31 -07:00
parent 921ad88ab8
commit a957a657b0

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016 Todd C. Miller <Todd.Miller@courtesan.com> * Copyright (c) 2016-2017 Todd C. Miller <Todd.Miller@courtesan.com>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@@ -35,7 +35,7 @@ void
sudo_vsyslog(int pri, const char *fmt, va_list ap) sudo_vsyslog(int pri, const char *fmt, va_list ap)
{ {
int saved_errno = errno; int saved_errno = errno;
char *cp, *ep, msgbuf[8192], new_fmt[1024]; char *cp, *ep, msgbuf[8192], new_fmt[2048];
va_list ap2; va_list ap2;
size_t len; size_t len;
@@ -47,7 +47,6 @@ sudo_vsyslog(int pri, const char *fmt, va_list ap)
if (len >= (size_t)(ep - cp)) if (len >= (size_t)(ep - cp))
len = (size_t)(ep - cp) - 1; len = (size_t)(ep - cp) - 1;
cp += len; cp += len;
break;
} else { } else {
if (fmt[0] == '%' && fmt[1] == '%') { if (fmt[0] == '%' && fmt[1] == '%') {
fmt++; fmt++;