diff options
| author | Francesco Colista <francesco.colista@gmail.com> | 2012-05-14 08:39:59 +0000 |
|---|---|---|
| committer | Francesco Colista <francesco.colista@gmail.com> | 2012-05-14 08:39:59 +0000 |
| commit | 72eca277be71c790ce649358257e30cc1955eed5 (patch) | |
| tree | f3ff4b7bfb9a9f8b3d5bcad42ff26e62f7a7af02 /main/make/make-3.82-memory-corruption.patch | |
| parent | 0b711a2a87090ffa1ea08c4d7960e3fc3660922f (diff) | |
| parent | bd36a10c4b580e084e8ab303810a92172b198cc0 (diff) | |
| download | aports-72eca277be71c790ce649358257e30cc1955eed5.tar.bz2 aports-72eca277be71c790ce649358257e30cc1955eed5.tar.xz | |
Merge git://dev.alpinelinux.org/aports
Diffstat (limited to 'main/make/make-3.82-memory-corruption.patch')
| -rw-r--r-- | main/make/make-3.82-memory-corruption.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/main/make/make-3.82-memory-corruption.patch b/main/make/make-3.82-memory-corruption.patch new file mode 100644 index 0000000000..b52dd6e0b9 --- /dev/null +++ b/main/make/make-3.82-memory-corruption.patch @@ -0,0 +1,37 @@ +--- ./function.c 2011/04/18 01:25:20 1.121 ++++ ./function.c 2011/05/02 12:35:01 1.122 +@@ -706,7 +706,7 @@ + const char *word_iterator = argv[0]; + char buf[20]; + +- while (find_next_token (&word_iterator, (unsigned int *) 0) != 0) ++ while (find_next_token (&word_iterator, NULL) != 0) + ++i; + + sprintf (buf, "%d", i); +@@ -1133,21 +1133,14 @@ + + /* Find the maximum number of words we'll have. */ + t = argv[0]; +- wordi = 1; +- while (*t != '\0') ++ wordi = 0; ++ while ((p = find_next_token (&t, NULL)) != 0) + { +- char c = *(t++); +- +- if (! isspace ((unsigned char)c)) +- continue; +- ++ ++t; + ++wordi; +- +- while (isspace ((unsigned char)*t)) +- ++t; + } + +- words = xmalloc (wordi * sizeof (char *)); ++ words = xmalloc ((wordi == 0 ? 1 : wordi) * sizeof (char *)); + + /* Now assign pointers to each string in the array. */ + t = argv[0]; |
