[riot-notifications] [RIOT-OS/RIOT] net/skald: Update Kconfig implementation (#15790)

Leandro Lanzieri notifications at github.com
Tue Jan 19 13:09:28 CET 2021


@leandrolanzieri commented on this pull request.



> @@ -110,6 +124,17 @@ void skald_init(void)
     _radio = nrfble_setup();
 #endif
 
+    /* Extract the channels from string set by Kconfig */
+#if defined(CONFIG_SKALD_ADV_CHAN_NO) //
+    char str[] = CONFIG_SKALD_ADV_CHAN;
+    char *store = NULL, *token;
+    uint8_t offset=0;
+    for (token = strtok_r(str, ", ", &store); token != NULL;
+         token = strtok_r(NULL, ", ", &store), offset++) {
+        _adv_chan[offset] = atoi(token);

You should check for the array length now, if not it could overflow.

-- 
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/15790#pullrequestreview-571181307
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210119/3e8d4447/attachment.htm>


More information about the notifications mailing list