projects
/
platform
/
core
/
system
/
dlog.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3333d35
)
Add an assert() to a scary-looking buffer indexing
52/247952/4
author
Michal Bloch
<m.bloch@samsung.com>
Wed, 18 Nov 2020 10:58:41 +0000
(11:58 +0100)
committer
Michal Bloch
<m.bloch@partner.samsung.com>
Thu, 28 Jan 2021 17:00:57 +0000
(17:00 +0000)
Static analysis had some worries about a buffer overrun here.
Change-Id: I0698ff87c9763c4752f28acd4ad2e4e0953664d4
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/shared/queued_entry.c
patch
|
blob
|
history
diff --git
a/src/shared/queued_entry.c
b/src/shared/queued_entry.c
index
8c7abe7
..
a8c3da7
100644
(file)
--- a/
src/shared/queued_entry.c
+++ b/
src/shared/queued_entry.c
@@
-154,6
+154,7
@@
void fixup_pipe_msg(struct dlogutil_entry_with_msg *dewm, int payload_size)
available_space:
sizeof WARN_MSG - 1;
payload_size += added_size;
+ assert(payload_size <= sizeof dewm->msg);
dewm->header.len += added_size;
dewm->msg[payload_size - 1] = '\0';
}