Project

General

Profile

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

fixed version of patch - Adam Williamson, 2020-04-23 17:35

View differences:

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