-
-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
riello_usb (& riello_ser ) segmentation fault on missing vars #957
Comments
I'm not a project developer, but I think it's a real problem. I'm working on the driver for my own UPS for two weeks so I've read many drivers for my reference. It's my personal observation that there are a lot of unsafe uses of |
The IDG1600 I have does not appear to have non-volatile memory, so any setting of reboot or shutdown does not persist if @ianb61 : shutdown.return works ok for me - no segfault using the updated version of the riello_usb driver (version 0.7)
|
Hi,
I have installed nut on Debian 10 (Buster) from the release apt package. I have the riello_usb driver installed and configured and it works fine most of the time. When I use the instcmd ( upscmd ) to request a shutdown.return the riello_usb driver crashes with a segmentation fault.
I downloaded the source from github and chased the fault down to the driver requesting the ups.delay.shutdown variable. This variable is not established from my ups, so it doesn't exist unless specifically created by the user in ups.conf. Without the variable the riello_usb code is given a NULL pointer from the dstate_getinfo() call and this is passed into atoi( ) without a check, which then causes the crash. Also uses the variable for command load.off.delay and similarly crashes.
Variable ups.delay.reboot causes the same behaviour from the command load.on.delay.
Easy fix for me was to define the variables in my ups.conf. But life would be better if this was documented in the man page for riello_usb or fixed in the code so it handles the situation cleanly. I am new to github so I dont know how to make such fixes or manual updates. Happy to help if I can or if this is a pointless issue then please close it off and I am sorry to trouble you.
Thanks
Ian
The text was updated successfully, but these errors were encountered: