diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2025-06-04 16:17:44 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-06-12 14:22:59 +0100 |
commit | 2922e9cebf7d3d943e72a0936ccdb0c31a9359b8 (patch) | |
tree | e0c914ca6d6a351308862a57541a44fb463b11ec /meta/recipes-devtools/automake | |
parent | 72d932cc5b8ad99caf83e45924e81dcd58f56d20 (diff) | |
download | poky-master.tar.gz |
The bug was introduced by upstream commit [1] where strncat was replaced with
internal my_strncat function, such as:
char dest[32] = "/sys/devices/platform/axi";
my_strncat(dest, "/", sizeof(dest) - strlen(dest) - 1);
Will result in dest string being:
/sys/
and not the expected:
/sys/devices/platform/axi/
The meaning of the "len" parameter in the my_strncat function is the size limit for
copying characters from "from", not the size limit for "to" after copying. Also,
the "#define safestrcat(to, from) my_strncat(to, from, sizeof(to) - strlen(to) - 1)"
has already imposed a limit on max based on the size of "to". Modify the function
to prevent truncation of content when too many bytes are passed to the my_strcat function.
[1] https://github.com/linux-ras/sysfsutils/commit/0719881cad85f837f039ecb378b823306640902a
(From OE-Core rev: a5d2a5ce94b82957e2a9336c18dce9b28073cd71)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/automake')
0 files changed, 0 insertions, 0 deletions