Check return values after allocating memory

This commit is contained in:
Eric Fischer
2016-03-25 11:20:56 -07:00
parent eebba7b75b
commit bc5a7b251f
3 changed files with 54 additions and 21 deletions
+1 -1
View File
@@ -800,7 +800,7 @@ struct jsonmap {
long long end;
};
int json_map_read(struct json_pull *jp, char *buffer, int n) {
ssize_t json_map_read(struct json_pull *jp, char *buffer, size_t n) {
struct jsonmap *jm = jp->source;
if (jm->off + n >= jm->end) {