mirror of
https://github.com/vale981/spectrwm
synced 2025-03-04 17:31:40 -05:00
Fix buffer overflow in bar_strlcat_esc
This commit is contained in:
parent
a30bbbbdd6
commit
44bd4da463
1 changed files with 2 additions and 2 deletions
|
@ -3058,8 +3058,8 @@ bar_strlcat_esc(char *dst, char *src, size_t sz)
|
|||
}
|
||||
|
||||
/* Concat string and escape every '+' */
|
||||
while (*src != '\0' && sz != 0) {
|
||||
if ((*src == '+') && (sz > 1)) {
|
||||
while (*src != '\0' && sz > 1) {
|
||||
if ((*src == '+') && (sz > 2)) {
|
||||
*dst++ = '+';
|
||||
sz--;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue