projects
/
qemu-gpiodev
/
libgpiod.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5533f27
)
core: fix chip-info strings termination
author
Iker Pedrosa
<ikerpedrosam@gmail.com>
Mon, 29 Jul 2024 10:57:18 +0000
(12:57 +0200)
committer
Bartosz Golaszewski
<bartosz.golaszewski@linaro.org>
Wed, 31 Jul 2024 08:57:59 +0000
(10:57 +0200)
strncpy() truncates the destination buffer if it isn't large enough to
hold the copy. Thus, let's increase the size of the destination strings
to add the NULL character at the end.
Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
Link:
https://lore.kernel.org/r/1d7cf79edf75ef77baa56091852be90e2359e572.1722250385.git.ikerpedrosam@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
lib/chip-info.c
patch
|
blob
|
history
diff --git
a/lib/chip-info.c
b/lib/chip-info.c
index 87fd9e7c7e3b82c0af9a82276a466e188a708855..478cd62a0c45cad86f3b0cfebf2de969f4d8818e 100644
(file)
--- a/
lib/chip-info.c
+++ b/
lib/chip-info.c
@@
-10,8
+10,8
@@
struct gpiod_chip_info {
size_t num_lines;
- char name[
32
];
- char label[
32
];
+ char name[
GPIO_MAX_NAME_SIZE+1
];
+ char label[
GPIO_MAX_NAME_SIZE+1
];
};
GPIOD_API void gpiod_chip_info_free(struct gpiod_chip_info *info)