diff options
author | Stefan Wildemann <stefan.wildemann@metalstrolche.de> | 2022-09-21 21:38:10 +0200 |
---|---|---|
committer | Stefan Wildemann <stefan.wildemann@metalstrolche.de> | 2022-09-21 21:38:10 +0200 |
commit | 69d870e276b4511aba56d4a13b998a4040b1d1eb (patch) | |
tree | 5d4760cd6dd40fcdac1efadb721090f9273eff58 | |
parent | cb4216da50a5ead25f3bb086740b1a7e543fb4be (diff) | |
download | navit-69d870e276b4511aba56d4a13b998a4040b1d1eb.tar.gz |
fix:core:Forcefully terminate string read with fgets
-rw-r--r-- | navit/navit.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/navit/navit.c b/navit/navit.c index f01c9efcd..e6e43064d 100644 --- a/navit/navit.c +++ b/navit/navit.c @@ -1806,6 +1806,8 @@ static int navit_former_destinations_active(struct navit *this_) { if (destination_file) { while(fgets(lastline, sizeof(lastline), destination_file)); fclose(destination_file); + /*forcefully terminate the string, there is no proper fgets error handling.*/ + lastline[sizeof(lastline) -1] = 0; if (strcmp(lastline, TEXTFILE_COMMENT_NAVI_STOPPED)) { active=1; } |