Skip to content

Commit c5cca3d

Browse files
committed
Fix syslog header truncation
The priority value in the syslog header is between 0 (one digit) and 191 (three digits). The call to snprintf() might have cut off the whitespace before the timestamp field of the header for priority values greater than 99.
1 parent 1db7bdc commit c5cca3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/netlog-network.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ int manager_push_to_network(Manager *m,
113113
const char *hostname,
114114
const char *pid,
115115
const struct timeval *tv) {
116-
char header_priority[sizeof("< >1 ") + 1];
116+
char header_priority[sizeof("< >1 ")];
117117
char header_time[FORMAT_TIMESTAMP_MAX];
118-
uint16_t makepri;
118+
uint8_t makepri;
119119
struct iovec iov[13];
120120
int n = 0;
121121

0 commit comments

Comments
 (0)