mirror of
https://github.com/curl/curl.git
synced 2026-07-24 18:07:23 +03:00
tests/server: silence clang-tidy warning
It looks like a case that can never happen in practice.
Seen on mingw-w64 with experimental concatenated (vs. #included) test
sources:
```
tests/server/util.c:662:16: error: Null pointer passed as 1st
argument to string length function [clang-analyzer-unix.cstring.NullArg]
662 | size_t len = strlen(unix_socket);
| ^
```
Ref: https://github.com/curl/curl/actions/runs/22267482855/job/64416261156#step:10:273
Closes #20668
This commit is contained in:
parent
c387c9fd0c
commit
29758a6143
1 changed files with 8 additions and 1 deletions
|
|
@ -659,7 +659,14 @@ int bind_unix_socket(curl_socket_t sock, const char *unix_socket,
|
|||
int error;
|
||||
char errbuf[STRERROR_LEN];
|
||||
int rc;
|
||||
size_t len = strlen(unix_socket);
|
||||
size_t len;
|
||||
|
||||
if(!unix_socket) {
|
||||
logmsg("Unix socket domain path not specified.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
len = strlen(unix_socket);
|
||||
|
||||
memset(sau, 0, sizeof(struct sockaddr_un));
|
||||
sau->sun_family = AF_UNIX;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue