1 Index: busybox-1.8.2/archival/libipkg/pkg.c
2 ===================================================================
3 --- busybox-1.8.2.orig/archival/libipkg/pkg.c 2008-01-03 17:25:55.000000000 +0100
4 +++ busybox-1.8.2/archival/libipkg/pkg.c 2008-01-03 17:33:57.000000000 +0100
10 + len = sizeof("Conffiles:") ;
11 for (iter = pkg->conffiles.head; iter; iter = iter->next) {
12 if (iter->data->name && iter->data->value) {
13 - len = len + (strlen(iter->data->name)+strlen(iter->data->value)+5);
15 + /* " <filename> <md5hash>" */
16 + len += 1+strlen(iter->data->name)+1+strlen(iter->data->value);
19 + len +=2; /* "\n\0" */
20 temp = (char *)realloc(temp,len);
22 fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
26 - strncpy(temp, "Conffiles:\n", 12);
27 + strcpy(temp, "Conffiles:");
28 for (iter = pkg->conffiles.head; iter; iter = iter->next) {
29 if (iter->data->name && iter->data->value) {
30 - snprintf(line_str, LINE_LEN, "%s %s\n", iter->data->name, iter->data->value);
31 + snprintf(line_str, LINE_LEN, " %s %s", iter->data->name, iter->data->value);
32 strncat(temp, line_str, strlen(line_str));
36 } else if (strcasecmp(field, "Conflicts") == 0) {
39 Index: busybox-1.8.2/archival/libipkg/pkg_parse.c
40 ===================================================================
41 --- busybox-1.8.2.orig/archival/libipkg/pkg_parse.c 2008-01-03 17:25:55.000000000 +0100
42 +++ busybox-1.8.2/archival/libipkg/pkg_parse.c 2008-01-03 17:30:14.000000000 +0100
45 char file_name[1048], md5sum[1048]; /* please tell me there aren't any longer that 1k */
47 - if(!strncmp(raw, "Conffiles:", 10))
48 + if(!strncmp(raw, "Conffiles:",10))
49 raw += strlen("Conffiles:");
51 + while(*raw && isspace(*raw)) raw++;
52 while(*raw && (sscanf(raw, "%s%s", file_name, md5sum) == 2)){
53 conffile_list_append(&pkg->conffiles, file_name, md5sum);
54 /* fprintf(stderr, "%s %s ", file_name, md5sum);*/
55 - while (*raw && isspace(*raw)) {
58 - raw += strlen(file_name);
59 - while (*raw && isspace(*raw)) {
62 - raw += strlen(md5sum);
63 + raw += strlen(file_name);
64 + while(*raw && isspace(*raw)) raw++;
65 + raw += strlen(md5sum);
66 + while(*raw && isspace(*raw)) raw++;