mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-23 10:30:16 +00:00
Guard against trying to map an empty string pool into memory
This commit is contained in:
parent
a8b39aa2ff
commit
ca4d1beb7c
11
geojson.c
11
geojson.c
@ -1633,10 +1633,13 @@ int read_json(int argc, char **argv, char *fname, const char *layername, int max
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
char *stringpool = (char *) mmap(NULL, poolpos, PROT_READ, MAP_PRIVATE, poolfd, 0);
|
||||
if (stringpool == MAP_FAILED) {
|
||||
perror("mmap string pool");
|
||||
exit(EXIT_FAILURE);
|
||||
char *stringpool = NULL;
|
||||
if (poolpos > 0) { // Will be 0 if -X was specified
|
||||
stringpool = (char *) mmap(NULL, poolpos, PROT_READ, MAP_PRIVATE, poolfd, 0);
|
||||
if (stringpool == MAP_FAILED) {
|
||||
perror("mmap string pool");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned midx = 0, midy = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user