Rikard Falkeborn d909ac8565 Bugfix buffer size for strdup like functions (#1893)
strdup() allocates the string length plus one for a terminating null
character. Add one to compensate for this.

Fixes false positive buffer out of bounds on code like this:

	void f() {
		const char *a = "abcd";
		char * b = strdup(a);
		printf("%c", b[4]); // prints the terminating null character
		free(b);
	}

Also, add a testcase for valueFlowDynamicBufferSize() and add tests for
strdup(), malloc() and calloc().
2019-06-16 16:02:27 +02:00
..
2017-06-05 13:23:00 +02:00
2018-01-14 15:37:52 +01:00
2019-02-09 07:24:06 +01:00
2019-06-15 13:01:34 +02:00
2019-02-09 07:24:06 +01:00
2019-02-09 07:24:06 +01:00
2019-02-09 07:24:06 +01:00
2019-04-16 19:07:44 +02:00
2019-05-21 10:43:33 +02:00
2019-02-09 07:24:06 +01:00
2019-02-09 07:24:06 +01:00
2019-02-09 07:24:06 +01:00
2019-03-02 08:06:23 +01:00
2019-02-09 07:24:06 +01:00
2019-04-06 06:54:38 +02:00
2019-03-02 08:06:23 +01:00
2019-02-09 07:24:06 +01:00
2019-02-09 07:24:06 +01:00
2019-02-09 07:24:06 +01:00
2019-02-09 07:24:06 +01:00
2019-02-09 07:24:06 +01:00
2019-03-16 09:17:50 +01:00