Project

General

Profile

Bug #683 » 0001-Fix-stringop-truncation-error-thanks-DJ-Delorie.patch

patch to fix the issue - Adam Williamson, 2020-02-07 21:03

View differences:

src/irc.c
if (c - cur < 1)
return NULL;
ret = bip_malloc(c - cur + 1);
strncpy(ret, cur, c - cur);
ret[c - cur] = 0;
strncpy (ret, cur, c - cur + 1);
return ret;
}
if (index == num) {
......
if (c - cur < 1)
return NULL;
ret = bip_malloc(c - cur + 1);
strncpy(ret, cur, c - cur);
ret[c - cur] = 0;
strncpy (ret, cur, c - cur + 1);
return ret;
}
return NULL;
(1-1/2)