mirror of
https://github.com/sonertari/SSLproxy
synced 2024-10-31 21:20:21 +00:00
Handle ftell error, thanks to @disaykin
This commit is contained in:
parent
3048f95485
commit
6a92058b09
@ -93,6 +93,11 @@ dynbuf_new_file(const char *filename)
|
||||
}
|
||||
fseek(f, 0, SEEK_END);
|
||||
db->sz = ftell(f);
|
||||
if (db->sz == (size_t)-1) {
|
||||
free(db);
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
fseek(f, 0, SEEK_SET);
|
||||
if (!(db->buf = malloc(db->sz))) {
|
||||
free(db);
|
||||
|
Loading…
Reference in New Issue
Block a user