remove buffer overflow vulnerability
This commit is contained in:
parent
474ac61f6e
commit
9c211f5139
3
bspc.c
3
bspc.c
|
@ -319,8 +319,7 @@ int bspwm_update(struct module *module) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(isdigit(module->buffer[i]) && *current == module->buffer[i]) {
|
if(isdigit(module->buffer[i]) && *current == module->buffer[i]) {
|
||||||
/* XXX: susceptible to buffer overflow */
|
if(i <= MODULE_BUFFER_LEN - 2) module->buffer[i + 1] = '<';
|
||||||
if(i == MODULE_BUFFER_LEN) module->buffer[i + 1] = '<';
|
|
||||||
*current = '\0';
|
*current = '\0';
|
||||||
}
|
}
|
||||||
if(module->buffer[i] == '\n')
|
if(module->buffer[i] == '\n')
|
||||||
|
|
Loading…
Reference in New Issue