Fix buffer overflow in bar_strlcat_esc

This commit is contained in:
Charlie Root 2019-08-13 12:39:36 -04:00 committed by LordReg
parent a30bbbbdd6
commit 44bd4da463

View file

@ -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--;
}