RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: jbj@rpm5.org Module: rpm Date: 30-Sep-2007 22:38:29 Branch: HEAD Handle: 2007093021382504 Modified files: rpm/lib .splintrc cpio.c depends.c formats.c fs.c fsm.c getdate.c manifest.c misc.c package.c poptALL.c poptI.c poptQV.c psm.c query.c rpmal.c rpmchecksig.c rpmds.c rpmevr.c rpmfc.c rpmfi.c rpmfi.h rpmgi.c rpmgi.h rpminstall.c rpmlib.h rpmlock.c rpmns.c rpmns.h rpmps.c rpmps.h rpmrc.c rpmrollback.c rpmsx.c rpmte.c rpmts.c rpmts.h signature.c stringbuf.c tar.c transaction.c verify.c rpm/rpmio envvar.h Log: - splint fiddles. Summary: Revision Changes Path 2.13 +7 -11 rpm/lib/.splintrc 2.133 +1 -21 rpm/lib/cpio.c 1.341 +10 -51 rpm/lib/depends.c 2.109 +10 -15 rpm/lib/formats.c 2.55 +0 -16 rpm/lib/fs.c 2.130 +2 -94 rpm/lib/fsm.c 1.14 +2 -2 rpm/lib/getdate.c 2.18 +0 -14 rpm/lib/manifest.c 2.143 +0 -8 rpm/lib/misc.c 2.163 +6 -32 rpm/lib/package.c 2.45 +2 -3 rpm/lib/poptALL.c 2.37 +0 -4 rpm/lib/poptI.c 2.46 +0 -4 rpm/lib/poptQV.c 2.232 +24 -45 rpm/lib/psm.c 2.184 +2 -20 rpm/lib/query.c 2.61 +0 -14 rpm/lib/rpmal.c 1.147 +18 -25 rpm/lib/rpmchecksig.c 2.66 +10 -88 rpm/lib/rpmds.c 1.3 +0 -2 rpm/lib/rpmevr.c 1.17 +6 -36 rpm/lib/rpmfc.c 2.79 +10 -88 rpm/lib/rpmfi.c 2.41 +14 -10 rpm/lib/rpmfi.h 2.34 +5 -10 rpm/lib/rpmgi.c 2.23 +1 -1 rpm/lib/rpmgi.h 1.166 +9 -7 rpm/lib/rpminstall.c 2.438 +2 -2 rpm/lib/rpmlib.h 2.14 +0 -4 rpm/lib/rpmlock.c 1.5 +3 -2 rpm/lib/rpmns.c 1.5 +2 -2 rpm/lib/rpmns.h 2.13 +2 -7 rpm/lib/rpmps.c 2.11 +4 -0 rpm/lib/rpmps.h 2.211 +7 -20 rpm/lib/rpmrc.c 1.14 +4 -4 rpm/lib/rpmrollback.c 2.16 +0 -8 rpm/lib/rpmsx.c 2.52 +2 -14 rpm/lib/rpmte.c 2.103 +11 -17 rpm/lib/rpmts.c 2.78 +1 -1 rpm/lib/rpmts.h 2.192 +22 -7 rpm/lib/signature.c 2.24 +0 -6 rpm/lib/stringbuf.c 1.4 +0 -6 rpm/lib/tar.c 1.335 +8 -37 rpm/lib/transaction.c 2.169 +0 -11 rpm/lib/verify.c 1.5 +5 -1 rpm/rpmio/envvar.h ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/lib/.splintrc ============================================================================ $ cvs diff -u -r2.12 -r2.13 .splintrc --- rpm/lib/.splintrc 19 Jun 2007 03:30:12 -0000 2.12 +++ rpm/lib/.splintrc 30 Sep 2007 20:38:25 -0000 2.13 @@ -13,25 +13,21 @@ +strict # lclint level # --- in progress -#+bounds +slovak-fcns --redecl -bufferoverflowhigh +-globuse +-redecl # 38 ++voidabstract +-warnlintcomments + -branchstate --compdef # 9 +-compdef -evalorder -exportheader -globs --globstate --moduncon -mustmod --noeffectuncon --nullderef # 2 --nullpass # 62 rpmExpand annoyance --nullptrarith --nullstate # 2 --unrecog +-nullpass # 31 # --- +partial artifacts -declundef @@ . patch -p0 <<'@@ .' Index: rpm/lib/cpio.c ============================================================================ $ cvs diff -u -r2.132 -r2.133 cpio.c --- rpm/lib/cpio.c 1 Aug 2007 17:58:35 -0000 2.132 +++ rpm/lib/cpio.c 30 Sep 2007 20:38:25 -0000 2.133 @@ -43,26 +43,20 @@ buf[num] = '\0'; ret = strtoul(buf, &end, base); -/*@-boundsread@*/ /* LCL: strtoul annotations */ if (*end != '\0') *endptr = ((char *)str) + (end - buf); /* XXX discards const */ else *endptr = ((char *)str) + strlen(buf); -/*@=boundsread@*/ return ret; } #define GET_NUM_FIELD(phys, log) \ - /*@-boundswrite@*/ \ log = strntoul(phys, &end, 16, sizeof(phys)); \ - /*@=boundswrite@*/ \ if ( (end - phys) != sizeof(phys) ) return CPIOERR_BAD_HEADER; #define SET_NUM_FIELD(phys, val, space) \ sprintf(space, "%8.8lx", (unsigned long) (val)); \ - /*@-boundsread@*/ \ - memcpy(phys, space, 8) \ - /*@=boundsread@*/ + memcpy(phys, space, 8) int cpioTrailerWrite(FSM_t fsm) { @@ -70,13 +64,11 @@ (struct cpioCrcPhysicalHeader *)fsm->rdbuf; int rc; -/*@-boundswrite@*/ memset(hdr, '0', PHYS_HDR_SIZE); memcpy(hdr->magic, CPIO_NEWC_MAGIC, sizeof(hdr->magic)); memcpy(hdr->nlink, "00000001", 8); memcpy(hdr->namesize, "0000000b", 8); memcpy(fsm->rdbuf + PHYS_HDR_SIZE, CPIO_TRAILER, sizeof(CPIO_TRAILER)); -/*@=boundswrite@*/ /* XXX DWRITE uses rdnb for I/O length. */ fsm->rdnb = PHYS_HDR_SIZE + sizeof(CPIO_TRAILER); @@ -119,9 +111,7 @@ len = strlen(fsm->path) + 1; SET_NUM_FIELD(hdr->namesize, len, field); memcpy(hdr->checksum, "00000000", 8); -/*@-boundswrite@*/ memcpy(fsm->rdbuf + PHYS_HDR_SIZE, fsm->path, len); -/*@=boundswrite@*/ /* XXX DWRITE uses rdnb for I/O length. */ fsm->rdnb = PHYS_HDR_SIZE + len; @@ -162,9 +152,7 @@ if (!rc && fsm->rdnb != fsm->wrlen) rc = CPIOERR_READ_FAILED; if (rc) return rc; -/*@-boundswrite@*/ memcpy(&hdr, fsm->wrbuf, fsm->rdnb); -/*@=boundswrite@*/ if (strncmp(CPIO_CRC_MAGIC, hdr.magic, sizeof(CPIO_CRC_MAGIC)-1) && strncmp(CPIO_NEWC_MAGIC, hdr.magic, sizeof(CPIO_NEWC_MAGIC)-1)) @@ -204,10 +192,8 @@ fsm->path = NULL; return rc; } -/*@-boundswrite@*/ memcpy(t, fsm->wrbuf, fsm->rdnb); t[nameSize] = '\0'; -/*@=boundswrite@*/ fsm->path = t; } @@ -219,9 +205,7 @@ if (!rc && fsm->rdnb != fsm->wrlen) rc = CPIOERR_READ_FAILED; if (rc) return rc; -/*@-boundswrite@*/ fsm->wrbuf[st->st_size] = '\0'; -/*@=boundswrite@*/ fsm->lpath = xstrdup(fsm->wrbuf); } @@ -241,7 +225,6 @@ int l, myerrno = errno; strcpy(msg, "cpio: "); - /*@-branchstate@*/ switch (rc) { default: s = msg + strlen(msg); @@ -280,20 +263,17 @@ case CPIOERR_ENOENT: s = strerror(ENOENT); break; case CPIOERR_ENOTEMPTY: s = strerror(ENOTEMPTY); break; } - /*@=branchstate@*/ l = sizeof(msg) - strlen(msg) - 1; if (s != NULL) { if (l > 0) strncat(msg, s, l); l -= strlen(s); } - /*@-branchstate@*/ if ((rc & CPIOERR_CHECK_ERRNO) && myerrno) { s = _(" failed - "); if (l > 0) strncat(msg, s, l); l -= strlen(s); if (l > 0) strncat(msg, strerror(myerrno), l); } - /*@=branchstate@*/ return msg; } @@ . patch -p0 <<'@@ .' Index: rpm/lib/depends.c ============================================================================ $ cvs diff -u -r1.340 -r1.341 depends.c --- rpm/lib/depends.c 5 Sep 2007 23:08:01 -0000 1.340 +++ rpm/lib/depends.c 30 Sep 2007 20:38:25 -0000 1.341 @@ -50,8 +50,8 @@ int orIndex; }; -/*@unchecked@*/ #if defined(CACHE_DEPENDENCY_RESULT) +/*@unchecked@*/ int _cacheDependsRC = CACHE_DEPENDENCY_RESULT; #endif @@ -99,7 +99,6 @@ /* Filter out duplicate erasures. */ if (ts->numRemovedPackages > 0 && ts->removedPackages != NULL) { int * needle = NULL; -/*@-boundswrite@*/ needle = bsearch(&dboffset, ts->removedPackages, ts->numRemovedPackages, sizeof(*ts->removedPackages), intcmp); if (needle != NULL) { @@ -108,7 +107,6 @@ *indexp = needle - ts->removedPackages; return 0; } -/*@=boundswrite@*/ } if (ts->numRemovedPackages == ts->allocedRemovedPackages) { @@ -118,10 +116,8 @@ } if (ts->removedPackages != NULL) { /* XXX can't happen. */ -/*@-boundswrite@*/ ts->removedPackages[ts->numRemovedPackages] = dboffset; ts->numRemovedPackages++; -/*@=boundswrite@*/ if (ts->numRemovedPackages > 1) qsort(ts->removedPackages, ts->numRemovedPackages, sizeof(*ts->removedPackages), intcmp); @@ -135,12 +131,10 @@ } p = rpmteNew(ts, h, TR_REMOVED, NULL, NULL, dboffset, depends); -/*@-boundswrite@*/ ts->order[ts->orderCount] = p; if (indexp != NULL) *indexp = ts->orderCount; ts->orderCount++; -/*@=boundswrite@*/ /*@-nullstate@*/ /* XXX FIX: ts->order[] can be NULL. */ return 0; @@ -241,7 +235,7 @@ const char * pkgNVRA = NULL; rpmps ps = rpmtsProblems(ts); xx = headerGetExtension(h, RPMTAG_NVRA, NULL, &pkgNVRA, NULL); -assert(pkgNVRA); +assert(pkgNVRA != NULL); rpmpsAppend(ps, RPMPROB_BADPLATFORM, pkgNVRA, key, platform, NULL, NULL, 0); ps = rpmpsFree(ps); @@ -352,15 +346,11 @@ if (duplicate && oc < ts->orderCount) { /*@-type -unqualifiedtrans@*/ -/*@-boundswrite@*/ ts->order[oc] = rpmteFree(ts->order[oc]); -/*@=boundswrite@*/ /*@=type =unqualifiedtrans@*/ } -/*@-boundswrite@*/ ts->order[oc] = p; -/*@=boundswrite@*/ if (!duplicate) { ts->orderCount++; rpmcliPackagesTotal++; @@ -370,9 +360,7 @@ rpmteDS(p, RPMTAG_PROVIDENAME), rpmteFI(p, RPMTAG_BASENAMES), tscolor); if (pkgKey == RPMAL_NOMATCH) { -/*@-boundswrite@*/ ts->order[oc] = rpmteFree(ts->order[oc]); -/*@=boundswrite@*/ ts->teInstall = NULL; ec = 1; goto exit; @@ -405,7 +393,9 @@ /* On upgrade, erase older packages of same color (if any). */ if (_upgrade_tag == 0) { const char *t = rpmExpand("%{?_upgrade_tag}", NULL); +/*@-mods@*/ _upgrade_tag = (!strcmp(t, "name") ? RPMTAG_NAME : RPMTAG_PROVIDENAME); +/*@=mods@*/ t = _free(t); } @@ -443,7 +433,9 @@ if (_obsolete_tag == 0) { const char *t = rpmExpand("%{?_obsolete_tag}", NULL); +/*@-mods@*/ _obsolete_tag = (!strcmp(t, "name") ? RPMTAG_NAME : RPMTAG_PROVIDENAME); +/*@=mods@*/ t = _free(t); } if (!(depFlags & RPMDEPS_FLAG_NOOBSOLETES)) { @@ -562,6 +554,7 @@ int rc; int xx; int retries = 10; + /*@only@*/ /*@null@*/ static char *sysinfo_path = NULL;; if ((Name = rpmdsN(dep)) == NULL) @@ -582,7 +575,6 @@ const char * DNEVR; rc = -1; -/*@-branchstate@*/ if ((DNEVR = rpmdsDNEVR(dep)) != NULL) { DBC * dbcursor = NULL; void * datap = NULL; @@ -605,13 +597,10 @@ datap = data->data; datalen = data->size; -/*@-boundswrite@*/ if (xx == 0 && datap && datalen == 4) memcpy(&rc, datap, datalen); -/*@=boundswrite@*/ xx = dbiCclose(dbi, dbcursor, 0); } -/*@=branchstate@*/ if (rc >= 0) { rpmdsNotify(dep, _("(cached)"), rc); @@ -731,7 +720,9 @@ rc = 1; /* no mounted paths !?! */ else { char * end = NULL; +/*@-unrecog@*/ long long needed = strtoll(rpmdsEVR(dep), &end, 0); +/*@=unrecog@*/ if (end && *end) { if (strchr("Gg", end[0]) && strchr("Bb", end[1]) && !end[2]) @@ -1004,7 +995,6 @@ /* XXX only the installer does not have the database open here. */ if (rpmtsGetRdb(ts) != NULL) { -/*@-boundsread@*/ if (Name[0] == '/') { /* depFlags better be 0! */ @@ -1018,7 +1008,6 @@ } mi = rpmdbFreeIterator(mi); } -/*@=boundsread@*/ mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, Name, 0); (void) rpmdbPruneIterator(mi, @@ -1037,7 +1026,6 @@ /* * Search for an unsatisfied dependency. */ -/*@-boundsread@*/ if (adding == 1 && retries > 0 && !(rpmtsDFlags(ts) & RPMDEPS_FLAG_NOSUGGEST)) { if (ts->solve != NULL) { xx = (*ts->solve) (ts, dep, ts->solveData); @@ -1050,7 +1038,6 @@ } } } -/*@=boundsread@*/ unsatisfied: if (Flags & RPMSENSE_MISSINGOK) { @@ -1074,7 +1061,6 @@ } else { const char * DNEVR; xx = 0; - /*@-branchstate@*/ if ((DNEVR = rpmdsDNEVR(dep)) != NULL) { DBC * dbcursor = NULL; size_t DNEVRlen = strlen(DNEVR); @@ -1093,7 +1079,6 @@ /*@=compmempass@*/ xx = dbiCclose(dbi, dbcursor, DB_WRITECURSOR); } - /*@=branchstate@*/ if (xx) _cacheDependsRC = 0; } @@ -1157,12 +1142,10 @@ case 1: /* requirements are not satisfied. */ { fnpyKey * suggestedKeys = NULL; - /*@-branchstate@*/ if (ts->availablePackages != NULL) { suggestedKeys = rpmalAllSatisfiesDepend(ts->availablePackages, requires, NULL); } - /*@=branchstate@*/ rpmdsProblem(ps, pkgNEVRA, requires, suggestedKeys, adding); @@ -1231,12 +1214,10 @@ case 1: /* requirements are not satisfied. */ { fnpyKey * suggestedKeys = NULL; - /*@-branchstate@*/ if (ts->availablePackages != NULL) { suggestedKeys = rpmalAllSatisfiesDepend(ts->availablePackages, dirnames, NULL); } - /*@=branchstate@*/ rpmdsProblem(ps, pkgNEVRA, dirnames, suggestedKeys, adding); @@ -1275,12 +1256,10 @@ case 1: /* requirements are not satisfied. */ { fnpyKey * suggestedKeys = NULL; - /*@-branchstate@*/ if (ts->availablePackages != NULL) { suggestedKeys = rpmalAllSatisfiesDepend(ts->availablePackages, linktos, NULL); } - /*@=branchstate@*/ rpmdsProblem(ps, pkgNEVRA, linktos, suggestedKeys, adding); @@ -1329,7 +1308,7 @@ int rc; rc = headerGetExtension(h, RPMTAG_NVRA, NULL, &pkgNVRA, NULL); -assert(pkgNVRA); +assert(pkgNVRA != NULL); if (!(depFlags & RPMDEPS_FLAG_NOREQUIRES)) requires = rpmdsNew(h, RPMTAG_REQUIRENAME, scareMem); if (!(depFlags & RPMDEPS_FLAG_NOCONFLICTS)) @@ -1454,7 +1433,6 @@ * @param q predecessor element (i.e. with Provides: ) * @return 1 if dependency is to be ignored. */ -/*@-boundsread@*/ static int ignoreDep(const rpmts ts, const rpmte p, const rpmte q) /*@globals badDeps, badDepsInitialized, rpmGlobalMacroContext, h_errno @*/ @@ -1510,7 +1488,6 @@ return 0; /*@=compdef@*/ } -/*@=boundsread@*/ /** * Recursively mark all nodes with their predecessors. @@ -1524,7 +1501,6 @@ { rpmte p; - /*@-branchstate@*/ /* FIX: q is kept */ while (tsi != NULL && (p = tsi->tsi_suc) != NULL) { tsi = tsi->tsi_next; if (rpmteTSI(p)->tsi_chain != NULL) @@ -1535,7 +1511,6 @@ if (rpmteTSI(p)->tsi_next != NULL) markLoop(rpmteTSI(p)->tsi_next, p); } - /*@=branchstate@*/ } /* @@ -1576,7 +1551,6 @@ * @param msglvl message level at which to spew * @return (possibly NULL) formatted "q <- p" releation (malloc'ed) */ -/*@-boundswrite@*/ /*@-mustmod@*/ /* FIX: hack modifies, but -type disables */ static /*@owned@*/ /*@null@*/ const char * zapRelation(rpmte q, rpmte p, @@ -1615,7 +1589,6 @@ /* * Attempt to unravel a dependency loop by eliminating Requires's. */ - /*@-branchstate@*/ if (zap) { rpmMessage(msglvl, _("removing %s \"%s\" from tsort relations.\n"), @@ -1630,14 +1603,12 @@ if (zap) zap--; } - /*@=branchstate@*/ /* XXX Note: the loop traverses "not found", get out now! */ break; } return dp; } /*@=mustmod@*/ -/*@=boundswrite@*/ /** * Record next "q <- p" relation (i.e. "p" requires "q"). @@ -1720,13 +1691,9 @@ return 0; /* Avoid redundant relations. */ -/*@-boundsread@*/ if (selected[i] != 0) return 0; -/*@=boundsread@*/ -/*@-boundswrite@*/ selected[i] = 1; -/*@=boundswrite@*/ /* T3. Record next "q <- p" relation (i.e. "p" requires "q"). */ rpmteTSI(p)->tsi_count++; /* bump p predecessor count */ @@ -1771,7 +1738,6 @@ * @retval *rp last element * @param prefcolor preferred color */ -/*@-boundswrite@*/ /*@-mustmod@*/ static void addQ(/*@dependent@*/ rpmte p, /*@in@*/ /*@out@*/ rpmte * qp, @@ -1823,7 +1789,6 @@ } } /*@=mustmod@*/ -/*@=boundswrite@*/ /*@unchecked@*/ #ifdef NOTYET @@ -1834,7 +1799,6 @@ #define isAuto(_x) (1) #endif -/*@-bounds@*/ int rpmtsOrder(rpmts ts) { rpmds requires; @@ -2270,7 +2234,6 @@ /*@-type@*/ newOrder = xcalloc(ts->orderCount, sizeof(*newOrder)); /*@=type@*/ - /*@-branchstate@*/ for (i = 0, newOrderCount = 0; i < orderingCount; i++) { struct orderListIndex_s key; @@ -2289,7 +2252,6 @@ newOrder[newOrderCount++] = q; ts->order[j] = NULL; } - /*@=branchstate@*/ assert(newOrderCount == ts->orderCount); @@ -2309,7 +2271,6 @@ return 0; } -/*@=bounds@*/ int rpmtsCheck(rpmts ts) { @@ -2472,14 +2433,12 @@ (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_CHECK), 0); - /*@-branchstate@*/ if (closeatexit) xx = rpmtsCloseDB(ts); #if defined(CACHE_DEPENDENCY_RESULT) else if (_cacheDependsRC) xx = rpmdbCloseDBI(rpmtsGetRdb(ts), RPMDBI_DEPENDS); #endif - /*@=branchstate@*/ #ifdef NOTYET /* On failed dependencies, perform the autorollback goal (if any). */ @@ . patch -p0 <<'@@ .' Index: rpm/lib/formats.c ============================================================================ $ cvs diff -u -r2.108 -r2.109 formats.c --- rpm/lib/formats.c 20 Sep 2007 16:01:49 -0000 2.108 +++ rpm/lib/formats.c 30 Sep 2007 20:38:25 -0000 2.109 @@ -40,10 +40,8 @@ { const char ** list; -/*@-boundswrite@*/ if (rpmGetFilesystemList(&list, count)) return 1; -/*@=boundswrite@*/ if (type) *type = RPM_STRING_ARRAY_TYPE; if (data) *((const char ***) data) = list; @@ -76,19 +74,18 @@ uint_32 * filesizes; uint_64 * usages; int numFiles; + int xx; if (!hge(h, RPMTAG_FILESIZES, NULL, &filesizes, &numFiles)) { filesizes = NULL; numFiles = 0; filenames = NULL; } else { - headerGetExtension(h, RPMTAG_FILEPATHS, NULL, &filenames, &numFiles); + xx = headerGetExtension(h, RPMTAG_FILEPATHS, NULL, &filenames, &numFiles); } -/*@-boundswrite@*/ if (rpmGetFilesystemList(NULL, count)) return 1; -/*@=boundswrite@*/ *type = RPM_INT64_TYPE; *freeData = 1; @@ -100,10 +97,8 @@ return 0; } -/*@-boundswrite@*/ if (rpmGetFilesystemUsage(filenames, filesizes, numFiles, &usages, 0)) return 1; -/*@=boundswrite@*/ *data = usages; @@ -124,9 +119,9 @@ static int fileclassTag(Header h, /*@out@*/ rpmTagType * type, /*@out@*/ const void ** data, /*@out@*/ int_32 * count, /*@out@*/ int * freeData) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies h, *type, *data, *count, *freeData, - rpmGlobalMacroContext, fileSystem @*/ + rpmGlobalMacroContext, fileSystem, internalState @*/ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0 /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/ { @@ -148,9 +143,9 @@ static int filecontextsTag(Header h, /*@out@*/ rpmTagType * type, /*@out@*/ const void ** data, /*@out@*/ int_32 * count, /*@out@*/ int * freeData) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies h, *type, *data, *count, *freeData, - rpmGlobalMacroContext, fileSystem @*/ + rpmGlobalMacroContext, fileSystem, internalState @*/ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0 /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/ { @@ -172,9 +167,9 @@ static int fscontextsTag(Header h, /*@out@*/ rpmTagType * type, /*@out@*/ const void ** data, /*@out@*/ int_32 * count, /*@out@*/ int * freeData) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies h, *type, *data, *count, *freeData, - rpmGlobalMacroContext, fileSystem @*/ + rpmGlobalMacroContext, fileSystem, internalState @*/ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0 /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/ { @@ -196,9 +191,9 @@ static int recontextsTag(Header h, /*@out@*/ rpmTagType * type, /*@out@*/ const void ** data, /*@out@*/ int_32 * count, /*@out@*/ int * freeData) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies h, *type, *data, *count, *freeData, - rpmGlobalMacroContext, fileSystem @*/ + rpmGlobalMacroContext, fileSystem, internalState @*/ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0 /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/ { @@ . patch -p0 <<'@@ .' Index: rpm/lib/fs.c ============================================================================ $ cvs diff -u -r2.54 -r2.55 fs.c --- rpm/lib/fs.c 16 Jul 2007 09:14:56 -0000 2.54 +++ rpm/lib/fs.c 30 Sep 2007 20:38:25 -0000 2.55 @@ -35,11 +35,9 @@ { int i; -/*@-boundswrite@*/ if (filesystems) for (i = 0; i < numFilesystems; i++) filesystems[i].mntPoint = _free(filesystems[i].mntPoint); -/*@=boundswrite@*/ filesystems = _free(filesystems); fsnames = _free(fsnames); @@ -192,9 +190,7 @@ /*@-modunconnomods -moduncon @*/ our_mntent * itemptr = getmntent(mtab); if (!itemptr) break; -/*@-boundsread@*/ item = *itemptr; /* structure assignment */ -/*@=boundsread@*/ mntdir = item.our_mntdir; #if defined(MNTOPT_RO) /*@-compdef@*/ @@ -261,12 +257,10 @@ filesystems[numFilesystems].mntPoint = NULL; filesystems[numFilesystems].rdonly = 0; -/*@-boundswrite@*/ fsnames = xcalloc((numFilesystems + 1), sizeof(*fsnames)); for (i = 0; i < numFilesystems; i++) fsnames[i] = filesystems[i].mntPoint; fsnames[numFilesystems] = NULL; -/*@=boundswrite@*/ /*@-nullstate@*/ /* FIX: fsnames[] may be NULL */ return 0; @@ -280,10 +274,8 @@ if (getFilesystemList()) return 1; -/*@-boundswrite@*/ if (listptr) *listptr = fsnames; if (num) *num = numFilesystems; -/*@=boundswrite@*/ return 0; } @@ -311,14 +303,11 @@ sourceDir = rpmGetPath("%{_sourcedir}", NULL); maxLen = strlen(sourceDir); -/*@-boundsread@*/ for (i = 0; i < numFiles; i++) { len = strlen(fileList[i]); if (maxLen < len) maxLen = len; } -/*@=boundsread@*/ -/*@-boundswrite@*/ buf = alloca(maxLen + 1); lastDir = alloca(maxLen + 1); dirName = alloca(maxLen + 1); @@ -381,18 +370,13 @@ strcpy(lastDir, buf); usages[lastfs] += fssizes[i]; } -/*@=boundswrite@*/ sourceDir = _free(sourceDir); -/*@-boundswrite@*/ - /*@-branchstate@*/ if (usagesPtr) *usagesPtr = usages; else usages = _free(usages); - /*@=branchstate@*/ -/*@=boundswrite@*/ return 0; } @@ . patch -p0 <<'@@ .' Index: rpm/lib/fsm.c ============================================================================ $ cvs diff -u -r2.129 -r2.130 fsm.c --- rpm/lib/fsm.c 9 Aug 2007 18:45:29 -0000 2.129 +++ rpm/lib/fsm.c 30 Sep 2007 20:38:25 -0000 2.130 @@ -93,7 +93,6 @@ (st && !S_ISDIR(st->st_mode) ? (subdir ? strlen(subdir) : 0) : 0) + (st && !S_ISDIR(st->st_mode) ? (suffix ? strlen(suffix) : 0) : 0) + strlen(fsm->baseName) + 1; -/*@-boundswrite@*/ s = t = xmalloc(nb); t = stpcpy(t, fsm->dirName); if (st && !S_ISDIR(st->st_mode)) @@ -101,7 +100,6 @@ t = stpcpy(t, fsm->baseName); if (st && !S_ISDIR(st->st_mode)) if (suffix) t = stpcpy(t, suffix); -/*@=boundswrite@*/ } return s; } @@ -171,7 +169,6 @@ /** \ingroup payload */ -/*@-boundsread@*/ static int cpioStrCmp(const void * a, const void * b) /*@*/ { @@ -199,7 +196,6 @@ return strcmp(afn, bfn); } -/*@=boundsread@*/ /** \ingroup payload * Locate archive path in file info. @@ -207,7 +203,6 @@ * @param fsmPath archive path * @return index into file info, -1 if archive path was not found */ -/*@-boundsread@*/ static int mapFind(/*@null@*/ FSMI_t iter, const char * fsmPath) /*@modifies iter @*/ { @@ -218,11 +213,9 @@ if (fi && fi->fc > 0 && fi->apath && fsmPath && *fsmPath) { const char ** p = NULL; -/*@-boundswrite@*/ if (fi->apath != NULL) p = bsearch(&fsmPath, fi->apath, fi->fc, sizeof(fsmPath), cpioStrCmp); -/*@=boundswrite@*/ if (p) { iter->i = p - fi->apath; ix = mapNextIterator(iter); @@ -231,7 +224,6 @@ } return ix; } -/*@=boundsread@*/ /** \ingroup payload * Directory name iterator. @@ -282,7 +274,6 @@ * @param reverse traverse directory names in reverse order? * @return directory name iterator */ -/*@-boundsread@*/ /*@-usereleased@*/ static /*@only@*/ /*@null@*/ void * dnlInitIterator(/*@special@*/ const FSM_t fsm, @@ -300,18 +291,14 @@ dnli = xcalloc(1, sizeof(*dnli)); dnli->fi = fi; dnli->reverse = reverse; - /*@-branchstate@*/ dnli->i = (reverse ? fi->dc : 0); - /*@=branchstate@*/ if (fi->dc) { dnli->active = xcalloc(fi->dc, sizeof(*dnli->active)); /* Identify parent directories not skipped. */ -/*@-boundswrite@*/ for (i = 0; i < fi->fc; i++) if (!XFA_SKIPPING(fi->actions[i])) dnli->active[fi->dil[i]] = 1; -/*@=boundswrite@*/ /* Exclude parent directories that are explicitly included. */ for (i = 0; i < fi->fc; i++) { @@ -340,9 +327,7 @@ if (dnl[dnlen+bnlen] != '/' || dnl[dnlen+bnlen+1] != '\0') /*@innercontinue@*/ continue; /* This directory is included in the package. */ -/*@-boundswrite@*/ dnli->active[j] = 0; -/*@=boundswrite@*/ /*@innerbreak@*/ break; } } @@ -367,14 +352,12 @@ return dnli; } /*@=usereleased@*/ -/*@=boundsread@*/ /** \ingroup payload * Return next directory name (from file info). * @param dnli directory name iterator * @return next directory name */ -/*@-boundsread@*/ static /*@observer@*/ /*@null@*/ const char * dnlNextIterator(/*@null@*/ DNLI_t dnli) /*@modifies dnli @*/ @@ -398,7 +381,6 @@ } return dn; } -/*@=boundsread@*/ #if defined(HAVE_PTHREAD_H) static void * fsmThread(void * arg) @@ -429,7 +411,6 @@ * @param fsm file state machine data * @return Is chain only partially filled? */ -/*@-boundsread@*/ static int saveHardLink(/*@special@*/ /*@partial@*/ FSM_t fsm) /*@uses fsm->links, fsm->ix, fsm->sb, fsm->goal, fsm->nsuffix @*/ /*@defines fsm->li @*/ @@ -443,16 +424,12 @@ int j; /* Find hard link set. */ - /*@-branchstate@*/ for (fsm->li = fsm->links; fsm->li; fsm->li = fsm->li->next) { if (fsm->li->sb.st_ino == st->st_ino && fsm->li->sb.st_dev == st->st_dev) break; } - /*@=branchstate@*/ /* New hard link encountered, add new link to set. */ -/*@-boundswrite@*/ - /*@-branchstate@*/ if (fsm->li == NULL) { fsm->li = xcalloc(1, sizeof(*fsm->li)); fsm->li->next = NULL; @@ -475,16 +452,12 @@ /*@=kepttrans@*/ fsm->links = fsm->li; } - /*@=branchstate@*/ -/*@=boundswrite@*/ if (fsm->goal == FSM_PKGBUILD) --fsm->li->linksLeft; -/*@-boundswrite@*/ fsm->li->filex[fsm->li->linksLeft] = fsm->ix; /*@-observertrans -dependenttrans@*/ fsm->li->nsuffix[fsm->li->linksLeft] = fsm->nsuffix; /*@=observertrans =dependenttrans@*/ -/*@=boundswrite@*/ if (fsm->goal == FSM_PKGINSTALL) fsm->li->linksLeft++; if (fsm->goal == FSM_PKGBUILD) @@ -518,7 +491,6 @@ rc = fsmNext(fsm, FSM_MAP); return rc; } -/*@=boundsread@*/ /** \ingroup payload * Destroy set of hard links. @@ -545,13 +517,11 @@ { if (fsm) { fsm->path = _free(fsm->path); - /*@-branchstate@*/ while ((fsm->li = fsm->links) != NULL) { fsm->links = fsm->li->next; fsm->li->next = NULL; fsm->li = freeHardLink(fsm->li); } - /*@=branchstate@*/ fsm->dnlx = _free(fsm->dnlx); fsm->ldn = _free(fsm->ldn); fsm->iter = mapFreeIterator(fsm->iter); @@ -604,7 +574,6 @@ RPMCALLBACK_INST_START, fi->archivePos, fi->archiveSize); } -/*@-boundswrite@*/ /*@-assignexpose@*/ fsm->archiveSize = archiveSize; if (fsm->archiveSize) @@ -613,7 +582,6 @@ if (fsm->failedFile) *fsm->failedFile = NULL; /*@=assignexpose@*/ -/*@=boundswrite@*/ memset(fsm->sufbuf, 0, sizeof(fsm->sufbuf)); if (fsm->goal == FSM_PKGINSTALL) { @@ -628,10 +596,8 @@ rc = fsmUNSAFE(fsm, fsm->goal); if (rc && !ec) ec = rc; -/*@-boundswrite@*/ if (fsm->archiveSize && ec == 0) *fsm->archiveSize = (fdGetCpioPos(fsm->cfd) - pos); -/*@=boundswrite@*/ /*@-nullstate@*/ /* FIX: *fsm->failedFile may be NULL */ return ec; @@ -671,6 +637,7 @@ { security_context_t scon = NULL; +/*@-moduncon@*/ if (matchpathcon(fsm->path, fsm->sb.st_mode, &scon) == 0 && scon != NULL) fsm->fcontext = scon; else { @@ -680,6 +647,7 @@ if (fi && i >= 0 && i < fi->fc) fsm->fcontext = (fi->fcontexts ? fi->fcontexts[i] : NULL); } +/*@=moduncon@*/ } return 0; } @@ -699,7 +667,6 @@ i = fsm->ix; if (fi && i >= 0 && i < fi->fc) { -/*@-boundsread@*/ fsm->astriplen = fi->astriplen; fsm->action = (fi->actions ? fi->actions[i] : fi->action); fsm->fflags = (fi->fflags ? fi->fflags[i] : fi->flags); @@ -708,9 +675,7 @@ /* src rpms have simple base name in payload. */ fsm->dirName = fi->dnl[fi->dil[i]]; fsm->baseName = fi->bnl[i]; -/*@=boundsread@*/ -/*@-boundswrite@*/ switch (fsm->action) { case FA_SKIP: break; @@ -774,7 +739,6 @@ default: break; } -/*@=boundswrite@*/ if ((fsm->mapFlags & CPIO_MAP_PATH) || fsm->nsuffix) { const struct stat * st = &fsm->sb; @@ -946,7 +910,6 @@ st->st_size = (writeData ? ost->st_size : 0); - /*@-branchstate@*/ if (S_ISDIR(st->st_mode)) { st->st_size = 0; } else if (S_ISLNK(st->st_mode)) { @@ -960,10 +923,8 @@ st->st_size = fsm->rdnb; fsm->lpath = xstrdup(fsm->rdbuf); /* XXX save readlink return. */ } - /*@=branchstate@*/ if (fsm->mapFlags & CPIO_MAP_ABSOLUTE) { -/*@-boundswrite@*/ int nb = strlen(fsm->dirName) + strlen(fsm->baseName) + sizeof("."); char * t = alloca(nb); *t = '\0'; @@ -971,7 +932,6 @@ if (fsm->mapFlags & CPIO_MAP_ADDDOT) *t++ = '.'; t = stpcpy( stpcpy(t, fsm->dirName), fsm->baseName); -/*@=boundswrite@*/ } else if (fsm->mapFlags & CPIO_MAP_PATH) { rpmfi fi = fsmGetFi(fsm); if (fi->apath) { @@ -1035,7 +995,6 @@ } #if defined(HAVE_MMAP) -/*@-branchstate@*/ if (mapped != (void *)-1) { xx = msync(mapped, nmapped, MS_ASYNC); #if defined(HAVE_MADVISE) && defined(MADV_DONTNEED) @@ -1046,7 +1005,6 @@ /*@=noeffect@*/ fsm->rdbuf = rdbuf; } else -/*@=branchstate@*/ #endif xx = fsync(Fileno(fsm->rfd)); @@ -1093,8 +1051,6 @@ fsm->nsuffix = NULL; fsm->ix = -1; -/*@-boundswrite@*/ -/*@-branchstate@*/ for (i = fsm->li->nlink - 1; i >= 0; i--) { if (fsm->li->filex[i] < 0) continue; @@ -1132,8 +1088,6 @@ fsm->path = _free(fsm->path); fsm->li->filex[i] = -1; } -/*@=branchstate@*/ -/*@=boundswrite@*/ /*@-dependenttrans@*/ linkpath = _free(linkpath); @@ -1150,7 +1104,6 @@ * @param fsm file state machine data * @return 0 on success */ -/*@-boundsread@*/ /*@-compdef@*/ static int fsmMakeLinks(/*@special@*/ /*@partial@*/ FSM_t fsm) /*@uses fsm->path, fsm->opath, fsm->nsuffix, fsm->ix, fsm->li @*/ @@ -1174,7 +1127,6 @@ rc = fsmNext(fsm, FSM_MAP); fsm->opath = fsm->path; fsm->path = NULL; - /*@-branchstate@*/ for (i = 0; i < fsm->li->nlink; i++) { if (fsm->li->filex[i] < 0) continue; if (fsm->li->createdPath == i) continue; @@ -1192,14 +1144,11 @@ rc = fsmNext(fsm, FSM_LINK); if (fsm->failedFile && rc != 0 && *fsm->failedFile == NULL) { ec = rc; -/*@-boundswrite@*/ *fsm->failedFile = xstrdup(fsm->path); -/*@=boundswrite@*/ } fsm->li->linksLeft--; } - /*@=branchstate@*/ fsm->path = _free(fsm->path); fsm->opath = _free(fsm->opath); @@ -1210,7 +1159,6 @@ return ec; } /*@=compdef@*/ -/*@=boundsread@*/ /** \ingroup payload * Commit hard linked file set atomically. @@ -1235,14 +1183,11 @@ fsm->nsuffix = NULL; fsm->ix = -1; - /*@-branchstate@*/ for (fsm->li = fsm->links; fsm->li; fsm->li = fsm->li->next) { if (fsm->li->sb.st_ino == st->st_ino && fsm->li->sb.st_dev == st->st_dev) break; } - /*@=branchstate@*/ -/*@-boundswrite@*/ for (i = 0; i < fsm->li->nlink; i++) { if (fsm->li->filex[i] < 0) continue; fsm->ix = fsm->li->filex[i]; @@ -1252,7 +1197,6 @@ fsm->path = _free(fsm->path); fsm->li->filex[i] = -1; } -/*@=boundswrite@*/ fsm->ix = iterIndex; fsm->nsuffix = nsuffix; @@ -1278,7 +1222,6 @@ int rc = 0; fsm->path = NULL; -/*@-boundswrite@*/ dn[0] = '\0'; /*@-observertrans -dependenttrans@*/ if (fsm->ldn != NULL && fsm->dnlx != NULL) @@ -1310,7 +1253,6 @@ } while ((te - fsm->path) > fsm->dnlx[dc]); /*@=usereleased@*/ } -/*@=boundswrite@*/ dnli = dnlFreeIterator(dnli); /*@=observertrans =dependenttrans@*/ @@ -1351,7 +1293,6 @@ fsm->path = NULL; -/*@-boundswrite@*/ dn[0] = '\0'; fsm->dnlx = (dc ? xcalloc(dc, sizeof(*fsm->dnlx)) : NULL); /*@-observertrans -dependenttrans@*/ @@ -1446,7 +1387,6 @@ } /*@=compdef@*/ } -/*@=boundswrite@*/ dnli = dnlFreeIterator(dnli); sx = rpmsxFree(sx); /*@=observertrans =dependenttrans@*/ @@ -1495,7 +1435,6 @@ ((_x)[sizeof("/dev/log")-1] == '\0' || \ (_x)[sizeof("/dev/log")-1] == ';')) -/*@-boundsread@*/ /*@-compmempass@*/ int fsmStage(FSM_t fsm, fileStage stage) { @@ -1540,7 +1479,6 @@ } #undef _fafilter - /*@-branchstate@*/ switch (stage) { case FSM_UNKNOWN: break; @@ -1642,12 +1580,10 @@ if (j == -1) j = i; } /* XXX force the contents out as well. */ -/*@-boundswrite@*/ if (j != 0) { fsm->li->filex[0] = fsm->li->filex[j]; fsm->li->filex[j] = -1; } -/*@=boundswrite@*/ fsm->li->sb.st_nlink = nlink; fsm->sb = fsm->li->sb; /* structure assignment */ @@ -1734,10 +1670,8 @@ _("archive file %s was not found in header file list\n"), fsm->path); #endif -/*@-boundswrite@*/ if (fsm->failedFile && *fsm->failedFile == NULL) *fsm->failedFile = xstrdup(fsm->path); -/*@=boundswrite@*/ rc = CPIOERR_UNMAPPED_FILE; } else { rc = CPIOERR_HDR_TRAILER; @@ -1782,10 +1716,8 @@ if (rc) break; /* On non-install, the disk file stat is what's remapped. */ -/*@-boundswrite@*/ if (fsm->goal != FSM_PKGINSTALL) *st = *ost; /* structure assignment */ -/*@=boundswrite@*/ /* Remap file perms, owner, and group. */ rc = fsmMapAttrs(fsm); @@ -1860,9 +1792,7 @@ /* XXX link(fsm->opath, fsm->path) */ rc = fsmNext(fsm, FSM_LINK); if (fsm->failedFile && rc != 0 && *fsm->failedFile == NULL) { -/*@-boundswrite@*/ *fsm->failedFile = xstrdup(fsm->path); -/*@=boundswrite@*/ } fsm->opath = _free(fsm->opath); fsm->opath = opath; @@ -1971,10 +1901,8 @@ #endif errno = saveerrno; } -/*@-boundswrite@*/ if (fsm->failedFile && *fsm->failedFile == NULL) *fsm->failedFile = xstrdup(fsm->path); -/*@=boundswrite@*/ break; case FSM_FINI: if (!fsm->postpone && fsm->commit) { @@ -1989,10 +1917,8 @@ fsm->path = _free(fsm->path); fsm->lpath = _free(fsm->lpath); fsm->opath = _free(fsm->opath); -/*@-boundswrite@*/ memset(st, 0, sizeof(*st)); memset(ost, 0, sizeof(*ost)); -/*@=boundswrite@*/ break; case FSM_COMMIT: /* Rename pre-existing modified or unmanaged file. */ @@ -2117,9 +2043,7 @@ /* Notify on success. */ if (!rc) rc = fsmNext(fsm, FSM_NOTIFY); else if (fsm->failedFile && *fsm->failedFile == NULL) { -/*@-boundswrite@*/ *fsm->failedFile = fsm->path; -/*@=boundswrite@*/ fsm->path = NULL; } break; @@ -2140,9 +2064,7 @@ if (fsm->failedFile && *fsm->failedFile == NULL) { fsm->ix = fsm->li->filex[i]; if (!fsmNext(fsm, FSM_MAP)) { -/*@-boundswrite@*/ *fsm->failedFile = fsm->path; -/*@=boundswrite@*/ fsm->path = NULL; } } @@ -2168,9 +2090,7 @@ } if (S_ISREG(st->st_mode)) { char * path = alloca(strlen(fsm->path) + sizeof("-RPMDELETE")); -/*@-boundswrite@*/ (void) stpcpy( stpcpy(path, fsm->path), "-RPMDELETE"); -/*@=boundswrite@*/ /* * XXX HP-UX (and other os'es) don't permit unlink on busy * XXX files. @@ -2390,18 +2310,14 @@ break; case FSM_READLINK: /* XXX NUL terminated result in fsm->rdbuf, len in fsm->rdnb. */ -/*@-boundswrite@*/ rc = Readlink(fsm->path, fsm->rdbuf, fsm->rdsize - 1); -/*@=boundswrite@*/ if (_fsm_debug && (stage & FSM_SYSCALL)) rpmMessage(RPMMESS_DEBUG, " %8s (%s, rdbuf, %d) %s\n", cur, fsm->path, (int)(fsm->rdsize -1), (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = CPIOERR_READLINK_FAILED; else { fsm->rdnb = rc; -/*@-boundswrite@*/ fsm->rdbuf[fsm->rdnb] = '\0'; -/*@=boundswrite@*/ rc = 0; } break; @@ -2436,9 +2352,7 @@ case FSM_PAD: left = (fsm->blksize - (fdGetCpioPos(fsm->cfd) % fsm->blksize)) % fsm->blksize; if (left) { -/*@-boundswrite@*/ memset(fsm->rdbuf, 0, left); -/*@=boundswrite@*/ /* XXX DWRITE uses rdnb for I/O length. */ fsm->rdnb = left; (void) fsmNext(fsm, FSM_DWRITE); @@ -2456,9 +2370,7 @@ rc = (*fsm->headerWrite) (fsm, st); /* Write next payload header. */ break; case FSM_DREAD: -/*@-boundswrite@*/ fsm->rdnb = Fread(fsm->wrbuf, sizeof(*fsm->wrbuf), fsm->wrlen, fsm->cfd); -/*@=boundswrite@*/ if (_fsm_debug && (stage & FSM_SYSCALL)) rpmMessage(RPMMESS_DEBUG, " %8s (%s, %d, cfd)\trdnb %d\n", cur, (fsm->wrbuf == fsm->wrb ? "wrbuf" : "mmap"), @@ -2493,9 +2405,7 @@ fsm->path, fsm->rfd, fsm->rdbuf); break; case FSM_READ: -/*@-boundswrite@*/ fsm->rdnb = Fread(fsm->rdbuf, sizeof(*fsm->rdbuf), fsm->rdlen, fsm->rfd); -/*@=boundswrite@*/ if (_fsm_debug && (stage & FSM_SYSCALL)) rpmMessage(RPMMESS_DEBUG, " %8s (rdbuf, %d, rfd)\trdnb %d\n", cur, (int)fsm->rdlen, (int)fsm->rdnb); @@ -2547,7 +2457,6 @@ default: break; } - /*@=branchstate@*/ if (!(stage & FSM_INTERNAL)) { fsm->rc = (rc == CPIOERR_HDR_TRAILER ? 0 : rc); @@ -2555,7 +2464,6 @@ return rc; } /*@=compmempass@*/ -/*@=boundsread@*/ /*@observer@*/ const char * fileActionString(fileAction a) { @@ . patch -p0 <<'@@ .' Index: rpm/lib/getdate.c ============================================================================ $ cvs diff -u -r1.13 -r1.14 getdate.c --- rpm/lib/getdate.c 2 Jul 2007 07:49:25 -0000 1.13 +++ rpm/lib/getdate.c 30 Sep 2007 20:38:25 -0000 1.14 @@ -2,7 +2,7 @@ /*@-retvalint -usedef -varuse -nullderef -nullassign @*/ /*@-readonlytrans -modunconnomods -compdef -noeffectuncon @*/ /*@-globs -evalorderuncon -modobserveruncon -modnomods @*/ -/*@-noeffect -branchstate -sizeoftype -usereleased @*/ +/*@-noeffect -sizeoftype -usereleased @*/ /*@unused@*/ /* A Bison parser, made by GNU Bison 2.3. */ @@ -2778,7 +2778,7 @@ } #endif /* defined(TEST) */ -/*@=noeffect =branchstate =sizeoftype =usereleased @*/ +/*@=noeffect =sizeoftype =usereleased @*/ /*@=globs =evalorderuncon =modobserveruncon =modnomods @*/ /*@=readonlytrans =modunconnomods =compdef =noeffectuncon @*/ /*@=retvalint =usedef =varuse =nullderef =nullassign @*/ @@ . patch -p0 <<'@@ .' Index: rpm/lib/manifest.c ============================================================================ $ cvs diff -u -r2.17 -r2.18 manifest.c --- rpm/lib/manifest.c 30 Jul 2007 01:40:35 -0000 2.17 +++ rpm/lib/manifest.c 30 Sep 2007 20:38:25 -0000 2.18 @@ -15,7 +15,6 @@ /*@access StringBuf @*/ -/*@-boundswrite@*/ char * rpmPermsString(int mode) { char *perms = xstrdup("----------"); @@ -62,10 +61,8 @@ return perms; } -/*@=boundswrite@*/ /**@todo Infinite loops through manifest files exist, operator error for now. */ -/*@-boundsread@*/ rpmRC rpmReadPackageManifest(FD_t fd, int * argcPtr, const char *** argvPtr) { StringBuf sb = newStringBuf(); @@ -80,13 +77,10 @@ rpmRC rpmrc = RPMRC_OK; int i, j, next, npre; -/*@-boundswrite@*/ -/*@-branchstate@*/ if (fdGetFp(fd) == NULL) xfd = Fdopen(fd, "r.fpio"); else xfd = fd; -/*@=branchstate@*/ /*@+voidabstract@*/ if ((f = (FILE *) fdGetFp(xfd)) == NULL) { @@ -135,10 +129,8 @@ appendStringBuf(sb, s); } - /*@-branchstate@*/ if (s == NULL) /* XXX always true */ s = getStringBuf(sb); - /*@=branchstate@*/ if (!(s && *s)) { rpmrc = RPMRC_NOTFOUND; @@ -192,22 +184,16 @@ } if (argcPtr) *argcPtr = ac; -/*@=boundswrite@*/ exit: - /*@-branchstate@*/ if (argvPtr == NULL || (rpmrc != RPMRC_OK && av)) { if (av) -/*@-boundswrite@*/ for (i = 0; i < ac; i++) /*@-unqualifiedtrans@*/av[i] = _free(av[i]); /*@=unqualifiedtrans@*/ -/*@=boundswrite@*/ /*@-dependenttrans@*/ av = _free(av); /*@=dependenttrans@*/ } - /*@=branchstate@*/ sb = freeStringBuf(sb); /*@-nullstate@*/ /* FIX: *argvPtr may be NULL. */ return rpmrc; /*@=nullstate@*/ } -/*@=boundsread@*/ @@ . patch -p0 <<'@@ .' Index: rpm/lib/misc.c ============================================================================ $ cvs diff -u -r2.142 -r2.143 misc.c --- rpm/lib/misc.c 22 Jul 2007 01:16:55 -0000 2.142 +++ rpm/lib/misc.c 30 Sep 2007 20:38:25 -0000 2.143 @@ -45,7 +45,6 @@ return RPMRC_OK; } -/*@-bounds@*/ char ** splitString(const char * str, int length, char sep) { const char * source; @@ -83,7 +82,6 @@ return list; /*@=nullret@*/ } -/*@=bounds@*/ void freeSplitString(char ** list) { @@ -125,19 +123,15 @@ FD_t fd = NULL; int ran; - /*@-branchstate@*/ if (!prefix) prefix = ""; - /*@=branchstate@*/ /* Create the temp directory if it doesn't already exist. */ - /*@-branchstate@*/ if (!_initialized) { _initialized = 1; tempfn = rpmGenPath(prefix, tpmacro, NULL); if (rpmioMkpath(tempfn, 0755, (uid_t) -1, (gid_t) -1)) goto errxit; } - /*@=branchstate@*/ /* XXX should probably use mkstemp here */ srand(time(NULL)); @@ -204,12 +198,10 @@ break; } - /*@-branchstate@*/ if (fnptr) *fnptr = tempfn; else tempfn = _free(tempfn); - /*@=branchstate@*/ if (fdptr) *(FD_t *)fdptr = fd; @@ . patch -p0 <<'@@ .' Index: rpm/lib/package.c ============================================================================ $ cvs diff -u -r2.162 -r2.163 package.c --- rpm/lib/package.c 29 Sep 2007 16:23:39 -0000 2.162 +++ rpm/lib/package.c 30 Sep 2007 20:38:25 -0000 2.163 @@ -39,7 +39,9 @@ /*@unchecked@*/ /*@only@*/ /*@null@*/ static unsigned int * keyids; +/*@unchecked@*/ extern int _nolead; +/*@unchecked@*/ extern int _nosigh; /** @@ -65,20 +67,16 @@ if (keyids != NULL) for (i = 0; i < nkeyids; i++) { -/*@-boundsread@*/ if (keyid == keyids[i]) return 1; -/*@=boundsread@*/ } if (nkeyids < nkeyids_max) { nkeyids++; keyids = xrealloc(keyids, nkeyids * sizeof(*keyids)); } -/*@-boundswrite@*/ if (keyids) /* XXX can't happen */ keyids[nextkeyid] = keyid; -/*@=boundswrite@*/ nextkeyid++; nextkeyid %= nkeyids_max; @@ -102,14 +100,12 @@ rpmRC rc = RPMRC_FAIL; /* assume failure */ int xx; -/*@-boundswrite@*/ buf[0] = '\0'; if (hdrp) *hdrp = NULL; if (msg) *msg = NULL; -/*@=boundswrite@*/ memset(block, 0, sizeof(block)); if ((xx = timedRead(fd, (char *)block, sizeof(block))) != sizeof(block)) { @@ -126,18 +122,14 @@ goto exit; } -/*@-boundsread@*/ il = ntohl(block[2]); -/*@=boundsread@*/ if (hdrchkTags(il)) { (void) snprintf(buf, sizeof(buf), _("hdr tags: BAD, no. of tags(%d) out of range\n"), il); goto exit; } -/*@-boundsread@*/ dl = ntohl(block[3]); -/*@=boundsread@*/ if (hdrchkData(dl)) { (void) snprintf(buf, sizeof(buf), _("hdr data: BAD, no. of bytes(%d) out of range\n"), dl); @@ -149,7 +141,6 @@ /*@=sizeoftype@*/ uc = sizeof(il) + sizeof(dl) + nb; ei = xmalloc(uc); -/*@-bounds@*/ ei[0] = block[2]; ei[1] = block[3]; if ((xx = timedRead(fd, (char *)&ei[2], nb)) != nb) { @@ -157,7 +148,6 @@ _("hdr blob(%u): BAD, read returned %d\n"), (unsigned)nb, xx); goto exit; } -/*@=bounds@*/ /* Sanity check header tags */ rc = headerCheck(ts, ei, uc, msg); @@ -179,24 +169,20 @@ (void) headerSetOrigin(h, origin); exit: -/*@-boundswrite@*/ if (hdrp && h && rc == RPMRC_OK) *hdrp = headerLink(h); -/*@=boundswrite@*/ ei = _free(ei); h = headerFree(h); -/*@-boundswrite@*/ if (msg != NULL && *msg == NULL && buf[0] != '\0') { buf[sizeof(buf)-1] = '\0'; *msg = xstrdup(buf); } -/*@=boundswrite@*/ return rc; } -/*@-bounds@*/ /* LCL: segfault */ +/*@-mods@*/ rpmRC rpmReadPackageFile(rpmts ts, void * _fd, const char * fn, Header * hdrp) { pgpDig dig = rpmtsDig(ts); @@ -223,9 +209,7 @@ #ifdef DYING { struct stat st; -/*@-boundswrite@*/ memset(&st, 0, sizeof(st)); -/*@=boundswrite@*/ (void) fstat(Fileno(fd), &st); /* if fd points to a socket, pipe, etc, st.st_size is *always* zero */ if (S_ISREG(st.st_mode) && st.st_size < sizeof(*l)) { @@ -358,7 +342,7 @@ goto exit; } -assert(dig); +assert(dig != NULL); dig->nbytes = 0; /* Retrieve the tag parameters from the signature header. */ @@ -369,13 +353,7 @@ goto exit; } - { - const void * osig = pgpGetSig(dig); - int_32 osigtype = pgpGetSigtype(dig); - if (osig && osigtype) - osig = headerFreeData(osig, osigtype); - (void) pgpSetSig(dig, sigtag, sigtype, sig, siglen); - } + rpmtsCleanDig(ts); switch (sigtag) { case RPMSIGTAG_RSA: @@ -509,9 +487,7 @@ /** @todo Implement disable/enable/warn/error/anal policy. */ -/*@-boundswrite@*/ buf[0] = '\0'; -/*@=boundswrite@*/ rc = rpmVerifySignature(dig, buf); switch (rc) { case RPMRC_OK: /* Signature is OK. */ @@ -539,9 +515,7 @@ headerMergeLegacySigs(h, sigh); /* Bump reference count for return. */ -/*@-boundswrite@*/ *hdrp = headerLink(h); -/*@=boundswrite@*/ } h = headerFree(h); @@ -555,4 +529,4 @@ sigh = headerFree(sigh); return rc; } -/*@=bounds@*/ +/*@=mods@*/ @@ . patch -p0 <<'@@ .' Index: rpm/lib/poptALL.c ============================================================================ $ cvs diff -u -r2.44 -r2.45 poptALL.c --- rpm/lib/poptALL.c 8 Sep 2007 15:45:19 -0000 2.44 +++ rpm/lib/poptALL.c 30 Sep 2007 20:38:25 -0000 2.45 @@ -192,7 +192,6 @@ /** */ -/*@-bounds@*/ static void rpmcliAllArgCallback(poptContext con, /*@unused@*/ enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, @@ -204,7 +203,6 @@ { /* XXX avoid accidental collisions with POPT_BIT_SET for flags */ - /*@-branchstate@*/ if (opt->arg == NULL) switch (opt->val) { case 'q': @@ -289,7 +287,6 @@ } break; } - /*@=branchstate@*/ } /*@unchecked@*/ @@ -655,7 +652,9 @@ } /* Initialize header stat collection. */ +/*@-mods@*/ _hdr_stats = _rpmts_stats; +/*@=mods@*/ return optCon; } @@ . patch -p0 <<'@@ .' Index: rpm/lib/poptI.c ============================================================================ $ cvs diff -u -r2.36 -r2.37 poptI.c --- rpm/lib/poptI.c 24 Jul 2007 14:36:47 -0000 2.36 +++ rpm/lib/poptI.c 30 Sep 2007 20:38:25 -0000 2.37 @@ -48,7 +48,6 @@ /** */ -/*@-bounds@*/ static void installArgCallback( /*@unused@*/ poptContext con, /*@unused@*/ enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, @@ -59,7 +58,6 @@ QVA_t ia = &rpmIArgs; /* XXX avoid accidental collisions with POPT_BIT_SET for flags */ - /*@-branchstate@*/ if (opt->arg == NULL) switch (opt->val) { @@ -195,9 +193,7 @@ break; } - /*@=branchstate@*/ } -/*@=bounds@*/ /** */ @@ . patch -p0 <<'@@ .' Index: rpm/lib/poptQV.c ============================================================================ $ cvs diff -u -r2.45 -r2.46 poptQV.c --- rpm/lib/poptQV.c 9 Sep 2007 17:56:41 -0000 2.45 +++ rpm/lib/poptQV.c 30 Sep 2007 20:38:25 -0000 2.46 @@ -200,18 +200,14 @@ case POPT_QUERYFORMAT: if (arg) { char * qf = (char *)qva->qva_queryFormat; - /*@-branchstate@*/ if (qf) { int len = strlen(qf) + strlen(arg) + 1; qf = xrealloc(qf, len); -/*@-boundswrite@*/ strcat(qf, arg); -/*@=boundswrite@*/ } else { qf = xmalloc(strlen(arg) + 1); strcpy(qf, arg); } - /*@=branchstate@*/ qva->qva_queryFormat = qf; } break; @@ . patch -p0 <<'@@ .' Index: rpm/lib/psm.c ============================================================================ $ cvs diff -u -r2.231 -r2.232 psm.c --- rpm/lib/psm.c 29 Sep 2007 19:29:01 -0000 2.231 +++ rpm/lib/psm.c 30 Sep 2007 20:38:25 -0000 2.232 @@ -42,7 +42,9 @@ extern int _nolead; extern int _nosigh; -/*@access FD_t @*/ /* XXX void ptr args */ +/*@access FD_t @*/ /* XXX void * arg */ +/*@access Header @*/ /* XXX void * arg */ + /*@access rpmpsm @*/ /*@access rpmfi @*/ @@ -63,12 +65,10 @@ if (!headerGetEntry(second, RPMTAG_EPOCH, NULL, &epochTwo, NULL)) epochTwo = &zero; -/*@-boundsread@*/ if (*epochOne < *epochTwo) return -1; else if (*epochOne > *epochTwo) return 1; -/*@=boundsread@*/ rc = headerGetEntry(first, RPMTAG_VERSION, NULL, &one, NULL); rc = headerGetEntry(second, RPMTAG_VERSION, NULL, &two, NULL); @@ -88,7 +88,6 @@ * @param psm package state machine data * @return 0 always */ -/*@-bounds@*/ static rpmRC markReplacedFiles(const rpmpsm psm) /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -163,7 +162,6 @@ return RPMRC_OK; } -/*@=bounds@*/ rpmRC rpmInstallSourcePackage(rpmts ts, void * _fd, const char ** specFilePtr, const char ** cookie) @@ -181,6 +179,7 @@ rpmpsm psm = &psmbuf; int isSource; rpmRC rpmrc; + int xx; int i; memset(psm, 0, sizeof(*psm)); @@ -263,7 +262,7 @@ i = fi->fc; if (fi->h != NULL) { /* XXX can't happen */ - headerGetExtension(fi->h, RPMTAG_FILEPATHS, NULL, &fi->apath, NULL); + xx = headerGetExtension(fi->h, RPMTAG_FILEPATHS, NULL, &fi->apath, NULL); if (headerIsEntry(fi->h, RPMTAG_COOKIE)) for (i = 0; i < fi->fc; i++) @@ -361,7 +360,6 @@ if (h != NULL) h = headerFree(h); - /*@-branchstate@*/ if (fi != NULL) { fi->te->h = headerFree(fi->te->h); if (fi->te->fd != NULL) @@ -370,7 +368,6 @@ fi->te = NULL; fi = rpmfiFree(fi); } - /*@=branchstate@*/ /* XXX nuke the added package(s). */ rpmtsClean(ts); @@ -489,7 +486,7 @@ *ssp |= (RPMSCRIPT_STATE_LUA|RPMSCRIPT_STATE_EXEC); xx = headerGetExtension(h, RPMTAG_NVRA, NULL, &NVRA, NULL); -assert(NVRA); +assert(NVRA != NULL); /* Save the current working directory. */ /*@-nullpass@*/ @@ -499,10 +496,10 @@ /* Get into the chroot. */ if (!rpmtsChrootDone(ts)) { const char *rootDir = rpmtsRootDir(ts); - /*@-superuser -noeffect @*/ + /*@-modobserver @*/ if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') { xx = Chroot(rootDir); - /*@=superuser =noeffect @*/ + /*@=modobserver @*/ xx = rpmtsSetChrootDone(ts, 1); } } @@ -554,10 +551,10 @@ if (rpmtsChrootDone(ts)) { const char *rootDir = rpmtsRootDir(ts); xx = fchdir(rootFdno); - /*@-superuser -noeffect @*/ + /*@-modobserver@*/ if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') { xx = Chroot("."); - /*@=superuser =noeffect @*/ + /*@=modobserver@*/ xx = rpmtsSetChrootDone(ts, 0); } } else @@ -636,7 +633,7 @@ return RPMRC_OK; xx = headerGetExtension(h, RPMTAG_NVRA, NULL, &NVRA, NULL); -assert(NVRA); +assert(NVRA != NULL); if (progArgv && strcmp(progArgv[0], "<lua>") == 0) { #ifdef WITH_LUA @@ -704,10 +701,8 @@ const char * rootDir = rpmtsRootDir(ts); FD_t fd; - /*@-branchstate@*/ if (makeTempFile((!rpmtsChrootDone(ts) ? rootDir : "/"), &fn, &fd)) goto exit; - /*@=branchstate@*/ if (rpmIsDebug() && (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash"))) @@ -761,7 +756,6 @@ if (out == NULL) /* XXX can't happen */ goto exit; - /*@-branchstate@*/ xx = rpmsqFork(&psm->sq); if (psm->sq.child == 0) { int pipes[2]; @@ -827,12 +821,12 @@ } { const char * rootDir = rpmtsRootDir(ts); - if (!rpmtsChrootDone(ts) && + if (!rpmtsChrootDone(ts) && rootDir != NULL && !(rootDir[0] == '/' && rootDir[1] == '\0')) { - /*@-superuser -noeffect @*/ + /*@-modobserver@*/ xx = Chroot(rootDir); - /*@=superuser =noeffect @*/ + /*@=modobserver@*/ } xx = Chdir("/"); rpmMessage(RPMMESS_DEBUG, D_("%s: %s(%s)\texecv(%s) pid %d\n"), @@ -865,7 +859,6 @@ _exit(-1); /*@notreached@*/ } - /*@=branchstate@*/ if (psm->sq.child == (pid_t)-1) { rpmError(RPMERR_FORK, _("Couldn't fork %s: %s\n"), sln, strerror(errno)); @@ -904,13 +897,11 @@ if (out) xx = Fclose(out); /* XXX dup'd STDOUT_FILENO */ - /*@-branchstate@*/ if (script) { if (!rpmIsDebug()) xx = Unlink(fn); fn = _free(fn); } - /*@=branchstate@*/ NVRA = _free(NVRA); @@ -944,14 +935,12 @@ if (progArgv == NULL && script == NULL) goto exit; - /*@-branchstate@*/ if (progArgv && ptt == RPM_STRING_TYPE) { argv = alloca(sizeof(*argv)); *argv = (const char *) progArgv; } else { argv = (const char **) progArgv; } - /*@=branchstate@*/ if (argv[0][0] == '%') argv[0] = argv0 = rpmExpand(argv[0], NULL); @@ -1266,9 +1255,7 @@ (void) rpmpsmUnlink(psm, msg); /*@-refcounttrans -usereleased@*/ -/*@-boundswrite@*/ memset(psm, 0, sizeof(*psm)); /* XXX trash and burn */ -/*@=boundswrite@*/ psm = _free(psm); /*@=refcounttrans =usereleased@*/ @@ -1515,7 +1502,7 @@ * @todo Packages w/o files never get a callback, hence don't get displayed * on install with -v. */ -/*@-bounds -nullpass@*/ /* FIX: testing null annotation for fi->h */ +/*@-nullpass@*/ /* FIX: testing null annotation for fi->h */ rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage) { const rpmts ts = psm->ts; @@ -1528,7 +1515,6 @@ int saveerrno; int xx; -/*@-branchstate@*/ switch (stage) { case PSM_UNKNOWN: break; @@ -1618,9 +1604,9 @@ CPIO_MAP_PATH | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID | (fi->mapflags & CPIO_SBIT_CHECK); if (headerIsEntry(fi->h, RPMTAG_ORIGBASENAMES)) - headerGetExtension(fi->h, RPMTAG_ORIGPATHS, NULL, &fi->apath, NULL); + xx = headerGetExtension(fi->h, RPMTAG_ORIGPATHS, NULL, &fi->apath, NULL); else - headerGetExtension(fi->h, RPMTAG_FILEPATHS, NULL, &fi->apath, NULL); + xx = headerGetExtension(fi->h, RPMTAG_FILEPATHS, NULL, &fi->apath, NULL); if (fi->fuser == NULL) xx = hge(fi->h, RPMTAG_FILEUSERNAME, NULL, @@ -1658,7 +1644,9 @@ pkgbn = _free(pkgbn); (void) urlPath(psm->pkgURL, &psm->pkgfn); pkgdn_buf = xstrdup(psm->pkgfn); +/*@-moduncon@*/ pkgdn = dirname(pkgdn_buf); +/*@=moduncon@*/ rc = rpmMkdirPath(pkgdn, "_repackage_dir"); pkgdn_buf = _free(pkgdn_buf); if (rc == RPMRC_FAIL) @@ -1767,7 +1755,6 @@ /* XXX this is headerCopy w/o headerReload() */ psm->oh = headerNew(); - /*@-branchstate@*/ for (hi = headerInitIterator(oh); headerNextIterator(hi, &tag, &type, &ptr, &count); ptr = headerFreeData((void *)ptr, type)) @@ -1777,7 +1764,6 @@ if (ptr) xx = hae(psm->oh, tag, type, ptr, count); } hi = headerFreeIterator(hi); - /*@=branchstate@*/ oh = headerFree(oh); uh = hfd(uh, uht); @@ -2107,7 +2093,6 @@ /*@=nullstate@*/ } -/*@-branchstate@*/ if (psm->goal == PSM_PKGERASE || psm->goal == PSM_PKGSAVE) { if (psm->te != NULL) if (psm->te->h != NULL) @@ -2115,7 +2100,6 @@ if (fi->h != NULL) fi->h = headerFree(fi->h); } -/*@=branchstate@*/ psm->oh = headerFree(psm->oh); psm->pkgURL = _free(psm->pkgURL); psm->rpmio_flags = _free(psm->rpmio_flags); @@ -2184,10 +2168,10 @@ } xx = Chdir("/"); - /*@-superuser@*/ + /*@-modobserver@*/ if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') rc = Chroot(rootDir); - /*@=superuser@*/ + /*@=modobserver@*/ psm->chrootDone = 1; (void) rpmtsSetChrootDone(ts, 1); } @@ -2197,10 +2181,10 @@ if (psm->chrootDone) { const char * rootDir = rpmtsRootDir(ts); const char * currDir = rpmtsCurrDir(ts); - /*@-superuser@*/ + /*@-modobserver@*/ if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') rc = Chroot("."); - /*@=superuser@*/ + /*@=modobserver@*/ psm->chrootDone = 0; (void) rpmtsSetChrootDone(ts, 0); if (currDir != NULL) /* XXX can't happen */ @@ -2226,11 +2210,9 @@ const char * payload_format = NULL; char * t; - /*@-branchstate@*/ if (!hge(fi->h, RPMTAG_PAYLOADCOMPRESSOR, NULL, &payload_compressor, NULL)) payload_compressor = "gzip"; - /*@=branchstate@*/ psm->rpmio_flags = t = xmalloc(sizeof("w9.gzdio")); *t = '\0'; t = stpcpy(t, ((psm->goal == PSM_PKGSAVE) ? "w9" : "r")); @@ -2241,12 +2223,10 @@ if (!strcmp(payload_compressor, "lzma")) t = stpcpy(t, ".lzdio"); - /*@-branchstate@*/ if (!hge(fi->h, RPMTAG_PAYLOADFORMAT, NULL, &payload_format, NULL) || !(!strcmp(payload_format, "tar") || !strcmp(payload_format, "ustar"))) payload_format = "cpio"; - /*@=branchstate@*/ psm->payload_format = xstrdup(payload_format); rc = RPMRC_OK; } break; @@ -2313,10 +2293,9 @@ default: break; /*@i@*/ } -/*@=branchstate@*/ /*@-nullstate@*/ /* FIX: psm->oh and psm->fi->h may be NULL. */ return rc; /*@=nullstate@*/ } -/*@=bounds =nullpass@*/ +/*@=nullpass@*/ @@ . patch -p0 <<'@@ .' Index: rpm/lib/query.c ============================================================================ $ cvs diff -u -r2.183 -r2.184 query.c --- rpm/lib/query.c 22 Sep 2007 15:31:33 -0000 2.183 +++ rpm/lib/query.c 30 Sep 2007 20:38:25 -0000 2.184 @@ -25,6 +25,8 @@ #include "debug.h" +/*@access headerSprintfExtension@*/ /* XXX cast, increment */ + /** */ static void printFileInfo(char * te, const char * name, @@ -49,9 +51,7 @@ if (now == 0) { now = time(NULL); tm = localtime(&now); -/*@-boundsread@*/ if (tm) nowtm = *tm; /* structure assignment */ -/*@=boundsread@*/ } strncpy(ownerfield, owner, sizeof(ownerfield)); @@ -156,13 +156,10 @@ int i; te = t = xmalloc(tb); -/*@-boundswrite@*/ *te = '\0'; -/*@=boundswrite@*/ if (qva->qva_queryFormat != NULL) { const char * str = queryHeader(h, qva->qva_queryFormat); - /*@-branchstate@*/ if (str) { size_t tx = (te - t); @@ -172,15 +169,12 @@ t = xrealloc(t, tb); te = t + tx; } -/*@-boundswrite@*/ /*@-usereleased@*/ te = stpcpy(te, str); /*@=usereleased@*/ -/*@=boundswrite@*/ str = _free(str); flushBuffer(&t, &te, 1); } - /*@=branchstate@*/ } if (!(qva->qva_flags & QUERY_FOR_LIST)) @@ -188,9 +182,7 @@ fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); if (rpmfiFC(fi) <= 0) { -/*@-boundswrite@*/ te = stpcpy(te, _("(contains no files)")); -/*@=boundswrite@*/ goto exit; } @@ -217,7 +209,6 @@ fstate = rpmfiFState(fi); fsize = rpmfiFSize(fi); fn = rpmfiFN(fi); -/*@-bounds@*/ { static char hex[] = "0123456789abcdef"; int dalgo = 0; size_t dlen = 0; @@ -232,7 +223,6 @@ } *p = '\0'; } -/*@=bounds@*/ fuser = rpmfiFUser(fi); fgroup = rpmfiFGroup(fi); flink = rpmfiFLink(fi); @@ -267,16 +257,13 @@ if (fuser) sb += strlen(fuser); if (fgroup) sb += strlen(fgroup); if (flink) sb += strlen(flink); -/*@-branchstate@*/ if ((sb + BUFSIZ) > tb) { size_t tx = (te - t); tb += sb + BUFSIZ; t = xrealloc(t, tb); te = t + tx; } -/*@=branchstate@*/ -/*@-boundswrite@*/ if (!rpmIsVerbose() && prefix) te = stpcpy(te, prefix); @@ -306,7 +293,6 @@ /*@switchbreak@*/ break; } } -/*@=boundswrite@*/ if (qva->qva_flags & QUERY_FOR_DUMPFILES) { sprintf(te, "%s %d %d %s 0%o ", @@ -333,9 +319,7 @@ te += strlen(te); } else if (!rpmIsVerbose()) { -/*@-boundswrite@*/ te = stpcpy(te, fn); -/*@=boundswrite@*/ } else { @@ -480,7 +464,6 @@ if (qva->qva_showPackage == NULL) return 1; - /*@-branchstate@*/ switch (qva->qva_source) { case RPMQV_RPM: res = rpmgiShowMatches(qva, ts); @@ -730,7 +713,6 @@ } break; } - /*@=branchstate@*/ return res; } @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmal.c ============================================================================ $ cvs diff -u -r2.60 -r2.61 rpmal.c --- rpm/lib/rpmal.c 25 Jul 2007 17:02:34 -0000 2.60 +++ rpm/lib/rpmal.c 30 Sep 2007 20:38:25 -0000 2.61 @@ -338,10 +338,8 @@ /*@=assignexpose =dependenttrans =observertrans@*/ dieNeedle->dirNameLen = (dieNeedle->dirName != NULL ? strlen(dieNeedle->dirName) : 0); -/*@-boundswrite@*/ die = bsearch(dieNeedle, al->dirs, al->numDirs, sizeof(*dieNeedle), dieCompare); -/*@=boundswrite@*/ if (die == NULL) continue; @@ -363,9 +361,7 @@ fprintf(stderr, "\t%p[%3d] memmove(%p:%p,%p:%p,0x%x) %s <- %s\n", die->files, die->numFiles, fie, fie->baseName, fie+1, (fie+1)->baseName, (unsigned) ((die->numFiles - i) * sizeof(*fie)), fie->baseName, (fie+1)->baseName); /*@=modfilesys@*/ -/*@-bounds@*/ memmove(fie, fie+1, (die->numFiles - i) * sizeof(*fie)); -/*@=bounds@*/ } /*@-modfilesys@*/ if (_rpmal_debug) @@ -389,9 +385,7 @@ fprintf(stderr, " die[%5d] memmove(%p,%p,0x%x)\n", (int)(die - al->dirs), die, die+1, (unsigned)((al->numDirs - (die - al->dirs)) * sizeof(*die))); /*@=modfilesys@*/ -/*@-bounds@*/ memmove(die, die+1, (al->numDirs - (die - al->dirs)) * sizeof(*die)); -/*@=bounds@*/ } /*@-modfilesys@*/ @@ -412,13 +406,10 @@ alp->provides = rpmdsFree(alp->provides); alp->fi = rpmfiFree(alp->fi); -/*@-boundswrite@*/ memset(alp, 0, sizeof(*alp)); /* XXX trash and burn */ -/*@=boundswrite@*/ return; } -/*@-bounds@*/ alKey rpmalAdd(rpmal * alistp, alKey pkgKey, fnpyKey key, rpmds provides, rpmfi fi, uint_32 tscolor) { @@ -592,7 +583,6 @@ assert(((alNum)(alp - al->list)) == pkgNum); return ((alKey)(alp - al->list)); } -/*@=bounds@*/ /** * Compare two available index entries by name (qsort/bsearch). @@ -738,7 +728,6 @@ goto exit; baseName++; - /*@-branchstate@*/ /* FIX: ret is a problem */ for (found = 0, ret = NULL; die < al->dirs + al->numDirs && dieCompare(die, dieNeedle) == 0; die++) @@ -780,7 +769,6 @@ *keyp = alNum2Key(al, fie->pkgNum); found++; } - /*@=branchstate@*/ exit: dirName = _free(dirName); @@ -855,7 +843,6 @@ /*@switchbreak@*/ break; } - /*@-branchstate@*/ if (rc) { ret = xrealloc(ret, (found + 2) * sizeof(*ret)); if (ret) /* can't happen */ @@ -866,7 +853,6 @@ /*@=dependenttrans@*/ found++; } - /*@=branchstate@*/ } if (ret) @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmchecksig.c ============================================================================ $ cvs diff -u -r1.146 -r1.147 rpmchecksig.c --- rpm/lib/rpmchecksig.c 29 Sep 2007 19:29:01 -0000 1.146 +++ rpm/lib/rpmchecksig.c 30 Sep 2007 20:38:25 -0000 1.147 @@ -21,6 +21,7 @@ #include "debug.h" /*@access FD_t @*/ /* XXX stealing digests */ +/*@access Header @*/ /* XXX void * arg */ /*@access pgpDig @*/ /*@access pgpDigParams @*/ @@ -32,7 +33,6 @@ /** */ -/*@-boundsread@*/ static int manageFile(/*@out@*/ FD_t *fdp, /*@null@*/ /*@out@*/ const char **fnp, int flags, /*@unused@*/ int rc) @@ -46,7 +46,6 @@ if (fdp == NULL) /* programmer error */ return 1; -/*@-boundswrite@*/ /* close and reset *fdp to NULL */ if (*fdp && (fnp == NULL || *fnp == NULL)) { (void) Fclose(*fdp); @@ -79,7 +78,6 @@ fd = fdFree(fd, "manageFile return"); return 0; } -/*@=boundswrite@*/ /* no operation */ if (*fdp != NULL && fnp != NULL && *fnp != NULL) @@ -88,12 +86,10 @@ /* XXX never reached */ return 1; } -/*@=boundsread@*/ /** * Copy header+payload, calculating digest(s) on the fly. */ -/*@-boundsread@*/ static int copyFile(FD_t *sfdp, const char **sfnp, FD_t *tfdp, const char **tfnp) /*@globals rpmGlobalMacroContext, h_errno, @@ -135,7 +131,6 @@ if (*tfdp) (void) manageFile(tfdp, NULL, 0, rc); return rc; } -/*@=boundsread@*/ /** * Retrieve signer fingerprint from an OpenPGP signature tag. @@ -157,9 +152,7 @@ pgpDig dig = pgpNewDig(0); if (!pgpPrtPkts(pkt, pktlen, dig, 0)) { -/*@-bounds@*/ memcpy(signid, dig->signature.signid, sizeof(dig->signature.signid)); -/*@=bounds@*/ rc = 0; } @@ -180,7 +173,7 @@ QVA_t qva, const char ** argv) /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies rpmGlobalMacroContext, + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ { rpmgi gi = NULL; @@ -201,16 +194,17 @@ tmprpm[0] = '\0'; - /*@-branchstate@*/ if (argv) { /* start-of-arg-iteration */ int tag = (qva->qva_source == RPMQV_FTSWALK) ? RPMDBI_FTSWALK : RPMDBI_ARGLIST; - rpmgi gi = rpmgiNew(ts, tag, NULL, 0); rpmgiFlags _giFlags = RPMGI_NONE; + gi = rpmgiNew(ts, tag, NULL, 0); +/*@-mods@*/ if (ftsOpts == 0) ftsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); +/*@=mods@*/ rc = rpmgiSetArgs(gi, argv, ftsOpts, (_giFlags|RPMGI_NOHEADER)); while (rpmgiNext(gi) == RPMRC_OK) { @@ -219,8 +213,10 @@ fprintf(stdout, "%s:\n", fn); +/*@-modobserver@*/ /* XXX rpmgiHdrPath should not be observer */ if (manageFile(&fd, &fn, O_RDONLY, 0)) goto exit; +/*@=modobserver@*/ if (!_nolead) { const char item[] = "Lead"; @@ -257,15 +253,17 @@ /* Write the header and archive to a temp file */ /* ASSERT: ofd == NULL && sigtarget == NULL */ +/*@-modobserver@*/ /* XXX rpmgiHdrPath should not be observer */ if (copyFile(&fd, &fn, &ofd, &sigtarget)) goto exit; +/*@=modobserver@*/ /* Both fd and ofd are now closed. sigtarget contains tempfile name. */ /* ASSERT: fd == NULL && ofd == NULL */ /* Dump the immutable region (if present). */ if (headerGetEntry(sigh, RPMTAG_HEADERSIGNATURES, &uht, &uh, &uhc)) { HeaderIterator hi; - int_32 tag, type, count; + int_32 htag, type, count; hPTR_t ptr; Header oh; Header nh; @@ -278,11 +276,11 @@ oh = headerCopyLoad(uh); for (hi = headerInitIterator(oh); - headerNextIterator(hi, &tag, &type, &ptr, &count); + headerNextIterator(hi, &htag, &type, &ptr, &count); ptr = headerFreeData(ptr, type)) { if (ptr) - xx = headerAddEntry(nh, tag, type, ptr, count); + xx = headerAddEntry(nh, htag, type, ptr, count); } hi = headerFreeIterator(hi); oh = headerFree(oh); @@ -426,7 +424,6 @@ xx = Unlink(sigtarget); sigtarget = _free(sigtarget); } - /*@=branchstate@*/ } /* end-of-arg-iteration */ @@ -482,8 +479,10 @@ if (rpmtsOpenDB(ts, (O_RDWR|O_CREAT))) return RPMRC_FAIL; +/*@-moduncon@*/ if ((enc = b64encode(pkt, pktlen)) == NULL) goto exit; +/*@=moduncon@*/ dig = pgpNewDig(0); @@ -496,7 +495,6 @@ || pubp->userid == NULL) goto exit; -/*@-boundswrite@*/ v = t = xmalloc(16+1); t = stpcpy(t, pgpHexStr(pubp->signid, sizeof(pubp->signid))); @@ -514,7 +512,6 @@ evr = t = xmalloc(sizeof("4X:-")+strlen(v)+strlen(r)); t = stpcpy(t, (pubp->version == 4 ? "4:" : "3:")); t = stpcpy( stpcpy( stpcpy(t, v), "-"), r); -/*@=boundswrite@*/ /* Check for pre-existing header. */ @@ -614,10 +611,7 @@ if (argv == NULL) return res; - /*@-branchstate@*/ -/*@-boundsread@*/ while ((fn = *argv++) != NULL) { -/*@=boundsread@*/ rpmtsClean(ts); pkt = _free(pkt); @@ -656,7 +650,6 @@ } } - /*@=branchstate@*/ rpmtsClean(ts); pkt = _free(pkt); @@ -888,7 +881,7 @@ sprintf(b, "%s:%c", fn, (rpmIsVerbose() ? '\n' : ' ') ); b += strlen(b); - if (sigh) + if (sigh != NULL) for (hi = headerInitIterator(sigh); headerNextIterator(hi, &sigtag, &sigtype, &sig, &siglen) != 0; (void) rpmtsSetSig(ts, sigtag, sigtype, NULL, siglen)) @@ -955,7 +948,6 @@ res3 = rpmVerifySignature(dig, result); -/*@-bounds@*/ if (res3) { if (rpmIsVerbose()) { b = stpcpy(b, " "); @@ -1093,9 +1085,8 @@ } } } -/*@=bounds@*/ } - if (hi) + if (hi != NULL) hi = headerFreeIterator(hi); res += res2; @@ -1168,8 +1159,10 @@ rpmgiFlags _giFlags = RPMGI_NONE; rpmRC rc; +/*@-mods@*/ if (ftsOpts == 0) ftsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); +/*@=mods@*/ rc = rpmgiSetArgs(gi, argv, ftsOpts, (_giFlags|RPMGI_NOHEADER)); while (rpmgiNext(gi) == RPMRC_OK) { const char * fn = rpmgiHdrPath(gi); @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmds.c ============================================================================ $ cvs diff -u -r2.65 -r2.66 rpmds.c --- rpm/lib/rpmds.c 27 Sep 2007 06:41:59 -0000 2.65 +++ rpm/lib/rpmds.c 30 Sep 2007 20:38:25 -0000 2.66 @@ -181,7 +181,6 @@ } else return NULL; - /*@-branchstate@*/ if (ds->Count > 0) { ds->N = hfd(ds->N, ds->Nt); ds->EVR = hfd(ds->EVR, ds->EVRt); @@ -190,7 +189,6 @@ /*@=evalorder@*/ ds->h = headerFree(ds->h); } - /*@=branchstate@*/ ds->DNEVR = _free(ds->DNEVR); ds->ns.str = _free(ds->ns.str); @@ -202,15 +200,12 @@ (void) rpmdsUnlink(ds, ds->Type); /*@-refcounttrans -usereleased@*/ -/*@-boundswrite@*/ memset(ds, 0, sizeof(*ds)); /* XXX trash and burn */ -/*@=boundswrite@*/ ds = _free(ds); /*@=refcounttrans =usereleased@*/ return NULL; } -/*@-bounds@*/ static /*@null@*/ const char ** rpmdsDupArgv(/*@null@*/ const char ** argv, int argc) /*@*/ @@ -239,7 +234,6 @@ return av; /*@=nullret@*/ } -/*@=bounds@*/ rpmds rpmdsNew(Header h, rpmTag tagN, int flags) { @@ -292,7 +286,6 @@ } else goto exit; - /*@-branchstate@*/ if (hge(h, tagN, &Nt, &N, &Count) && N != NULL && Count > 0) { @@ -313,7 +306,6 @@ xx = hge(h, tagEVR, &ds->EVRt, &ds->EVR, NULL); if (tagF > 0) xx = hge(h, tagF, &ds->Ft, &ds->Flags, NULL); -/*@-boundsread@*/ if (!scareMem && ds->Flags != NULL) ds->Flags = memcpy(xmalloc(ds->Count * sizeof(*ds->Flags)), ds->Flags, ds->Count * sizeof(*ds->Flags)); @@ -331,7 +323,6 @@ xx = hge(h, tagBT, &BTt, &BTp, NULL); ds->BT = (xx && BTp != NULL && BTt == RPM_INT32_TYPE ? *BTp : 0); } -/*@=boundsread@*/ if (tagN == RPMTAG_DIRNAMES) { char * t; @@ -381,7 +372,6 @@ /*@=modfilesys@*/ } - /*@=branchstate@*/ exit: /*@-compdef -usereleased@*/ /* FIX: ds->Flags may be NULL */ @@ -417,7 +407,6 @@ size_t nb = 0; if (dspfx) nb += strlen(dspfx) + 1; -/*@-boundsread@*/ if (ds->ns.str[0] == '!') nb++; if (NS) nb += strlen(NS) + sizeof("()") - 1; if (N) nb += strlen(N); @@ -447,9 +436,7 @@ if (nb) nb++; nb += strlen(ds->EVR[ds->i]); } -/*@=boundsread@*/ -/*@-boundswrite@*/ t = tbuf = xmalloc(nb + 1); if (dspfx) { t = stpcpy(t, dspfx); @@ -486,7 +473,6 @@ t = stpcpy(t, ds->EVR[ds->i]); } *t = '\0'; -/*@=boundswrite@*/ return tbuf; } @@ -524,12 +510,13 @@ } else goto exit; +/*@-mods@*/ xx = headerNEVRA(h, &n, NULL, &v, &r, NULL); +/*@=mods@*/ ep = NULL; xx = hge(h, RPMTAG_EPOCH, NULL, &ep, NULL); t = xmalloc(sizeof(*N) + strlen(n) + 1); -/*@-boundswrite@*/ N = (const char **) t; t += sizeof(*N); *t = '\0'; @@ -547,7 +534,6 @@ t += strlen(t); } t = stpcpy( stpcpy( stpcpy( t, v), "-"), r); -/*@=boundswrite@*/ ds = xcalloc(1, sizeof(*ds)); ds->Type = Type; @@ -557,9 +543,7 @@ ds->Nt = -1; /* XXX to insure that hfd will free */ ds->EVR = EVR; ds->EVRt = -1; /* XXX to insure that hfd will free */ -/*@-boundswrite@*/ ds->Flags = xmalloc(sizeof(*ds->Flags)); ds->Flags[0] = Flags; -/*@=boundswrite@*/ { rpmTag tagA = RPMTAG_ARCH; rpmTagType At; const char * A = NULL; @@ -575,9 +559,7 @@ ds->BT = (xx && BTp != NULL && BTt == RPM_INT32_TYPE ? *BTp : 0); } { char pre[2]; -/*@-boundsread@*/ pre[0] = ds->Type[0]; -/*@=boundsread@*/ pre[1] = '\0'; /*@-nullstate@*/ /* LCL: ds->Type may be NULL ??? */ /*@i@*/ ds->DNEVR = rpmdsNewDNEVR(pre, ds); @@ -625,18 +607,14 @@ } ds->Count = 1; /*@-assignexpose@*/ -/*@-boundswrite@*/ ds->N = xmalloc(sizeof(*ds->N)); ds->N[0] = N; ds->Nt = -1; /* XXX to insure that hfd will free */ ds->EVR = xmalloc(sizeof(*ds->EVR)); ds->EVR[0] = EVR; ds->EVRt = -1; /* XXX to insure that hfd will free */ /*@=assignexpose@*/ ds->Flags = xmalloc(sizeof(*ds->Flags)); ds->Flags[0] = Flags; -/*@=boundswrite@*/ { char t[2]; -/*@-boundsread@*/ t[0] = ds->Type[0]; -/*@=boundsread@*/ t[1] = '\0'; /*@i@*/ ds->DNEVR = rpmdsNewDNEVR(t, ds); } @@ -671,10 +649,8 @@ const char * DNEVR = NULL; if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) { -/*@-boundsread@*/ if (ds->DNEVR != NULL) DNEVR = ds->DNEVR; -/*@=boundsread@*/ } return DNEVR; } @@ -684,9 +660,9 @@ const char * N = NULL; if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) { -/*@-boundsread -globs -mods @*/ /* FIX: correct annotations for ds->ns shadow */ +/*@-globs -mods @*/ /* FIX: correct annotations for ds->ns shadow */ N = (ds->ns.N ? ds->ns.N : rpmdsNewN(ds)); -/*@=boundsread =globs =mods @*/ +/*@=globs =mods @*/ } return N; } @@ -696,10 +672,8 @@ const char * EVR = NULL; if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) { -/*@-boundsread@*/ if (ds->EVR != NULL) EVR = ds->EVR[ds->i]; -/*@=boundsread@*/ } return EVR; } @@ -709,10 +683,8 @@ int_32 Flags = 0; if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) { -/*@-boundsread@*/ if (ds->Flags != NULL) Flags = ds->Flags[ds->i]; -/*@=boundsread@*/ } return Flags; } @@ -809,10 +781,8 @@ uint_32 Color = 0; if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) { -/*@-boundsread@*/ if (ds->Color != NULL) Color = ds->Color[ds->i]; -/*@=boundsread@*/ } return Color; } @@ -828,12 +798,10 @@ ds->Color = xcalloc(ds->Count, sizeof(*ds->Color)); if (ds->i >= 0 && ds->i < ds->Count) { -/*@-bounds@*/ if (ds->Color != NULL) { ocolor = ds->Color[ds->i]; ds->Color[ds->i] = color; } -/*@=bounds@*/ } return ocolor; } @@ -843,10 +811,8 @@ int_32 Refs = 0; if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) { -/*@-boundsread@*/ if (ds->Refs != NULL) Refs = ds->Refs[ds->i]; -/*@=boundsread@*/ } return Refs; } @@ -862,12 +828,10 @@ ds->Refs = xcalloc(ds->Count, sizeof(*ds->Refs)); if (ds->i >= 0 && ds->i < ds->Count) { -/*@-bounds@*/ if (ds->Refs != NULL) { orefs = ds->Refs[ds->i]; ds->Refs[ds->i] = refs; } -/*@=bounds@*/ } return orefs; } @@ -877,10 +841,8 @@ int_32 result = 0; if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) { -/*@-boundsread@*/ if (ds->Result != NULL) result = ds->Result[ds->i]; -/*@=boundsread@*/ } return result; } @@ -896,12 +858,10 @@ ds->Result = xcalloc(ds->Count, sizeof(*ds->Result)); if (ds->i >= 0 && ds->i < ds->Count) { -/*@-bounds@*/ if (ds->Result != NULL) { oresult = ds->Result[ds->i]; ds->Result[ds->i] = result; } -/*@=bounds@*/ } return oresult; } @@ -1054,14 +1014,12 @@ return -1; /* If not initialized yet, dup the 1st entry. */ -/*@-branchstate@*/ if (*dsp == NULL) { save = ods->Count; ods->Count = 1; *dsp = rpmdsDup(ods); ods->Count = save; } -/*@=branchstate@*/ ds = *dsp; if (ds == NULL) return -1; @@ -1297,10 +1255,8 @@ } /*@=modobserver@*/ -/*@-branchstate@*/ if (fn == NULL) fn = _cpuinfo_path; -/*@=branchstate@*/ /* Reset done variables. */ for (ct = ctags; ct->name != NULL; ct++) @@ -1387,9 +1343,7 @@ } exit: -/*@-branchstate@*/ if (fd != NULL) (void) Fclose(fd); -/*@=branchstate@*/ return rc; } @@ -1558,7 +1512,6 @@ Flags = 0; /* parse for non-path, versioned dependency. */ -/*@-branchstate@*/ if (*f != '/' && *fe != '\0') { /* parse comparison operator */ g = fe; @@ -1593,7 +1546,6 @@ if (EVR == NULL) EVR = ""; Flags |= RPMSENSE_PROBE; -/*@=branchstate@*/ ds = rpmdsSingle(tagN, N, EVR , Flags); if (ds) { /* XXX can't happen */ xx = rpmdsMergePRCO(PRCO, ds); @@ -1603,9 +1555,7 @@ rc = 0; exit: -/*@-branchstate@*/ if (fd != NULL) (void) Fclose(fd); -/*@=branchstate@*/ return rc; } @@ -1645,10 +1595,8 @@ } /*@=modobserver@*/ -/*@-branchstate@*/ if (fn == NULL) fn = _sysinfo_path; -/*@=branchstate@*/ if (fn == NULL) goto exit; @@ -1662,7 +1610,6 @@ const char **av; int tagN; rc = 0; /* assume success */ -/*@-branchstate@*/ for (av = _sysinfo_tags; av && *av; av++) { tagN = tagValue(*av); if (tagN < 0) @@ -1676,7 +1623,6 @@ if (rc) break; } -/*@=branchstate@*/ } else /* XXX for now, collect Dirnames/Filelinktos in Providename */ if (S_ISREG(st->st_mode)) @@ -2613,7 +2559,6 @@ } /*@=modobserver@*/ -/*@-branchstate@*/ if (path == NULL) path = _getconf_path; @@ -2681,7 +2626,6 @@ rpmdsNSAdd(dsp, NS, N, EVR, Flags); EVR = _free(EVR); } -/*@=branchstate@*/ return 0; } @@ -2819,6 +2763,7 @@ } #endif +/*@-moduncon -noeffectuncon @*/ int rpmdsELF(const char * fn, int flags, int (*add) (void * context, rpmds ds), void * context) { @@ -2888,7 +2833,7 @@ isElf64 = ehdr->e_ident[EI_CLASS] == ELFCLASS64; isDSO = ehdr->e_type == ET_DYN; - /*@-branchstate -uniondef @*/ + /*@-uniondef @*/ scn = NULL; while ((scn = elf_nextscn(elf, scn)) != NULL) { shdr = gelf_getshdr(scn, &shdr_mem); @@ -3004,7 +2949,6 @@ case SHT_DYNAMIC: data = NULL; while ((data = elf_getdata (scn, data)) != NULL) { -/*@-boundswrite@*/ for (cnt = 0; cnt < (shdr->sh_size / shdr->sh_entsize); ++cnt) { dyn = gelf_getdyn (data, cnt, &dyn_mem); if (dyn == NULL) @@ -3053,12 +2997,11 @@ /*@switchbreak@*/ break; } } -/*@=boundswrite@*/ } /*@switchbreak@*/ break; } } - /*@=branchstate =uniondef @*/ + /*@=uniondef @*/ /* For DSOs which use the .gnu_hash section and don't have a .hash * section, we need to ensure that we have a new enough glibc. */ @@ -3096,6 +3039,7 @@ return -1; #endif } +/*@=moduncon =noeffectuncon @*/ #define _SBIN_LDCONFIG_P "/sbin/ldconfig -p" /*@unchecked@*/ /*@observer@*/ /*@owned@*/ /*@relnull@*/ @@ -3147,10 +3091,8 @@ } /*@=modobserver@*/ -/*@-branchstate@*/ if (fn == NULL) fn = _ldconfig_cache; -/*@=branchstate@*/ if (_rpmds_debug < 0) fprintf(stderr, "*** rpmdsLdconfig(%p, %s) P %p R %p C %p O %p T %p D %p L %p\n", PRCO, fn, PRCO->Pdsp, PRCO->Rdsp, PRCO->Cdsp, PRCO->Odsp, PRCO->Tdsp, PRCO->Ddsp, PRCO->Ldsp); @@ -3215,10 +3157,8 @@ /* ", OS ABI: %s %d.%d.%d" */ N = f; -/*@-branchstate@*/ if (EVR == NULL) EVR = ""; -/*@=branchstate@*/ Flags |= RPMSENSE_PROBE; ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags); xx = rpmdsMerge(PRCO->Pdsp, ds); @@ -3271,10 +3211,8 @@ } /*@=modobserver@*/ -/*@-branchstate@*/ if (rldp == NULL) rldp = _rld_search_path; -/*@=branchstate@*/ if (_rpmds_debug > 0) fprintf(stderr, "*** rpmdsRldpath(%p, %s) P %p R %p C %p O %p\n", PRCO, rldp, PRCO->Pdsp, PRCO->Rdsp, PRCO->Cdsp, PRCO->Odsp); @@ -3316,7 +3254,6 @@ gp = gl.gl_pathv; /* examine each match */ -/*@-branchstate@*/ while (gp && *gp) { const char *DSOfn; /* XXX: should probably verify that we matched a file */ @@ -3337,7 +3274,6 @@ xx = rpmdsELF(DSOfn, 0, rpmdsMergePRCO, PRCO); } -/*@=branchstate@*/ /*@-immediatetrans@*/ globfree(&gl); /*@=immediatetrans@*/ @@ -3491,10 +3427,8 @@ if (tagN <= 0) tagN = RPMTAG_PROVIDENAME; -/*@-branchstate@*/ if (cmd == NULL) cmd = _perldeps_cmd; -/*@=branchstate@*/ fp = popen(cmd, "r"); if (fp == NULL) @@ -3542,7 +3476,6 @@ Flags = 0; /* parse for non-path, versioned dependency. */ -/*@-branchstate@*/ if (*f != '/' && *fe != '\0') { /* parse comparison operator */ g = fe; @@ -3583,7 +3516,6 @@ if (EVR == NULL) EVR = ""; Flags |= RPMSENSE_PROBE; -/*@=branchstate@*/ ds = rpmdsSingle(tagN, N, EVR, Flags); xx = rpmdsMerge(dsp, ds); ds = rpmdsFree(ds); @@ -3635,7 +3567,6 @@ assert((rpmdsFlags(A) & RPMSENSE_SENSEMASK) == A->ns.Flags); assert((rpmdsFlags(B) & RPMSENSE_SENSEMASK) == B->ns.Flags); -/*@-boundsread@*/ /* Different names (and/or name.arch's) don't overlap. */ if (rpmdsNAcmp(A, B)) { result = 0; @@ -3656,10 +3587,8 @@ goto exit; /* Both AEVR and BEVR exist. */ -/*@-boundswrite@*/ xx = (A->EVRparse ? A->EVRparse : rpmEVRparse) (A->EVR[A->i], a); xx = (B->EVRparse ? B->EVRparse : rpmEVRparse) (B->EVR[B->i], b); -/*@=boundswrite@*/ /* If EVRcmp is identical, use that, otherwise use default. */ EVRcmp = (A->EVRcmp && B->EVRcmp && A->EVRcmp == B->EVRcmp) @@ -3685,7 +3614,6 @@ if (sense == 0 && a->R && *a->R && b->R && *b->R) /*@i@*/ sense = EVRcmp(a->R, b->R); } -/*@=boundsread@*/ a->str = _free(a->str); b->str = _free(b->str); @@ -3725,11 +3653,9 @@ if (ps == NULL) return; - /*@-branchstate@*/ if (Name == NULL) Name = "?N?"; if (EVR == NULL) EVR = "?EVR?"; if (DNEVR == NULL) DNEVR = "? ?N? ?OP? ?EVR?"; - /*@=branchstate@*/ rpmMessage(RPMMESS_DEBUG, D_("package %s has unsatisfied %s: %s\n"), pkgNEVR, ds->Type, DNEVR+2); @@ -3758,11 +3684,9 @@ switch(req->ns.Type) { default: -/*@-boundsread@*/ /* Primary key retrieve satisfes an existence compare. */ if (!reqFlags || !req->EVR[req->i] || *req->EVR[req->i] == '\0') goto exit; -/*@=boundsread@*/ /*@fallthrough@*/ case RPMNS_TYPE_ARCH: break; @@ -3816,18 +3740,17 @@ if (req->EVR == NULL || req->Flags == NULL) goto exit; -/*@-boundsread@*/ if (!(reqFlags && req->EVR[req->i] && *req->EVR[req->i])) goto exit; -/*@=boundsread@*/ /* Get package information from header */ +/*@-mods@*/ (void) headerNEVRA(h, &pkgN, NULL, &V, &R, NULL); +/*@=mods@*/ nb = 21 + 1 + 1; if (V) nb += strlen(V); if (R) nb += strlen(R); -/*@-boundswrite@*/ pkgEVR = t = alloca(nb); *t = '\0'; if (hge(h, RPMTAG_EPOCH, NULL, &epoch, NULL)) { @@ -3835,7 +3758,6 @@ t += strlen(t); } (void) stpcpy( stpcpy( stpcpy(t, V) , "-") , R); -/*@=boundswrite@*/ if ((pkg = rpmdsSingle(RPMTAG_PROVIDENAME, pkgN, pkgEVR, pkgFlags)) != NULL) { if (nopromote) @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmevr.c ============================================================================ $ cvs diff -u -r1.2 -r1.3 rpmevr.c --- rpm/lib/rpmevr.c 25 May 2007 18:34:13 -0000 1.2 +++ rpm/lib/rpmevr.c 30 Sep 2007 20:38:25 -0000 1.3 @@ -106,9 +106,7 @@ evr->E = s; *se++ = '\0'; evr->V = se; -/*@-branchstate@*/ if (*evr->E == '\0') evr->E = "0"; -/*@=branchstate@*/ evr->Elong = strtoul(evr->E, NULL, 10); } else { evr->E = NULL; /* XXX disable epoch compare if missing */ @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmfc.c ============================================================================ $ cvs diff -u -r1.16 -r1.17 rpmfc.c --- rpm/lib/rpmfc.c 22 Sep 2007 20:37:16 -0000 1.16 +++ rpm/lib/rpmfc.c 30 Sep 2007 20:38:25 -0000 1.17 @@ -34,9 +34,7 @@ int ac = argvCount(av); int i; -/*@-bounds@*/ /* LCL: internal error */ argv = xrealloc(argv, (argc + ac + 1) * sizeof(*argv)); -/*@=bounds@*/ for (i = 0; i < ac; i++) argv[argc + i] = rpmExpand(av[i], NULL); argv[argc + ac] = NULL; @@ -163,14 +161,12 @@ } /* Read any data from prog */ -/*@-boundswrite@*/ { char buf[BUFSIZ+1]; while ((nbr = read(fromProg[0], buf, sizeof(buf)-1)) > 0) { buf[nbr] = '\0'; appendStringBuf(readBuff, buf); } } -/*@=boundswrite@*/ /* terminate on (non-blocking) EOF or error */ done = (nbr == 0 || (nbr < 0 && errno != EAGAIN)); @@ -237,11 +233,9 @@ /* Build argv, appending args to the executable args. */ xav = NULL; -/*@-boundswrite@*/ xx = argvAppend(&xav, pav); if (av[1]) xx = rpmfcExpandAppend(&xav, av + 1); -/*@=boundswrite@*/ if (sb_stdin != NULL) { buf_stdin = getStringBuf(sb_stdin); @@ -251,12 +245,10 @@ /* Read output from exec'd helper. */ sb = getOutputFrom(NULL, xav, buf_stdin, buf_stdin_len, failnonzero); -/*@-branchstate@*/ if (sb_stdoutp != NULL) { *sb_stdoutp = sb; sb = NULL; /* XXX don't free */ } -/*@=branchstate@*/ ec = 0; @@ -365,9 +357,7 @@ sb_stdin = newStringBuf(); appendLineStringBuf(sb_stdin, fn); sb_stdout = NULL; -/*@-boundswrite@*/ xx = rpmfcExec(av, sb_stdin, &sb_stdout, 0); -/*@=boundswrite@*/ sb_stdin = freeStringBuf(sb_stdin); if (xx == 0 && sb_stdout != NULL) { @@ -379,7 +369,6 @@ N = pav[i]; EVR = ""; Flags = dsContext; -/*@-branchstate@*/ if (pav[i+1] && strchr("=<>", *pav[i+1])) { i++; for (s = pav[i]; *s; s++) { @@ -402,7 +391,6 @@ EVR = pav[i]; assert(EVR != NULL); } -/*@=branchstate@*/ /* Add tracking dependency for versioned Provides: */ @@ -421,9 +409,7 @@ xx = rpmdsMerge(depsp, ds); /* Add to file dependencies. */ -/*@-boundswrite@*/ xx = rpmfcSaveArg(&fc->ddict, rpmfcFileDep(buf, fc->ix, ds)); -/*@=boundswrite@*/ ds = rpmdsFree(ds); } @@ -693,7 +679,6 @@ } /* Look for #! interpreter in first 10 lines. */ -/*@-boundswrite@*/ for (i = 0; i < 10; i++) { s = fgets(buf, sizeof(buf) - 1, fp); @@ -731,7 +716,9 @@ /* Set color based on interpreter name. */ /* XXX magic token should have already done this?!? */ +/*@-moduncon@*/ bn = basename(s); +/*@=moduncon@*/ if (!strcmp(bn, "perl")) fc->fcolor->vals[fc->ix] |= RPMFC_PERL; else if (!strncmp(bn, "python", sizeof("python")-1)) @@ -741,7 +728,6 @@ break; } -/*@=boundswrite@*/ (void) fclose(fp); @@ -915,7 +901,6 @@ } } -/*@-boundswrite@*/ /* Generate per-file indices into package dependencies. */ nddict = argvCount(fc->ddict); previx = -1; @@ -974,7 +959,6 @@ if (fc->fddictn && fc->fddictn->vals && !skipping) fc->fddictn->vals[ix]++; } -/*@=boundswrite@*/ return 0; } @@ -997,7 +981,7 @@ if (magicfile == NULL || *magicfile == '\0') magicfile = _free(magicfile); mg = rpmmgNew(magicfile, 0); -assert(mg); /* XXX figger a proper return path. */ +assert(mg != NULL); /* XXX figger a proper return path. */ fc->nfiles = argvCount(argv); @@ -1020,7 +1004,6 @@ assert(s != NULL && *s == '/'); slen = strlen(s); -/*@-branchstate@*/ switch (mode & S_IFMT) { case S_IFCHR: ftype = "character special"; /*@switchbreak@*/ break; case S_IFBLK: ftype = "block special"; /*@switchbreak@*/ break; @@ -1069,12 +1052,11 @@ ftype = ""; else if (magicfile) { ftype = rpmmgFile(mg, s); -assert(ftype); /* XXX never happens, rpmmgFile() returns "" */ +assert(ftype != NULL); /* XXX never happens, rpmmgFile() returns "" */ freeftype = 1; } /*@switchbreak@*/ break; } -/*@=branchstate@*/ se = ftype; rpmMessage(RPMMESS_DEBUG, "%s: %s\n", s, se); @@ -1089,13 +1071,13 @@ fcolor = rpmfcColoring(se); xx = argiAdd(&fc->fcolor, fc->ix, fcolor); -/*@-boundswrite@*/ if (fcolor != RPMFC_WHITE && (fcolor & RPMFC_INCLUDE)) xx = rpmfcSaveArg(&fc->cdict, se); -/*@=boundswrite@*/ +/*@-modobserver -observertrans @*/ /* XXX mixed types in variable */ if (freeftype) ftype = _free(ftype); +/*@=modobserver =observertrans @*/ } /* Build per-file class index array. */ @@ -1279,9 +1261,7 @@ /*@notreached@*/ /*@switchbreak@*/ break; } -/*@-boundswrite@*/ xx = rpmfcExec(dm->argv, sb_stdin, &sb_stdout, failnonzero); -/*@=boundswrite@*/ if (xx == -1) continue; @@ -1348,7 +1328,6 @@ int failnonzero = 0; int rc = 0; -/*@-branchstate@*/ for (dm = ScriptMsgs; dm->msg != NULL; dm++) { int tag, tagflags; char * s; @@ -1372,9 +1351,7 @@ appendLineStringBuf(sb_stdin, s); stripTrailingBlanksStringBuf(sb_stdin); -/*@-boundswrite@*/ xx = rpmfcExec(dm->argv, sb_stdin, &sb_stdout, failnonzero); -/*@=boundswrite@*/ if (xx == -1) continue; @@ -1399,7 +1376,6 @@ sb_stdout = freeStringBuf(sb_stdout); } -/*@=branchstate@*/ sb_stdin = freeStringBuf(sb_stdin); @@ -1451,7 +1427,6 @@ av = xcalloc(ac+1, sizeof(*av)); fmode = xcalloc(ac+1, sizeof(*fmode)); -/*@-boundswrite@*/ genConfigDeps = 0; fi = rpmfiInit(fi, 0); if (fi != NULL) @@ -1466,7 +1441,6 @@ fmode[c] = rpmfiFMode(fi); } av[ac] = NULL; -/*@=boundswrite@*/ fc = rpmfcNew(); fc->skipProv = !pkg->autoProv; @@ -1564,7 +1538,6 @@ p, c); /* Add Provides: */ -/*@-branchstate@*/ if (fc->provides != NULL && (c = rpmdsCount(fc->provides)) > 0 && !fc->skipProv) { p = (const void **) fc->provides->N; xx = headerAddEntry(pkg->header, RPMTAG_PROVIDENAME, RPM_STRING_ARRAY_TYPE, @@ -1581,10 +1554,8 @@ p, c); /*@=nullpass@*/ } -/*@=branchstate@*/ /* Add Requires: */ -/*@-branchstate@*/ if (fc->requires != NULL && (c = rpmdsCount(fc->requires)) > 0 && !fc->skipReq) { p = (const void **) fc->requires->N; xx = headerAddEntry(pkg->header, RPMTAG_REQUIRENAME, RPM_STRING_ARRAY_TYPE, @@ -1601,7 +1572,6 @@ p, c); /*@=nullpass@*/ } -/*@=branchstate@*/ /* Add dependency dictionary(#dependencies) */ p = (const void **) argiData(fc->ddictx); @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmfi.c ============================================================================ $ cvs diff -u -r2.78 -r2.79 rpmfi.c --- rpm/lib/rpmfi.c 28 Sep 2007 22:36:15 -0000 2.78 +++ rpm/lib/rpmfi.c 30 Sep 2007 20:38:25 -0000 2.79 @@ -82,9 +82,7 @@ if (fi != NULL && fx >= 0 && fx < fi->fc) { i = fi->i; fi->i = fx; -/*@-boundsread@*/ fi->j = fi->dil[fi->i]; -/*@=boundsread@*/ } return i; } @@ -115,10 +113,8 @@ const char * BN = NULL; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->bnl != NULL) BN = fi->bnl[fi->i]; -/*@=boundsread@*/ } return BN; } @@ -128,10 +124,8 @@ const char * DN = NULL; if (fi != NULL && fi->j >= 0 && fi->j < fi->dc) { -/*@-boundsread@*/ if (fi->dnl != NULL) DN = fi->dnl[fi->j]; -/*@=boundsread@*/ } return DN; } @@ -140,7 +134,6 @@ { const char * FN = ""; - /*@-branchstate@*/ if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { const char *dn; char * t; @@ -148,13 +141,10 @@ fi->fn = xmalloc(fi->fnlen); FN = t = fi->fn; (void) urlPath(fi->dnl[fi->dil[fi->i]], &dn); -/*@-boundswrite@*/ *t = '\0'; t = stpcpy(t, dn); t = stpcpy(t, fi->bnl[fi->i]); -/*@=boundswrite@*/ } - /*@=branchstate@*/ return FN; } @@ -163,10 +153,8 @@ uint_32 FFlags = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->fflags != NULL) FFlags = fi->fflags[fi->i]; -/*@=boundsread@*/ } return FFlags; } @@ -176,12 +164,10 @@ uint_32 oFFlags = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->fflags != NULL && fi->h == NULL) { oFFlags = fi->fflags[fi->i]; *((uint_32 *)(fi->fflags + fi->i)) = FFlags; } -/*@=boundsread@*/ } return oFFlags; } @@ -191,10 +177,8 @@ uint_32 VFlags = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->vflags != NULL) VFlags = fi->vflags[fi->i]; -/*@=boundsread@*/ } return VFlags; } @@ -204,12 +188,10 @@ uint_32 oVFlags = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->vflags != NULL && fi->h == NULL) { oVFlags = fi->vflags[fi->i]; *((uint_32 *)(fi->vflags + fi->i)) = VFlags; } -/*@=boundsread@*/ } return oVFlags; } @@ -219,10 +201,8 @@ int_16 fmode = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->fmodes != NULL) fmode = fi->fmodes[fi->i]; -/*@=boundsread@*/ } return fmode; } @@ -232,10 +212,8 @@ rpmfileState fstate = RPMFILE_STATE_MISSING; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->fstates != NULL) fstate = fi->fstates[fi->i]; -/*@=boundsread@*/ } return fstate; } @@ -245,12 +223,10 @@ int_32 ofstate = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->fstates != NULL) { ofstate = fi->fstates[fi->i]; fi->fstates[fi->i] = fstate; } -/*@=boundsread@*/ } return ofstate; } @@ -260,7 +236,6 @@ unsigned char * digest = NULL; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->digests != NULL) { digest = fi->digests + (fi->digestlen * fi->i); if (algop != NULL) @@ -269,7 +244,6 @@ if (lenp != NULL) *lenp = fi->digestlen; } -/*@=boundsread@*/ } return digest; } @@ -279,10 +253,8 @@ const char * flink = NULL; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->flinks != NULL) flink = fi->flinks[fi->i]; -/*@=boundsread@*/ } return flink; } @@ -292,10 +264,8 @@ int_32 fsize = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->fsizes != NULL) fsize = fi->fsizes[fi->i]; -/*@=boundsread@*/ } return fsize; } @@ -305,10 +275,8 @@ int_16 frdev = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->frdevs != NULL) frdev = fi->frdevs[fi->i]; -/*@=boundsread@*/ } return frdev; } @@ -318,10 +286,8 @@ int_32 finode = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->finodes != NULL) finode = fi->finodes[fi->i]; -/*@=boundsread@*/ } return finode; } @@ -341,11 +307,9 @@ uint_32 fcolor = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->fcolors != NULL) /* XXX ignore all but lsnibble for now. */ fcolor = (fi->fcolors[fi->i] & 0x0f); -/*@=boundsread@*/ } return fcolor; } @@ -356,11 +320,9 @@ int cdictx; if (fi != NULL && fi->fcdictx != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ cdictx = fi->fcdictx[fi->i]; if (fi->cdict != NULL && cdictx >= 0 && cdictx < fi->ncdict) fclass = fi->cdict[cdictx]; -/*@=boundsread@*/ } return fclass; } @@ -370,10 +332,8 @@ const char * fcontext = NULL; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->fcontexts != NULL) fcontext = fi->fcontexts[fi->i]; -/*@=boundsread@*/ } return fcontext; } @@ -385,19 +345,17 @@ const uint_32 * fddict = NULL; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->fddictn != NULL) fddictn = fi->fddictn[fi->i]; if (fddictn > 0 && fi->fddictx != NULL) fddictx = fi->fddictx[fi->i]; if (fi->ddict != NULL && fddictx >= 0 && (fddictx+fddictn) <= fi->nddict) fddict = fi->ddict + fddictx; -/*@=boundsread@*/ } -/*@-boundswrite -dependenttrans -onlytrans @*/ +/*@-dependenttrans -onlytrans @*/ if (fddictp) *fddictp = fddict; -/*@=boundswrite =dependenttrans =onlytrans @*/ +/*@=dependenttrans =onlytrans @*/ return fddictn; } @@ -407,7 +365,6 @@ if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { /* XXX rpm-2.3.12 has not RPMTAG_FILEINODES */ -/*@-boundsread@*/ if (fi->finodes && fi->frdevs) { int_32 finode = fi->finodes[fi->i]; int_16 frdev = fi->frdevs[fi->i]; @@ -418,7 +375,6 @@ nlink++; } } -/*@=boundsread@*/ } return nlink; } @@ -428,10 +384,8 @@ int_32 fmtime = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->fmtimes != NULL) fmtime = fi->fmtimes[fi->i]; -/*@=boundsread@*/ } return fmtime; } @@ -442,10 +396,8 @@ /* XXX add support for ancient RPMTAG_FILEUIDS? */ if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->fuser != NULL) fuser = fi->fuser[fi->i]; -/*@=boundsread@*/ } return fuser; } @@ -456,10 +408,8 @@ /* XXX add support for ancient RPMTAG_FILEGIDS? */ if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { -/*@-boundsread@*/ if (fi->fgroup != NULL) fgroup = fi->fgroup[fi->i]; -/*@=boundsread@*/ } return fgroup; } @@ -471,10 +421,8 @@ if (fi != NULL && ++fi->i >= 0) { if (fi->i < fi->fc) { i = fi->i; -/*@-boundsread@*/ if (fi->dil != NULL) fi->j = fi->dil[fi->i]; -/*@=boundsread@*/ } else fi->i = -1; @@ -577,7 +525,6 @@ return REG; } -/*@-boundsread@*/ int rpmfiCompare(const rpmfi afi, const rpmfi bfi) /*@*/ { @@ -611,9 +558,7 @@ return 0; } -/*@=boundsread@*/ -/*@-boundsread@*/ fileAction rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing) { const char * fn = rpmfiFN(nfi); @@ -708,7 +653,6 @@ */ return save; } -/*@=boundsread@*/ /*@observer@*/ const char * rpmfiTypeString(rpmfi fi) @@ -732,7 +676,6 @@ * @param actions file dispositions * @return header with relocated files */ -/*@-bounds@*/ static Header relocateFileList(const rpmts ts, rpmfi fi, Header origH, fileAction * actions) @@ -815,22 +758,18 @@ /* FIXME: Trailing /'s will confuse us greatly. Internal ones will too, but those are more trouble to fix up. :-( */ t = alloca_strdup(p->relocs[i].oldPath); - /*@-branchstate@*/ relocations[i].oldPath = (t[0] == '/' && t[1] == '\0') ? t : stripTrailingChar(t, '/'); - /*@=branchstate@*/ /* An old path w/o a new path is valid, and indicates exclusion */ if (p->relocs[i].newPath) { int del; t = alloca_strdup(p->relocs[i].newPath); - /*@-branchstate@*/ relocations[i].newPath = (t[0] == '/' && t[1] == '\0') ? t : stripTrailingChar(t, '/'); - /*@=branchstate@*/ /*@-nullpass@*/ /* FIX: relocations[i].oldPath == NULL */ /* Verify that the relocation's old path is in the header. */ @@ -953,12 +892,10 @@ len = reldel + strlen(dirNames[dirIndexes[i]]) + strlen(baseNames[i]) + 1; - /*@-branchstate@*/ if (len >= fileAlloced) { fileAlloced = len * 2; fn = xrealloc(fn, fileAlloced); } - /*@=branchstate@*/ assert(fn != NULL); /* XXX can't happen */ *fn = '\0'; @@ -1174,7 +1111,6 @@ return h; } -/*@=bounds@*/ rpmfi rpmfiFree(rpmfi fi) { @@ -1196,7 +1132,6 @@ fi->posttrans = _free(fi->posttrans); fi->posttransprog = _fr