DevKitty-io / USB-Nugget

Run DuckyScript payloads on a USB Nugget!
https://usbnugget.com
MIT License
163 stars 19 forks source link

fix: web builder adds null terminator #95

Closed brandonpaiz closed 2 years ago

brandonpaiz commented 2 years ago

In release 1.2, the web UI shows the string "resume" in the web UI. Image: https://i.imgur.com/NbEYPMR.png

This is because

  1. there is no null terminator in the array constructed by src/scripts/build_web_ui.sh
  2. We pass this array directly to a String constructor when the web ui is requested
  3. The String constructor doesn't provide options for array length and expects it to be null terminated.

Easiest solution: have build_web_ui.sh append a null byte

brandonpaiz commented 2 years ago

Some of my favorite bugs come from regex related issues :)