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;
rc = read_file(ctx, path, &buf, &len);
if (!rc) {
+ pb_log("Running parser %s on file %s\n",
+ parser->name, *filename);
parser->parse(ctx, buf, len);
talloc_free(buf);
}