budgie-desktop icon indicating copy to clipboard operation
budgie-desktop copied to clipboard

Fix heap buffer overflow in UsageMonitor

Open serebit opened this issue 1 year ago • 2 comments

Description

The %ms format specifier, when passed to POSIX scanf, allocates the necessary space for the value that it reads into a char**.

Submitter Checklist

  • [x] Squashed commits with git rebase -i (if needed)
  • [x] Built budgie-desktop and verified that the patch worked (if needed)

serebit avatar Oct 21 '23 18:10 serebit

How portable is this? It looks like it's an extension done by GNU C, and I don't see any documentation, at least for OpenBSD that supports %m.

EbonJaeger avatar Oct 22 '23 15:10 EbonJaeger

Hm... It's not portable. I'll need to figure out how to preallocate the required space, then.

serebit avatar Oct 22 '23 16:10 serebit