zhhyu7 opened a new pull request, #4206:
URL: https://github.com/apache/nuttx-apps/pull/4206

   ## Summary
   
   - wapi_escan_channel_init() copied the ESSID into
     req.essid[IW_ESSID_MAX_SIZE] without a length check; a longer SSID
     overflowed struct iw_scan_req on the stack.  Return -EINVAL.
   - wapi_json_update() passed a NULL value (e.g. no passphrase returned by
     the driver) to strcmp(); check value and obj->valuestring for NULL.
   - The first commit only reformats util.c and wireless.c (case labels
     inside switch, blank line after declarations) so that checkpatch -g
     passes for the two fixes; no code change.
   
   ## Impact
   
   - wapi scan with an SSID longer than 32 bytes now fails with -EINVAL
     instead of corrupting the stack.
   
   ## Testing
   
   - The style commit: "git diff -w --ignore-blank-lines" against
     apache/master is empty.
   - sim:dynconns with the pseudo Wi-Fi device (DRIVERS_WIFI_SIM,
     SIM_WIFIDEV_PSEUDO) builds on this branch and on apache/master.
     "wapi scan" returns an error before reaching the driver on both builds
     in this setup, so the new length check could not be observed at
     runtime:
   
   ```
   nsh> wapi scan wlan0 0123456789012345678901234567890123456789
   nsh> echo "ret=$?"
   ret=234
   ```
   
   checkpatch.sh -c -u -m -g passes for the two fixes.  The style commit
   has no Signed-off-by yet (to be added by the submitter).
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to