Fix a segmentation fault in slowhttptest.

slowhttptest didn't check that the argument passed to freeaddrinfo(3)
was not NULL, which resulted in a segmentation fault.

OK jca@
This commit is contained in:
fcambus 2019-11-08 15:59:28 +00:00
parent 2abdb03570
commit f4a995af19
2 changed files with 20 additions and 1 deletions

View File

@ -1,10 +1,11 @@
# $OpenBSD: Makefile,v 1.15 2019/11/02 08:48:07 fcambus Exp $
# $OpenBSD: Makefile,v 1.16 2019/11/08 15:59:28 fcambus Exp $
COMMENT= test tool for slow HTTP reads/posts
GH_ACCOUNT= shekyan
GH_PROJECT= slowhttptest
GH_TAGNAME= v1.8.1
REVISION= 0
CATEGORIES= www security

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-src_slowhttptest_cc,v 1.3 2019/11/08 15:59:28 fcambus Exp $
Check that the argument passed to freeaddrinfo(3) is not NULL.
Index: src/slowhttptest.cc
--- src/slowhttptest.cc.orig
+++ src/slowhttptest.cc
@@ -152,7 +152,9 @@ SlowHTTPTest::SlowHTTPTest(int delay, int duration,
}
SlowHTTPTest::~SlowHTTPTest() {
- freeaddrinfo(addr_);
+ if (addr_) {
+ freeaddrinfo(addr_);
+ }
for(std::vector<StatsDumper*>::iterator i = dumpers_.begin();
i != dumpers_.end(); ++i) {