From a7aaf5c89ec49efa145fb8959414c006ef7959ae Mon Sep 17 00:00:00 2001 From: Olivier Roques Date: Thu, 24 Oct 2019 19:18:48 +0200 Subject: [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 Change-Id: Ie5ab08036186ea4b766f6825c129ee68d01fc2b6 --- libtransport/src/hicn/transport/utils/verifier.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libtransport/src/hicn') 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)->separateHeaderPayload(); // header chain points to the IP + TCP hicn header utils::MemBuf *header_chain = packet.header_head_; utils::MemBuf *payload_chain = packet.payload_head_; -- cgit 1.2.3-korg