Skip to content

Conversation

@dougnazar
Copy link
Contributor

A couple small one-line fixes:

  • Fix SIGSEGV while preforming INSTCMD
  • Fix passing of errors up from libusb 1.x

Parameter arg[2] is not guaranteed to be valid while preforming INSTCMD.
Don't pass directly to main_instcmd().

Signed-off-by: Doug Nazar <nazard@nazar.ca>
The api for get_item_buffered() requires the actual error to be in errno
which was automatic for libusb 0.x but libusb 1.x doesn't use errno.

Otherwise a poll-only driver will miss errors like disconnects and never try
to reconnect.

Signed-off-by: Doug Nazar <nazard@nazar.ca>
@jimklimov jimklimov added bug impacts-release-2.8.0 Issues reported against NUT release 2.8.0 (maybe vanilla or with minor packaging tweaks) impacts-release-2.8.1 Issues reported against NUT release 2.8.1 (maybe vanilla or with minor packaging tweaks) and removed impacts-release-2.8.0 Issues reported against NUT release 2.8.0 (maybe vanilla or with minor packaging tweaks) labels Nov 9, 2023
@jimklimov jimklimov added this to the 2.8.2 milestone Nov 9, 2023
@jimklimov
Copy link
Member

Thanks! The SIGSEGV one seems like this-year's addition, so not a part of earlier releases and I suppose too few people ran the new code with actual commands to notice it :( and neither did static analyzers :\

I suppose this misfires with all single-token commands without an argument?

Out of curiosity, in what sort of workflow did you detect it?

@dougnazar
Copy link
Contributor Author

I'd assume so. It happened due to my monthly battery test. Just got lucky that it happened while I was working on the driver.

@jimklimov jimklimov merged commit c5c5642 into networkupstools:master Nov 9, 2023
@jimklimov
Copy link
Member

Note for self: latest commit checks "failure" was due to a master-branch mischief (not git-ignored touch-file).

@dougnazar dougnazar deleted the misc_fixes branch November 10, 2023 06:09
jimklimov added a commit to networkupstools/nut-website that referenced this pull request Nov 10, 2023
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit that referenced this pull request Nov 12, 2023
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug impacts-release-2.8.1 Issues reported against NUT release 2.8.1 (maybe vanilla or with minor packaging tweaks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants