Skip to content

Commit

Permalink
Merge pull request #655 from citrusleaf/geojson-mem-hotfix
Browse files Browse the repository at this point in the history
Fix geojson possible memory clobbers.
  • Loading branch information
gooding470 authored Oct 20, 2018
2 parents 7489c5b + 5fca47c commit c6795c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions as/src/base/particle_geojson.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ geojson_size_from_asval(const as_val *val)
size_t jsz = as_geojson_len(pg);

// Compute the size; we won't be writing any cellids ...
return geojson_size(0, jsz);
return (uint32_t)(sizeof(geojson_mem) + (0 * sizeof(uint64_t)) + jsz);
}

void
Expand Down Expand Up @@ -380,7 +380,7 @@ geojson_size_from_msgpack(const uint8_t *packed, uint32_t packed_size)
size_t jsz = (size_t)packed_size;

// Compute the size; we won't be writing any cellids ...
return geojson_size(0, jsz);
return (uint32_t)(sizeof(geojson_mem) + (0 * sizeof(uint64_t)) + jsz);
}

void
Expand Down

0 comments on commit c6795c0

Please sign in to comment.