From d69f153cdb457c4d4ac49ed2d29861d5869c78cd Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Fri, 31 May 2024 12:05:37 +0200 Subject: [PATCH] test/http: avoid NULL pointer STRCMP (undefined behaivor) --- test/http.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/http.c b/test/http.c index a8417e438..2da471cee 100644 --- a/test/http.c +++ b/test/http.c @@ -344,9 +344,9 @@ static void http_resp_handler(int err, const struct http_msg *msg, void *arg) /* verify HTTP response */ TEST_STRCMP("1.1", 3, msg->ver.p, msg->ver.l); - TEST_STRCMP("", 0, msg->met.p, msg->met.l); - TEST_STRCMP("", 0, msg->path.p, msg->path.l); - TEST_STRCMP("", 0, msg->prm.p, msg->prm.l); + TEST_ASSERT(!msg->met.p); + TEST_ASSERT(!msg->path.p); + TEST_ASSERT(!msg->prm.p); TEST_EQUALS(200, msg->scode); TEST_STRCMP("OK", 2, msg->reason.p, msg->reason.l); TEST_EQUALS(t->clen, msg->clen);