]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sws: fix checking `sscanf()` return value
authorViktor Szakats <commit@vsz.me>
Tue, 16 Sep 2025 10:47:27 +0000 (12:47 +0200)
committerViktor Szakats <commit@vsz.me>
Tue, 16 Sep 2025 11:34:51 +0000 (13:34 +0200)
Closes #18565

tests/server/sws.c

index 2b94e529383f011fec9234b777dae3dfe27f6899..a512a7a31e2610cd2268a467856b0f67ebfa1f12 100644 (file)
@@ -330,7 +330,7 @@ static int sws_ProcessRequest(struct sws_httprequest *req)
     size_t npath = 0; /* httppath length */
 
     if(sscanf(line,
-              "%" REQUEST_KEYWORD_SIZE_TXT"s ", request)) {
+              "%" REQUEST_KEYWORD_SIZE_TXT"s ", request) == 1) {
       http = strstr(line + strlen(request), "HTTP/");
 
       if(http && sscanf(http, "HTTP/%d.%d",