From 958f3e0def70726fd4f972b6e857a12c4c22afa4 Mon Sep 17 00:00:00 2001 From: behrisch Date: Sun, 29 Jun 2014 07:24:52 +0200 Subject: [PATCH] removing improper array length calculation This bug was found using a clang build --- src/apps/tcpip/storage.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/apps/tcpip/storage.cpp b/src/apps/tcpip/storage.cpp index 5770f55..a82745d 100644 --- a/src/apps/tcpip/storage.cpp +++ b/src/apps/tcpip/storage.cpp @@ -40,8 +40,7 @@ namespace tcpip // ---------------------------------------------------------------------- Storage::Storage(const unsigned char packet[], int length) { - // Length is calculated, if -1, or given - if (length == -1) length = sizeof(packet) / sizeof(unsigned char); + assert(length >= 0); store.reserve(length); // Get the content