mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2024-12-22 06:15:31 +00:00
Fix SIGSEGV/stacksmash in UDP logger.
The bug was reported in #197. Caused by insufficient size of logging buffer.
This commit is contained in:
parent
fd1ae1e574
commit
aefabe7e0a
8
mangle.c
8
mangle.c
@ -338,15 +338,15 @@ int process_udp_packet(const struct section_config_t *section, const uint8_t *pk
|
|||||||
goto accept;
|
goto accept;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dlen > 10 && config.verbose >= VERBOSE_TRACE) {
|
if (dlen > 10 && config.verbose == VERBOSE_TRACE) {
|
||||||
char buf[50];
|
char logging_buf[128];
|
||||||
char *bufpt = buf;
|
char *bufpt = logging_buf;
|
||||||
bufpt += sprintf(bufpt, "UDP payload start: [ ");
|
bufpt += sprintf(bufpt, "UDP payload start: [ ");
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
bufpt += sprintf(bufpt, "%02x ", data[i]);
|
bufpt += sprintf(bufpt, "%02x ", data[i]);
|
||||||
}
|
}
|
||||||
bufpt += sprintf(bufpt, "]");
|
bufpt += sprintf(bufpt, "]");
|
||||||
lgtrace_addp("%s", buf);
|
lgtrace_addp("%s", logging_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user