if (len > max_file_size)
goto err_close;
- buf = talloc_array(ctx, char, len);
+ buf = talloc_array(ctx, char, len + 1);
if (!buf)
goto err_close;
}
+ buf[len] = '\0';
+
close(fd);
*bufp = buf;
*lenp = len;
case CONF_METHOD_DHCP:
rc = download_config(ctx, &buf, &len);
- if (rc)
+ if (rc) {
+ pb_log("\tdownload failed, aborting\n");
return;
+ }
for (i = 0; i < n_parsers; i++) {
if (parsers[i]->method != method)