projects
/
platform
/
core
/
security
/
webauthn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f9ead0e
)
Fix buffer overflow in receving message from server
36/316136/2
author
Krzysztof Malysa
<k.malysa@samsung.com>
Tue, 10 Dec 2024 16:09:09 +0000
(17:09 +0100)
committer
Krzysztof Malysa
<k.malysa@samsung.com>
Tue, 10 Dec 2024 16:13:45 +0000
(17:13 +0100)
Change-Id: I423599fdd9b1dde27335a9f87d65a85794c802e1
srcs/common/message-buffer.h
patch
|
blob
|
history
diff --git
a/srcs/common/message-buffer.h
b/srcs/common/message-buffer.h
index c8c40cda6b4a33f703a145b553cdf9e3110e2423..2d1df2ce9d93d67869e50cc0004865775e5e4201 100644
(file)
--- a/
srcs/common/message-buffer.h
+++ b/
srcs/common/message-buffer.h
@@
-361,10
+361,10
@@
public:
assert(m_offset == 0);
auto payloadSize = *reinterpret_cast<size_t*>(m_buffer);
- if (payloadSize > m_bufferSize)
+ if (
sizeof(size_t) +
payloadSize > m_bufferSize)
{
try{
- ReserveMessageSize(payloadSize);
+ ReserveMessageSize(
sizeof(size_t) +
payloadSize);
} catch (const std::bad_alloc &e) {
LogError("Bad allocation while realloc: " << e.what());
return 0;