From: robertlipe Date: Mon, 10 Dec 2012 20:02:31 +0000 (+0000) Subject: Geoniche: Don't crash on empty input file. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~11^2~731 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e011e904374293d82df7ae23cddae6ba7b191840;p=gpsbabel.git Geoniche: Don't crash on empty input file. --- diff --git a/gpsbabel/geoniche.c b/gpsbabel/geoniche.c index 4e9e0d059..1e6246d8e 100644 --- a/gpsbabel/geoniche.c +++ b/gpsbabel/geoniche.c @@ -203,7 +203,7 @@ geoniche_read_asc(void) /* Process record 0 */ pdb_rec = file_in->rec_list; - if (strcmp((char*) pdb_rec->data, Rec0Magic)) { + if (!pdb_rec || strcmp((char*) pdb_rec->data, Rec0Magic)) { fatal(MYNAME ": Bad record 0, not a GeoNiche file.\n"); } pdb_rec = pdb_rec->next;