Page 1 of 1

Macro listing crashes client after scrolling [Linux client 4.7.2]

Posted: Tue Mar 10, 2020 3:28 pm
by jezek
Client: TomeNET 4.7.2 for Linux (amd64), complete (sound and music pack included) (147 MB)

Steps to reproduce:
1. Open macro editor (tap '%')
2. Add empty macro to ENTER* key (tap 'e' and then ENTER)
2. List all macro info (tap 'i')
3. Scroll down 5 times (tap spacebar 5 times)

*) see next post for other troubled keys

Current behaviour:
Client crashes with message: *** buffer overflow detected ***: /opt/tomenet-4.7.2-linux-amd64/tomenet terminated

Expected behaviour:
Client lists more macros, or returns to first page if at end.

Re: Macro listing crashes client after scrolling [Linux client 4.7.2]

Posted: Thu Mar 12, 2020 4:35 am
by jezek
I just found out, that the macro listing crashes, only if you have some macro mapped on ENTER, BACKSPACE, SPACE or TAB key. Maybe there are more.

Re: Macro listing crashes client after scrolling [Linux client 4.7.2]

Posted: Thu Mar 12, 2020 5:05 pm
by jezek
Hellou.

Today I made some work and fixed this bug. How can I distribute the fix?

Re: Macro listing crashes client after scrolling [Linux client 4.7.2]

Posted: Sun Mar 15, 2020 5:22 pm
by jezek
The fix for this bug can be found on github - https://github.com/jezek/tomenet-src/co ... 80e4750ede

Re: Macro listing crashes client after scrolling [Linux client 4.7.2]

Posted: Tue Mar 24, 2020 11:57 am
by mikaelh
You can contribute by sending patches. I guess a commit on Github is pretty much the same thing.

I have some minor complaints about this change:

The comment you wrote is a bit difficult to read.
Excess indentation for the default case.

I guess I would prefer a revised version. If you do revise this, you can also add your name to the comment to credit yourself.

Re: Macro listing crashes client after scrolling [Linux client 4.7.2]

Posted: Tue Mar 24, 2020 3:56 pm
by jezek
thanks for your answer...
I made it a little bit more readable, I think...

https://github.com/jezek/tomenet/commit ... ff=unified

about the comments, I don't care to be credited for such little changes...
but of course, you can require it, to see who is to blame is something goes wrong ;)

Re: Macro listing crashes client after scrolling [Linux client 4.7.2]

Posted: Wed Mar 25, 2020 12:44 pm
by mikaelh
Well, it looks goods enough so I cherry-picked the commit into our own git repository. Thanks for the fix.