[riot-notifications] [RIOT-OS/RIOT] gnrc_tftp: initialize unititialized 'tftp_context_t' (#11773)

Martine Lenders notifications at github.com
Wed Jul 3 16:23:53 CEST 2019


miri64 commented on this pull request.



> @@ -405,11 +405,14 @@ int gnrc_tftp_server(tftp_data_cb_t data_cb, tftp_start_cb_t start_cb, tftp_stop
     }
 
     /* context will be initialized when a connection is established */
-    tftp_context_t ctxt;
-    ctxt.data_cb = data_cb;
-    ctxt.start_cb = start_cb;
-    ctxt.stop_cb = stop_cb;
-    ctxt.enable_options = use_options;
+    tftp_context_t ctxt = {
+        .dst_port = GNRC_TFTP_DEFAULT_DST_PORT,
+        .src_port = GNRC_TFTP_DEFAULT_DST_PORT,

Wait no, right. I moved the initialization to 2fce0950bf0d03a2702bba7312fa55119e70a085, as `_tftp_state_processes` relied on certain configurations of `ctxt->dst_port` I was unsure about. I tested it with your crafted input, and it did not crash (the server was not responding anymore, because a legal input changed its port...., see #11778).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11773#discussion_r299984885
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190703/77150eb1/attachment-0001.html>


More information about the notifications mailing list