WIFI Shield support has some bad uses of strncpy()
- Dominant language
- Java
- Stars
- 14.6k
- Forks
- 7k
- PR merge metrics
- No merged PRs in 30d
Description
From code inspection:.. These are incorrect calls to strncpy - using the length of the source string rather than the destination buffer...
```
libraries/WiFi/extras/wifiHD/src/ard_spi.c - instances of:
strncpy(keyIdx, (const char*)¶ms->param, params->paramLen);
hardware/arduino/avr/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/wl_api.h - instances of:
strncpy(net.ssid.ssid, "My AP", strlen("My AP"));
```
Contributor guide
Research direction
Start with the listed strncpy instances in libraries/WiFi/extras/wifiHD/src/ard_spi.c and hardware/arduino/avr/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/wl_api.h. Inspect the destination buffers and the surrounding WiFi Shield code; done means the identified calls use lengths appropriate for their destinations without introducing truncation or overflow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100