diff options
Diffstat (limited to 'openembedded/packages/ipkg/ipkg-0.99.129/buffer-overflow.patch')
-rw-r--r-- | openembedded/packages/ipkg/ipkg-0.99.129/buffer-overflow.patch | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/openembedded/packages/ipkg/ipkg-0.99.129/buffer-overflow.patch b/openembedded/packages/ipkg/ipkg-0.99.129/buffer-overflow.patch deleted file mode 100644 index 91234fd53f..0000000000 --- a/openembedded/packages/ipkg/ipkg-0.99.129/buffer-overflow.patch +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | Index: ipkg_cmd.c | ||
2 | =================================================================== | ||
3 | RCS file: /cvs/familiar/dist/ipkg/C/ipkg_cmd.c,v | ||
4 | retrieving revision 1.96 | ||
5 | diff -u -r1.96 ipkg_cmd.c | ||
6 | --- C/ipkg_cmd.c 19 Aug 2004 10:55:47 -0000 1.96 | ||
7 | +++ C/ipkg_cmd.c 11 Sep 2004 19:43:14 -0000 | ||
8 | @@ -860,6 +860,7 @@ | ||
9 | str_list_elt_t *iter; | ||
10 | char *pkg_version; | ||
11 | size_t buff_len = 8192; | ||
12 | + size_t used_len; | ||
13 | char *buff ; | ||
14 | |||
15 | buff = (char *)malloc(buff_len); | ||
16 | @@ -891,9 +892,20 @@ | ||
17 | } | ||
18 | #else | ||
19 | if (buff) { | ||
20 | - snprintf(buff, buff_len, "Package %s (%s) is installed on %s and has the following files:\n", | ||
21 | - pkg->name, pkg_version, pkg->dest->name); | ||
22 | + try_again: | ||
23 | + used_len = snprintf(buff, buff_len, "Package %s (%s) is installed on %s and has the following files:\n", | ||
24 | + pkg->name, pkg_version, pkg->dest->name) + 1; | ||
25 | + if (used_len > buff_len) { | ||
26 | + buff_len *= 2; | ||
27 | + buff = realloc (buff, buff_len); | ||
28 | + goto try_again; | ||
29 | + } | ||
30 | for (iter = installed_files->head; iter; iter = iter->next) { | ||
31 | + used_len += strlen (iter->data) + 1; | ||
32 | + while (buff_len <= used_len) { | ||
33 | + buff_len *= 2; | ||
34 | + buff = realloc (buff, buff_len); | ||
35 | + } | ||
36 | strncat(buff, iter->data, buff_len); | ||
37 | strncat(buff, "\n", buff_len); | ||
38 | } | ||