sipi / dwm-status2d

patch for DWM that allows colors and draw rectangle in the DWM status bar
GNU General Public License v3.0
21 stars 3 forks source link

dwm-6.3 crash #12

Open 3BD-R opened 2 years ago

3BD-R commented 2 years ago

this patch is awesome thanks for your efforts, the issue or bug is when miss typing one of ^ signs the wm crashes and log me out example: xsetroot -name "^c#FF0000 example", I know it is wrong implementation but the result was crash

fami-fish commented 1 year ago

I have also discovered this whilst debugging my own DWM instance. Any imbalance with closing ^ cause the program to keep reading until a ^ is encountered, even if this means reading memory which is outside of the buffer, resulting in a segfault crash. A simple fix would be to check the number of ^ BEFORE the null char \0 at the end of stext and, if that number is odd, default to the original "dwm-"VERSION status text and perhaps log the error to stdout/stderr. This defaulting to the string is also seen when setting stext to "" (xsetroot -name "" so it should be consistent with other fixes. Ill make a pull request shortly once i have tested my implementation

sipi commented 1 year ago

Hi, @3BD-R Thanks you very much for your grateful thanks :) and thanks for your feedback on issues. I will check to implement the @nick-1666 fix as soon as possible.

best regards, 6π