gnss: open temporary file as read/write

Opening as write-only may cause undefined behavior when reading the file
This commit is contained in:
Dylan Van Assche
2021-09-07 07:28:34 +02:00
parent 7b96296938
commit 8913300997

View File

@@ -190,7 +190,7 @@ static void fetch_assistance_data(struct EG25Manager *manager)
long int size; long int size;
/* Fetch assistance data with curl */ /* Fetch assistance data with curl */
tmp_file = fdopen(manager->gnss_assistance_fd, "wb"); tmp_file = fdopen(manager->gnss_assistance_fd, "wb+");
url = g_strconcat(manager->gnss_assistance_url, "/", url = g_strconcat(manager->gnss_assistance_url, "/",
manager->gnss_assistance_file, NULL); manager->gnss_assistance_file, NULL);
curl = curl_easy_init(); curl = curl_easy_init();