WaifUPnP icon indicating copy to clipboard operation
WaifUPnP copied to clipboard

Fixed junk null byte issue

Open Monsterovich opened this issue 2 years ago • 0 comments

This patch fixes a very specific problem found on some routers. In the XML output, a NUL byte is added to the end of the file, which prevents parsing of the XML file, causing port forwarding to fail.

изображение

After manually removing the garbage, port forwarding works fine. In the upnpc utility, this problem was solved with the -i flag (a.k.a. ignore errors).

P.S. I'd like to use try-with-resource block, but that would require upgrading to Java 7 minimum.

Monsterovich avatar Nov 19 '23 13:11 Monsterovich