summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Roques <olvrqs@gmail.com>2019-10-24 19:18:48 +0200
committerOlivier Roques <olvrqs@gmail.com>2019-10-31 16:24:35 +0000
commita7aaf5c89ec49efa145fb8959414c006ef7959ae (patch)
treec0c36774e941f89d927ff060eeda02ad2b9d5302
parent5268f318730bd8f3ffaf62e5d6bfae64eb17cb90 (diff)
[HICN-356] Fix uninitialized pointer
The signature verification method verify() in verifier.cc would try to initialize a pointer to the current packet's payload, which was never set in the first place. This fix calls the packet's method responsible for initializing that pointer. Signed-off-by: Olivier Roques <olvrqs@gmail.com> Change-Id: Ie5ab08036186ea4b766f6825c129ee68d01fc2b6
-rw-r--r--libtransport/src/hicn/transport/utils/verifier.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/libtransport/src/hicn/transport/utils/verifier.cc b/libtransport/src/hicn/transport/utils/verifier.cc
index af19d8b5e..69b2101da 100644
--- a/libtransport/src/hicn/transport/utils/verifier.cc
+++ b/libtransport/src/hicn/transport/utils/verifier.cc
@@ -97,6 +97,8 @@ PARCKeyId *Verifier::addKeyFromCertificate(const std::string &file_name) {
int Verifier::verify(const Packet &packet) {
bool valid = false;
+ // initialize packet.payload_head_
+ const_cast<Packet*>(&packet)->separateHeaderPayload();
// header chain points to the IP + TCP hicn header
utils::MemBuf *header_chain = packet.header_head_;
utils::MemBuf *payload_chain = packet.payload_head_;