]> granicus.if.org Git - esp-idf/commitdiff
host_file_io: Fixes uninitialized 'offset' and 'whence' fseek args
authorAlexey Gerenkov <alexey@espressif.com>
Thu, 28 Jun 2018 08:50:20 +0000 (11:50 +0300)
committerAlexey Gerenkov <alexey@espressif.com>
Tue, 3 Jul 2018 16:34:13 +0000 (19:34 +0300)
components/app_trace/host_file_io.c

index a6dd35c08cb6560a53d0396d7726739ebece14c3..b8184401452ff7a4696f73d8d678e8410f28cb65 100644 (file)
@@ -279,6 +279,8 @@ static void esp_apptrace_fseek_args_prepare(uint8_t *buf, void *priv)
     esp_apptrace_fseek_args_t *args = priv;
 
     memcpy(buf, &args->file, sizeof(args->file));
+    memcpy(buf + sizeof(args->file), &args->offset, sizeof(args->offset));
+    memcpy(buf + sizeof(args->file) + sizeof(args->offset), &args->whence, sizeof(args->whence));
 }
 
 int esp_apptrace_fseek(esp_apptrace_dest_t dest, void *stream, long offset, int whence)