From: Stephan Kulow Date: Sun, 28 Oct 2007 19:05:49 +0000 (+0000) Subject: don't play with pointers X-Git-Tag: BASE-SuSE-Code-12_1-Branch~308^2~873 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6261d3f3b1d275bb95ee595d69d8f86770366f23;p=thirdparty%2Flibsolv.git don't play with pointers --- diff --git a/tools/repo_helix.c b/tools/repo_helix.c index 238f9993..47975e1a 100644 --- a/tools/repo_helix.c +++ b/tools/repo_helix.c @@ -637,9 +637,15 @@ endElement(void *userData, const char *name) /* this is either a kernel package or a kmp */ if (s->provides) { + int prov; npr = 0; - for (pidp = pd->repo->idarraydata + s->provides; (pid = *pidp++) != 0; ) + for ( prov = s->provides; ( pidp = pd->repo->idarraydata + prov) != 0; ++prov) { + if (!*pidp) + break; + + pid = *pidp; + const char *depname = 0; Reldep *prd = 0; @@ -674,9 +680,16 @@ endElement(void *userData, const char *name) if (s->requires) { + int reqs; npr = 0; - for (pidp = pd->repo->idarraydata + s->requires; (pid = *pidp++) != 0; ) + + for ( reqs = s->requires; ( pidp = pd->repo->idarraydata + reqs) != 0; ++reqs) { + if (!*pidp) + break; + + pid = *pidp; + const char *depname = 0; Reldep *prd = 0;