ElektraInitiative / lcdproc

Client/server suite for controlling a wide variety of LCD devices
http://lcdproc.org/
GNU General Public License v2.0
2 stars 1 forks source link

Segfault when invoking lcdexec -h #9

Closed bauhaus93 closed 4 years ago

bauhaus93 commented 5 years ago

In PR #7: When the lcdproc executable gets invoked in help mode (lcdproc -h), the help gets printed, but the program throws a segmentation fault.

In clients/lcdproc/main.c: It seems to me, that the program doesn't terminate after printing the help, but instead resumes to normal program execution and trying to connect to the LCDd server (having not loaded the global variables in process_config, because help mode). As a result, the server global variable remains NULL and is passed to sock_connect, where gethostbyname() is called with it, causing the segfault.

kodebach commented 5 years ago

I fixed it in 58cd8d1. A similar problem occurred for the other clients (and original for the server too). lcdexec -h still doesn't work, if no main menu is set, however. I will try to find a way around that.

markus2330 commented 5 years ago

Thank you for creating the issue and the quick help.