From: Victor Julien Date: Fri, 2 May 2014 15:11:10 +0000 (+0200) Subject: http-json: fix coverity warning X-Git-Tag: suricata-2.0.1rc1~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d4215fca84ca8ed2319309cf0f41e57c0badc7ff;p=thirdparty%2Fsuricata.git http-json: fix coverity warning *** CID 1211009: Bad bit shift operation (BAD_SHIFT) /src/output-json-http.c: 265 in JsonHttpLogJSON() 259 /* log custom fields if configured */ 260 if (http_ctx->fields != 0) 261 { 262 HttpField f; 263 for (f = HTTP_FIELD_ACCEPT; f < HTTP_FIELD_SIZE; f++) 264 { >>> CID 1211009: Bad bit shift operation (BAD_SHIFT) >>> In expression "1 << f", left shifting by more than 31 bits has undefined behavior. The shift amount, "f", is as much as 46. 265 if ((http_ctx->fields & (1<flags & LOG_HTTP_EXTENDED) == 0) || 270 ((http_ctx->flags & LOG_HTTP_EXTENDED) != ________________________________________________________________________________________________________ *** CID 1211010: Bad bit shift operation (BAD_SHIFT) /src/output-json-http.c: 492 in OutputHttpLogInitSub() 486 { 487 if ((strcmp(http_fields[f].config_field, 488 field->val) == 0) || 489 (strcasecmp(http_fields[f].htp_field, 490 field->val) == 0)) 491 { >>> CID 1211010: Bad bit shift operation (BAD_SHIFT) >>> In expression "1 << f", left shifting by more than 31 bits has undefined behavior. The shift amount, "f", is as much as 46. 492 http_ctx->fields |= (1<fields & (1<fields & (1ULL<val) == 0)) { - http_ctx->fields |= (1<fields |= (1ULL<