diff options
author | Anton Lundin <glance@acc.umu.se> | 2013-12-09 07:42:51 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-09 07:50:52 +0100 |
commit | 3b115b94009e9a674681145b324a46d51432a788 (patch) | |
tree | eafd09bd78fdb0df505ab5e4c91a281738c800b1 /file.c | |
parent | 44848d5457b904a77e35fa0b93268a581b933b23 (diff) | |
download | subsurface-3b115b94009e9a674681145b324a46d51432a788.tar.gz |
Don't crash when trying to open a empty file
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -291,6 +291,9 @@ static void parse_file_buffer(const char *filename, struct memblock *mem, char * if (fmt && open_by_filename(filename, fmt+1, mem, error)) return; + if (!mem->size || !mem->buffer) + return; + parse_xml_buffer(filename, mem->buffer, mem->size, &dive_table, NULL, error); } |