diff options
author | AKASHI Takahiro <takahiro.akashi@linaro.org> | 2018-12-14 18:42:51 +0900 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-12-15 11:49:19 -0500 |
commit | 4bca32497c09ef53ad669dfa4c413c00321ad7ca (patch) | |
tree | 7ddb9614cc950de13d1b51c3b0cdb08d8a081d01 /lib | |
parent | 8b1312662b3b1748c3d5f8a30bc6f9ca72879c7a (diff) | |
download | u-boot-4bca32497c09ef53ad669dfa4c413c00321ad7ca.tar.gz |
hashtable: fix length calculation in hexport_r
The commit below incorrectly fixed hexport_r();
> size = totlen + 1;
One extra byte is necessary to NULL-terminate a whole buffer, "resp."
Fixes: f1b20acb4a03 ("hashtable: Fix length calculation in hexport_r")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hashtable.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hashtable.c b/lib/hashtable.c index 1c48692b69..93028ed83b 100644 --- a/lib/hashtable.c +++ b/lib/hashtable.c @@ -662,7 +662,7 @@ ssize_t hexport_r(struct hsearch_data *htab, const char sep, int flag, return (-1); } } else { - size = totlen; + size = totlen + 1; } /* Check if the user provided a buffer */ |