3 * Copyright (c) 2007, Novell Inc.
5 * This program is licensed under the BSD license, read LICENSE.BSD
6 * for further information
19 #include "repo_patchxml.h"
20 #include "repo_rpmmd.h"
26 <update from="rel-eng@fedoraproject.org" status="stable" type="security" version="1.4">
27 <id>FEDORA-2007-4594</id>
28 <title>imlib-1.9.15-6.fc8</title>
29 <release>Fedora 8</release>
30 <issued date="2007-12-28 16:42:30"/>
32 <reference href="https://bugzilla.redhat.com/show_bug.cgi?id=426091" id="426091" title="CVE-2007-3568 imlib: infinite loop DoS using crafted BMP image" type="bugzilla"/>
34 <description>This update includes a fix for a denial-of-service issue (CVE-2007-3568) whereby an attacker who could get an imlib-using user to view a specially-crafted BMP image could cause the user's CPU to go into an infinite loop.</description>
36 <collection short="F8">
38 <package arch="ppc64" name="imlib-debuginfo" release="6.fc8" src="http://download.fedoraproject.org/pub/fedora/linux/updates/8/ppc64/imlib-debuginfo-1.9.15-6.fc8.ppc64.rpm" version="1.9.15">
39 <filename>imlib-debuginfo-1.9.15-6.fc8.ppc64.rpm</filename>
69 static struct stateswitch stateswitches[] = {
70 { STATE_START, "updates", STATE_UPDATES, 0 },
71 { STATE_START, "update", STATE_UPDATE, 0 },
72 { STATE_UPDATES, "update", STATE_UPDATE, 0},
73 { STATE_UPDATE, "id", STATE_ID, 1},
74 { STATE_UPDATE, "title", STATE_TITLE, 1},
75 { STATE_UPDATE, "release", STATE_RELEASE, 1},
76 { STATE_UPDATE, "issued", STATE_ISSUED, 1},
77 { STATE_UPDATE, "references", STATE_REFERENCES, 0},
78 { STATE_UPDATE, "description", STATE_DESCRIPTION, 0},
79 { STATE_REFERENCES, "reference", STATE_REFERENCE, 0},
80 { STATE_UPDATE, "pkglist", STATE_PKGLIST, 0},
81 { STATE_PKGLIST, "collection", STATE_COLLECTION, 0},
82 { STATE_COLLECTION, "name", STATE_NAME, 1},
83 { STATE_COLLECTION, "package", STATE_PACKAGE, 0},
84 { STATE_COLLECTION, "filename", STATE_FILENAME, 1},
102 unsigned int timestamp;
104 struct stateswitch *swtab[NUMSTATES];
105 enum state sbtab[NUMSTATES];
117 find_attr(const char *txt, const char **atts)
119 for (; *atts; atts += 2)
121 if (!strcmp(*atts, txt))
129 startElement(void *userData, const char *name, const char **atts)
131 struct parsedata *pd = userData;
132 /*Pool *pool = pd->pool;*/
133 /*Solvable *s = pd->solvable;*/
134 struct stateswitch *sw;
135 /*const char *str; */
137 if (pd->depth != pd->statedepth)
144 for (sw = pd->swtab[pd->state]; sw->from == pd->state; sw++) /* find name in statetable */
145 if (!strcmp(sw->ename, name))
148 if (sw->from != pd->state)
151 fprintf(stderr, "into unknown: %s\n", name);
156 pd->docontent = sw->docontent;
157 pd->statedepth = pd->depth;
169 endElement(void *userData, const char *name)
171 struct parsedata *pd = userData;
172 Pool *pool = pd->pool;
173 Solvable *s = pd->solvable;
175 if (pd->depth != pd->statedepth)
178 // printf("back from unknown %d %d %d\n", pd->state, pd->depth, pd->statedepth);
187 s->name = str2id(pool, pd->content, 1);
190 repodata_set_str(pd->data, pd->datanum, SOLVABLE_SUMMARY, pd->content);
194 s->name = str2id(pool, pd->content, 1);
195 case STATE_REFERENCE:
196 case STATE_DESCRIPTION:
197 repodata_set_str(pd->data, pd->datanum, SOLVABLE_DESCRIPTION, pd->content);
211 characterData(void *userData, const XML_Char *s, int len)
213 struct parsedata *pd = userData;
219 l = pd->lcontent + len + 1;
220 if (l > pd->acontent)
222 pd->content = realloc(pd->content, l + 256);
223 pd->acontent = l + 256;
225 c = pd->content + pd->lcontent;
233 #define BUFF_SIZE 8192
236 repo_add_updateinfoxml(Repo *repo, FILE *fp, int flags)
238 Pool *pool = repo->pool;
242 struct stateswitch *sw;
244 memset(&pd, 0, sizeof(pd));
245 for (i = 0, sw = stateswitches; sw->from != NUMSTATES; i++, sw++)
247 if (!pd.swtab[sw->from])
248 pd.swtab[sw->from] = sw;
249 pd.sbtab[sw->to] = sw->from;
253 pd.data = repo_add_repodata(pd.repo, 0);
255 pd.content = malloc(256);
258 pd.tempstr = malloc(256);
261 XML_Parser parser = XML_ParserCreate(NULL);
262 XML_SetUserData(parser, &pd);
263 XML_SetElementHandler(parser, startElement, endElement);
264 XML_SetCharacterDataHandler(parser, characterData);
267 l = fread(buf, 1, sizeof(buf), fp);
268 if (XML_Parse(parser, buf, l, l == 0) == XML_STATUS_ERROR)
270 fprintf(stderr, "repo_updateinfoxml: %s at line %u:%u\n", XML_ErrorString(XML_GetErrorCode(parser)), (unsigned int)XML_GetCurrentLineNumber(parser), (unsigned int)XML_GetCurrentColumnNumber(parser));
276 XML_ParserFree(parser);
279 repodata_internalize(pd.data);