conf: check if returned size is larger than buffer
@@ -53,6 +53,11 @@ static int load_file(struct mbuf *mb, const char *filename)
else if (n == 0)
break;
+ if ((size_t)n > sizeof(buf)) {
+ err = EBADMSG;
+ break;
+ }
+
err |= mbuf_write_mem(mb, buf, n);
}
