Browse Source

[multiple] quiet clang --analyze where trivial

quiet clang --analyze warnings where trivial to do so
personal/stbuehler/fix-fdevent
Glenn Strauss 3 years ago
parent
commit
b31e7840d5
  1. 2
      src/buffer.c
  2. 4
      src/http-header-glue.c
  3. 2
      src/mod_extforward.c
  4. 5
      src/mod_rewrite.c
  5. 2
      src/mod_ssi.c

2
src/buffer.c

@ -612,7 +612,6 @@ void buffer_append_string_encoded(buffer *b, const char *s, size_t s_len, buffer
d = (unsigned char*) buffer_string_prepare_append(b, d_len);
buffer_commit(b, d_len); /* fill below */
force_assert('\0' == *d);
for (ds = (unsigned char *)s, d_len = 0, ndx = 0; ndx < s_len; ds++, ndx++) {
if (map[*ds]) {
@ -669,7 +668,6 @@ void buffer_append_string_c_escaped(buffer *b, const char *s, size_t s_len) {
d = (unsigned char*) buffer_string_prepare_append(b, d_len);
buffer_commit(b, d_len); /* fill below */
force_assert('\0' == *d);
for (ds = (unsigned char *)s, d_len = 0, ndx = 0; ndx < s_len; ds++, ndx++) {
if ((*ds < 0x20) /* control character */

4
src/http-header-glue.c

@ -31,6 +31,7 @@ int http_response_buffer_append_authority(server *srv, connection *con, buffer *
sock_addr our_addr;
socklen_t our_addr_len;
our_addr.plain.sa_family = 0;
our_addr_len = sizeof(our_addr);
if (-1 == getsockname(con->fd, (struct sockaddr *)&our_addr, &our_addr_len)
@ -245,7 +246,8 @@ static int http_response_parse_range(server *srv, connection *con, buffer *path,
for (s = range, error = 0;
!error && *s && NULL != (minus = strchr(s, '-')); ) {
char *err;
off_t la, le;
off_t la = 0, le;
*((const char **)&err) = s; /*(quiet clang --analyze)*/
if (s != minus) {
la = strtoll(s, &err, 10);

2
src/mod_extforward.c

@ -730,7 +730,7 @@ static handler_t mod_extforward_Forwarded (server *srv, connection *con, plugin_
used = j+1;
offsets[used] = -1; /* mark end of last set of params */
while (j > 0) { /*(param=value pairs, so j > 0, not j >= 0)*/
while (j >= 4) { /*(param=value pairs)*/
if (-1 == offsets[j]) { --j; continue; }
do {
j -= 3; /*(k, klen, v, vlen come in sets of 4)*/

5
src/mod_rewrite.c

@ -240,6 +240,11 @@ static handler_t process_rewrite_rules(server *srv, connection *con, plugin_data
if (hctx->loops++ > 100) {
data_config *dc = p->conf.context;
if (NULL == dc) {
log_error_write(srv, __FILE__, __LINE__, "s",
"ENDLESS LOOP IN rewrite-rule DETECTED ... aborting request");
return HANDLER_ERROR;
}
log_error_write(srv, __FILE__, __LINE__, "SbbSBS",
"ENDLESS LOOP IN rewrite-rule DETECTED ... aborting request, perhaps you want to use url.rewrite-once instead of url.rewrite-repeat ($", dc->comp_key, dc->op, "\"", dc->string, "\")");

2
src/mod_ssi.c

@ -1210,7 +1210,7 @@ static int mod_ssi_handle_request(server *srv, connection *con, handler_ctx *p)
/* Reset the modified time of included files */
include_file_last_mtime = 0;
mod_ssi_process_file(srv, con, p, &st);
if (mod_ssi_process_file(srv, con, p, &st)) return -1;
con->file_started = 1;
con->file_finished = 1;

Loading…
Cancel
Save