Skip to content

coverity modeling #31

@chipitsine

Description

@chipitsine

we need to write coverity modelling to suppress the following finding

** CID 1646569:         (INTEGER_OVERFLOW)
/src/http_act.c: 1720           in parse_http_set_headers_bin()
/src/http_act.c: 1720           in parse_http_set_headers_bin()


_____________________________________________________________________________________________
*** CID 1646569:           (INTEGER_OVERFLOW)
/src/http_act.c: 1720             in parse_http_set_headers_bin()
1714     		if (strcmp(args[cur_arg], "prefix") == 0 ) {
1715     			if(!*args[cur_arg+1]) {
1716     				memprintf(err, "expects 1 argument: <headers>; or 3 arguments: <headers> prefix <pfx>");
1717     				return ACT_RET_PRS_ERR;
1718     			} else {
1719     				cur_arg++;
>>>     CID 1646569:           (INTEGER_OVERFLOW)
>>>     Expression "__l--", where "__l" is known to be equal to 0, underflows the type of "__l--", which is type "size_t".
1720     				rule->arg.http.str = ist(strdup(args[cur_arg]));
1721     			}
1722     		} else {
1723     			memprintf(err, "expects 1 argument: <headers>; or 3 arguments: <headers> prefix <pfx>");
1724     			return ACT_RET_PRS_ERR;
1725     		}
/src/http_act.c: 1720             in parse_http_set_headers_bin()
1714     		if (strcmp(args[cur_arg], "prefix") == 0 ) {
1715     			if(!*args[cur_arg+1]) {
1716     				memprintf(err, "expects 1 argument: <headers>; or 3 arguments: <headers> prefix <pfx>");
1717     				return ACT_RET_PRS_ERR;
1718     			} else {
1719     				cur_arg++;
>>>     CID 1646569:           (INTEGER_OVERFLOW)
>>>     Expression "++__l", where "__l" is known to be equal to 18446744073709551615, overflows the type of "++__l", which is type "size_t".
1720     				rule->arg.http.str = ist(strdup(args[cur_arg]));
1721     			}
1722     		} else {
1723     			memprintf(err, "expects 1 argument: <headers>; or 3 arguments: <headers> prefix <pfx>");
1724     			return ACT_RET_PRS_ERR;
1725     		}

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions