Closed barsnick closed 3 weeks ago
Thank you so much for your insights. The merge requests have excellent fixes in them and are very much appreciated. I really like the camera name in the prompt that is a good enhancement. You are correct about the strstr nullptr issue, this will go on the list of things to fix. The scan on addressing a device is another thing to go on the list. This has been addressed in onvif-gui, but needs to be ported back into onvif-util. The onvif-data.h file has the code in the manual_fill() member function.
I have a new release for onvif-gui that is in final test coming in the next few days that has a lot of new features that I want to get out very soon. It addresses some time sync issues that have been raised recently and has some stability fixes and expands the abilities of the proxy server. After that I can take another look at these open issues and get them fixed.
Best Regards,
Stephen
Hi, (recent newcomer to libonvif), I have hooked up a camera to my network, and found that
onvif-util
will find it when scanning, but segfault when trying to connect: Scan:Access:
This is the backtrace from gdb:
This points to an issue similar to what is described in https://github.com/sr99622/libonvif/issues/71 and its comments:
extractHost()
doesn't handle empty XAddrs well. Notably this code is bad C style: https://github.com/sr99622/libonvif/blob/59effcccd30e716e4506468a5997e95f5da217af/libonvif/src/onvif.c#L3028-L3029 because it doesn't handle a returned NULL/nullptr whenstrstr()
finds no matches.Disregarding that: This is caused on a higher level by failing to skip devices which don't have proper XAddrs when accessing a device directly. The scan does ignore those. I will post a PR to circumvent this.
BTW, I'm not happy with the "scan" when I'm addressing a particular device anyway, but I guess that's because the UDP broadcast is required to get basic info. libonvif could ignore anything which is not from the addressed device, but that's for a later issue report or pull request. 😉