Skip to content
Commit 5e345bb5 authored by Tom Gundersen's avatar Tom Gundersen Committed by Zbigniew Jędrzejewski-Szmek
Browse files

basic: util - fix errorhandling in unhexmem()

We were ignoring failures from unhexchar, which meant that invalid
hex characters were being turned into garbage rather than the string
rejected.

Fix this by making unhexmem return an error code, also change the API
slightly, to return the size of the returned memory, reflecting the
fact that the memory is a binary blob,and not a string.

For convenience, still append a trailing NULL byte to the returned
memory (not included in the returned size), allowing callers to
treat it as a string without doing a second copy.

(cherry picked from commit 30494563)
parent 6cc943b7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment