Browse Source

[mod_proxy] fix typo identified by coverity

fix mod_proxy.c typo identified by coverity
silence some warnings checking return values of fcntl() in fdevent.c
personal/stbuehler/mod-csrf
Glenn Strauss 5 years ago
parent
commit
69aeaf2fad
  1. 8
      src/fdevent.c
  2. 2
      src/mod_proxy.c

8
src/fdevent.c

@ -330,7 +330,7 @@ int fdevent_socket_cloexec(int domain, int type, int protocol) {
#endif
if (-1 != (fd = socket(domain, type, protocol))) {
#ifdef FD_CLOEXEC
fcntl(fd, F_SETFD, FD_CLOEXEC);
force_assert(-1 != fcntl(fd, F_SETFD, FD_CLOEXEC));
#endif
}
return fd;
@ -344,10 +344,10 @@ int fdevent_socket_nb_cloexec(int domain, int type, int protocol) {
#endif
if (-1 != (fd = socket(domain, type, protocol))) {
#ifdef FD_CLOEXEC
fcntl(fd, F_SETFD, FD_CLOEXEC);
force_assert(-1 != fcntl(fd, F_SETFD, FD_CLOEXEC));
#endif
#ifdef O_NONBLOCK
fcntl(fd, F_SETFL, O_NONBLOCK | O_RDWR);
force_assert(-1 != fcntl(fd, F_SETFL, O_NONBLOCK | O_RDWR));
#endif
}
return fd;
@ -364,7 +364,7 @@ int fdevent_open_cloexec(const char *pathname, int flags, mode_t mode) {
int fd = open(pathname, flags | O_NOCTTY, mode);
#ifdef FD_CLOEXEC
if (fd != -1)
fcntl(fd, F_SETFD, FD_CLOEXEC);
force_assert(-1 != fcntl(fd, F_SETFD, FD_CLOEXEC));
#endif
return fd;
#endif

2
src/mod_proxy.c

@ -909,7 +909,7 @@ static void http_header_remap_setcookie (buffer *b, size_t off, http_header_rema
}
for (char *e = s; NULL != (s = memchr(e, ';', len)); ) {
do { ++s; } while (*s == ' ' || *s == '\t');
if ('\0' == s) return;
if ('\0' == *s) return;
/*(interested only in Domain and Path attributes)*/
e = memchr(s, '=', len - (size_t)(s - e));
if (NULL == e) { e = s+1; continue; }

Loading…
Cancel
Save