mailing list of musl libc
 help / color / mirror / code / Atom feed
f3a1f6ca75a2fab10bcdff7535a05526b3e43581 blob 361 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 
// commit 9543656cc32fda48fc463f332ee20e91eed2b768 2016-03-06
// __putenv could be confused into freeing storage that does not belong to the implementation
#define _GNU_SOURCE
#include <stdlib.h>
#include <string.h>

int main(void)
{
	setenv("A", "1", 1);
	setenv("A", "2", 1);
	char *c = strdup("A=3");
	putenv(c);
	setenv("A", "4", 1);
	free(c);
	return 0;
}
debug log:

solving f3a1f6c ...
found f3a1f6c in https://inbox.vuxu.org/musl/1457293274-13000-1-git-send-email-amonakov@ispras.ru/

applying [1/1] https://inbox.vuxu.org/musl/1457293274-13000-1-git-send-email-amonakov@ispras.ru/
diff --git a/src/regression/putenv-doublefree.c b/src/regression/putenv-doublefree.c
new file mode 100644
index 0000000..f3a1f6c

Checking patch src/regression/putenv-doublefree.c...
Applied patch src/regression/putenv-doublefree.c cleanly.

index at:
100644 f3a1f6ca75a2fab10bcdff7535a05526b3e43581	src/regression/putenv-doublefree.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).