lib/package_msg.c: fix a heap overflow (noticed by @Gottox).
This commit is contained in:
parent
3efd345e84
commit
6894980983
@ -59,7 +59,7 @@ xbps_cb_message(struct xbps_handle *xhp, xbps_dictionary_t pkgd, const char *key
|
|||||||
xbps_dbg_printf(xhp, "[%s] %s: fmemopen %s\n", __func__, pkgver, strerror(rv));
|
xbps_dbg_printf(xhp, "[%s] %s: fmemopen %s\n", __func__, pkgver, strerror(rv));
|
||||||
goto out;
|
goto out;
|
||||||
};
|
};
|
||||||
buf = malloc(len);
|
buf = malloc(len+1);
|
||||||
assert(buf);
|
assert(buf);
|
||||||
if (fread(buf, len, 1, f) != len) {
|
if (fread(buf, len, 1, f) != len) {
|
||||||
if (ferror(f)) {
|
if (ferror(f)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user