← Commit list

11683f121d

x2018
x2018
2025-11-04
SUCCESS Duration: 142s

Subject

tool_ipfs: check the return value of curl_url_get for gwpath

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

src/tool_ipfs.c+3 -2
@@ -176,7 +176,9 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url,
}
curl_url_get(gatewayurl, CURLUPART_PORT, &gwport, CURLU_URLDECODE);
- curl_url_get(gatewayurl, CURLUPART_PATH, &gwpath, CURLU_URLDECODE);
+
+ if(curl_url_get(gatewayurl, CURLUPART_PATH, &gwpath, CURLU_URLDECODE))
+ goto clean;
/* get the path from user input */
curl_url_get(uh, CURLUPART_PATH, &inputpath, CURLU_URLDECODE);
@@ -192,7 +194,6 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url,
if(inputpath && (inputpath[0] == '/') && !inputpath[1])
*inputpath = '\0';
-
pathbuffer = curl_maprintf("%s%s%s/%s%s", gwpath,
has_trailing_slash(gwpath) ? "" : "/",
protocol, cid,