projects
/
project
/
uqmi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
20cd907
)
command-nas: fix out-of-bounds read
author
Daniel Golle
<
[email protected]
>
Mon, 22 Nov 2021 01:19:05 +0000
(
01:19
+0000)
committer
Daniel Golle
<
[email protected]
>
Mon, 22 Nov 2021 01:23:33 +0000
(
01:23
+0000)
Limit iteration to number of array members fixing potential
out-of-bounds read.
Coverity CID:
1493471
Out-of-bounds read
Signed-off-by: Daniel Golle <
[email protected]
>
commands-nas.c
patch
|
blob
|
history
diff --git
a/commands-nas.c
b/commands-nas.c
index 123ba636987106369e536ab7820b35f9a97f0975..01ca3b8a1699d2de94dd0ba7200e65d8ad14a2d2 100644
(file)
--- a/
commands-nas.c
+++ b/
commands-nas.c
@@
-83,7
+83,7
@@
print_earfcn_info(uint32_t earfcn)
{ 45590, 46589, 44, 700, "TDD" },
};
- for (int i = 0; i <
sizeof(earfcn_ranges
); i++) {
+ for (int i = 0; i <
(sizeof(earfcn_ranges) / sizeof(*earfcn_ranges)
); i++) {
if (earfcn <= earfcn_ranges[i].max && earfcn >= earfcn_ranges[i].min) {
blobmsg_add_u32(&status, "band", earfcn_ranges[i].band);
blobmsg_add_u32(&status, "frequency", earfcn_ranges[i].freq);