projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b13126
)
hashtable: fix length calculation in hexport_r
author
AKASHI Takahiro
<takahiro.akashi@linaro.org>
Fri, 14 Dec 2018 09:42:51 +0000
(18:42 +0900)
committer
Tom Rini
<trini@konsulko.com>
Sat, 15 Dec 2018 16:49:19 +0000
(11:49 -0500)
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>
lib/hashtable.c
patch
|
blob
|
history
diff --git
a/lib/hashtable.c
b/lib/hashtable.c
index 1c48692b69ede8b1045d7a8deb4706ba0d1ad84a..93028ed83b2677f9dd83d1f2a16abbcd9f3d2d37 100644
(file)
--- 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 */