Splint fiddles.

CVS patchset: 7669
CVS date: 2005/01/04 17:11:00
This commit is contained in:
jbj 2005-01-04 17:11:00 +00:00
parent 34caf4357a
commit 228d0e350a
15 changed files with 50 additions and 23 deletions

View File

@ -1,4 +1,4 @@
-I. -I./build -I./lib -I./rpmdb -I./rpmio -I./beecrypt -I./lua/include -I./lua/local -I./file -I./popt -I./elfutils/libelf -I./zlib -I/usr/lib/gcc-lib/i386-redhat-linux/3.1/include -DHAVE_CONFIG_H -D_GNU_SOURCE -D_REENTRANT -DHAVE_DEV_DSP -DHAVE_SYS_SOUNDCARD
-I. -I./build -I./lib -I./rpmdb -I./rpmio -I./beecrypt -I./lua/include -I./lua/local -I./file/src -I./popt -I./elfutils/libelf -I./zlib -I/usr/lib/gcc-lib/i386-redhat-linux/3.1/include -DHAVE_CONFIG_H -D_GNU_SOURCE -D_REENTRANT -DHAVE_DEV_DSP -DHAVE_SYS_SOUNDCARD
#+partial
+forcehints

View File

@ -31,7 +31,6 @@
- permit Obsoletes: /path/to/file.
- permit Conflicts: /path/to/file.
- free rpmrc when looping on --target arches (#127730).
- port to internal file-4.10 libmagic rather than libfmagic.
- fix: handle non-unique dirnames in rpmalAdd().
- integrate rpmgi "generic iterator" with query/verify.
- bump popt version to 1.10.
@ -49,6 +48,7 @@
- python: bleeping keywords broke labelCompare.
- add support for automagic pubkey retrieval using HKP.
- detect and return errors from neon through Ferror.
- use package color as Obsoletes: color.
4.3.2 -> 4.3.3:
- bump micro version.
@ -57,6 +57,7 @@
- selinux: use rpm_execcon, not execv, to run scriptlets (#136848).
- fix: segfault on --verifydb (#138589).
- sparcv8: optflags changed to -mtune=ultrasparc (#140420).
- port to internal file-4.10 libmagic rather than libfmagic.
4.3.1 -> 4.3.2:
- use /etc/selinux/targeted/contexts/files/file_contexts for now.

View File

@ -1699,7 +1699,7 @@ static int recurseDir(FileList fl, const char * diskURL)
char * ftsSet[2];
FTS * ftsp;
FTSENT * fts;
int ftsOpts = (FTS_COMFOLLOW | FTS_NOCHDIR | FTS_PHYSICAL);
int myFtsOpts = (FTS_COMFOLLOW | FTS_NOCHDIR | FTS_PHYSICAL);
int rc = RPMERR_BADSPEC;
fl->inFtw = 1; /* Flag to indicate file has buildRootURL prefixed */
@ -1707,7 +1707,7 @@ static int recurseDir(FileList fl, const char * diskURL)
ftsSet[0] = (char *) diskURL;
ftsSet[1] = NULL;
ftsp = Fts_open(ftsSet, ftsOpts, NULL);
ftsp = Fts_open(ftsSet, myFtsOpts, NULL);
while ((fts = Fts_read(ftsp)) != NULL) {
switch (fts->fts_info) {
case FTS_D: /* preorder directory */

View File

@ -1171,6 +1171,7 @@ int rpmfcClassify(rpmfc fc, ARGV_t argv)
size_t slen;
int fcolor;
int xx;
/*@observer@*/
static const char * magicfile = "/usr/lib/rpm/magic";
int msflags = MAGIC_CHECK; /* XXX MAGIC_COMPRESS flag? */
magic_t ms = NULL;

View File

@ -451,7 +451,7 @@ static /*@only@*/ char * pgpsigFormat(int_32 type, const void * data,
t = stpcpy(t, "RSA");
break;
default:
snprintf(t, nb - (t - val), "%d", sigp->pubkey_algo);
(void) snprintf(t, nb - (t - val), "%d", sigp->pubkey_algo);
t += strlen(t);
break;
}
@ -466,7 +466,7 @@ static /*@only@*/ char * pgpsigFormat(int_32 type, const void * data,
t = stpcpy(t, "SHA1");
break;
default:
snprintf(t, nb - (t - val), "%d", sigp->hash_algo);
(void) snprintf(t, nb - (t - val), "%d", sigp->hash_algo);
t += strlen(t);
break;
}

View File

@ -885,7 +885,9 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln,
/* Permit libselinux to do the scriptlet exec. */
if (rpmtsSELinuxEnabled(ts) == 1) {
/*@-moduncon@*/
xx = rpm_execcon(0, argv[0], argv, environ);
/*@=moduncon@*/
if (xx != 0)
break;
}

View File

@ -78,7 +78,7 @@ typedef /*@abstract@*/ struct fileIndexEntry_s * fileIndexEntry;
* A file to be installed/removed.
*/
struct fileIndexEntry_s {
/*@dependent@*/ /*@null@*/
/*@dependent@*/ /*@relnull@*/
const char * baseName; /*!< File basename. */
int baseNameLen;
alNum pkgNum; /*!< Containing package index. */
@ -92,7 +92,7 @@ typedef /*@abstract@*/ struct dirInfo_s * dirInfo;
* A directory to be installed/removed.
*/
struct dirInfo_s {
/*@owned@*/ /*@null@*/
/*@owned@*/ /*@relnull@*/
const char * dirName; /*!< Directory path (+ trailing '/'). */
int dirNameLen; /*!< No. bytes in directory path. */
/*@owned@*/
@ -482,11 +482,12 @@ fprintf(stderr, "*** add %p[%d] 0x%x\n", al->list, pkgNum, tscolor);
for (dx = 0; dx < dc; dx++) {
(void) rpmfiSetDX(fi, dx);
DN = rpmfiDN(fi);
if (DN != NULL)
for (i = 0; i < dx; i++) {
const char * iDN;
(void) rpmfiSetDX(fi, i);
iDN = rpmfiDN(fi);
if (!strcmp(DN, iDN))
if (iDN != NULL && !strcmp(DN, iDN))
/*@innerbreak@*/ break;
}
dirUnique[dx] = i;

View File

@ -267,7 +267,7 @@ struct rpmQVKArguments_s {
rpmfileAttrs qva_fflags; /*!< Bit(s) to filter on attribute. */
/*@only@*/ /*@null@*/
rpmdbMatchIterator qva_mi; /*!< Match iterator on selected headers. */
/*@refccounted@*/ /*@null@*/
/*@refccounted@*/ /*@relnull@*/
rpmgi qva_gi; /*!< Generalized iterator on args. */
rpmRC qva_rc; /*!< Current return code. */

View File

@ -590,6 +590,7 @@ fileAction rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing)
* This order matters - we'd prefer to CREATE the file if at all
* possible in case something else (like the timestamp) has changed.
*/
memset(buffer, 0, sizeof(buffer));
if (dbWhat == REG) {
const unsigned char * omd5, * nmd5;
/* XXX avoid md5 on sparse /var/log/lastlog file. */
@ -606,7 +607,6 @@ fileAction rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing)
/*@=nullpass@*/
} else /* dbWhat == LINK */ {
const char * oFLink, * nFLink;
memset(buffer, 0, sizeof(buffer));
if (readlink(fn, buffer, sizeof(buffer) - 1) == -1)
return FA_CREATE; /* assume file has been removed */
oFLink = rpmfiFLink(ofi);

View File

@ -391,6 +391,7 @@ fprintf(stderr, "*** free pkt %p[%d] id %08x %08x\n", ts->pkpkt, ts->pkpktlen, p
}
mi = rpmdbFreeIterator(mi);
/*@-branchstate@*/
if (ix >= 0) {
char hnum[32];
sprintf(hnum, "h#%d", hx);
@ -399,6 +400,7 @@ fprintf(stderr, "*** free pkt %p[%d] id %08x %08x\n", ts->pkpkt, ts->pkpktlen, p
ts->pkpkt = _free(ts->pkpkt);
ts->pkpktlen = 0;
}
/*@=branchstate@*/
}
/* Try keyserver lookup. */
@ -411,6 +413,7 @@ fprintf(stderr, "*** free pkt %p[%d] id %08x %08x\n", ts->pkpkt, ts->pkpktlen, p
xx = (pgpReadPkts(fn,&ts->pkpkt,&ts->pkpktlen) != PGPARMOR_PUBKEY);
}
fn = _free(fn);
/*@-branchstate@*/
if (xx) {
ts->pkpkt = _free(ts->pkpkt);
ts->pkpktlen = 0;
@ -418,6 +421,7 @@ fprintf(stderr, "*** free pkt %p[%d] id %08x %08x\n", ts->pkpkt, ts->pkpktlen, p
/* Save new pubkey in local ts keyring for delayed import. */
pubkeysource = xstrdup("keyserver");
}
/*@=branchstate@*/
}
#ifdef NOTNOW
@ -439,7 +443,7 @@ fprintf(stderr, "*** free pkt %p[%d] id %08x %08x\n", ts->pkpkt, ts->pkpktlen, p
#endif
/* Was a matching pubkey found? */
if (ts->pkpkt == NULL || ts->pkpktlen <= 0)
if (ts->pkpkt == NULL || ts->pkpktlen == 0)
goto exit;
/* Retrieve parameters from pubkey packet(s). */
@ -965,6 +969,7 @@ const char * rpmtsRootDir(rpmts ts)
{
const char * rootDir = NULL;
/*@-branchstate@*/
if (ts != NULL && ts->rootDir != NULL) {
urltype ut = urlPath(ts->rootDir, &rootDir);
switch (ut) {
@ -981,6 +986,7 @@ const char * rpmtsRootDir(rpmts ts)
break;
}
}
/*@=branchstate@*/
return rootDir;
}

View File

@ -498,9 +498,11 @@ rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
* @param ts rpm transaction
* @return RPMRC_OK on success, RPMRC_NOKEY if not found
*/
/*@-exportlocal@*/
rpmRC rpmtsFindPubkey(rpmts ts)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState */;
/*@=exportlocal@*/
/** \ingroup rpmts
* Close the database used by the transaction to solve dependencies.

View File

@ -129,7 +129,9 @@ static inline rpmRC printSize(FD_t fd, int siglen, int pad, int datalen)
/* HACK: workaround for davRead wiring. */
if (fdno == 123456789) {
st.st_size = 0;
/*@-sizeoftype@*/
st.st_size -= sizeof(struct rpmlead)+siglen+pad+datalen;
/*@=sizeoftype@*/
} else if (fstat(fdno, &st) < 0)
return RPMRC_FAIL;

View File

@ -699,7 +699,9 @@ int rpmdbCheckSignals(void)
rpmdb db;
rpmdbMatchIterator mi;
/*@-abstract@*/ /* sigset_t is abstract type */
rpmMessage(RPMMESS_DEBUG, "Exiting on signal(0x%lx) ...\n", *((unsigned long *)&rpmsqCaught));
/*@=abstract@*/
/*@-branchstate@*/
while ((mi = rpmmiRock) != NULL) {

View File

@ -588,10 +588,12 @@ fprintf(stderr, "==> %s skipping target resource.\n", path);
checkout = ne_propset_value(set, &fetch_props[5]);
/*@=boundsread@*/
/*@-branchstate@*/
if (clength == NULL)
status = ne_propset_status(set, &fetch_props[0]);
if (modtime == NULL)
status = ne_propset_status(set, &fetch_props[1]);
/*@=branchstate@*/
if (newres->type == resr_normal && status != NULL) {
/* It's an error! */
@ -1532,12 +1534,14 @@ DIR * davOpendir(const char * path)
/* HACK: glob does not pass dirs with trailing '/' */
nb = strlen(path)+1;
/*@-branchstate@*/
if (path[nb-1] != '/') {
char * t = alloca(nb+1);
*t = '\0';
(void) stpcpy( stpcpy(t, path), "/");
path = t;
char * npath = alloca(nb+1);
*npath = '\0';
(void) stpcpy( stpcpy(npath, path), "/");
path = npath;
}
/*@=branchstate@*/
if (_dav_debug < 0)
fprintf(stderr, "*** davOpendir(%s)\n", path);

View File

@ -938,7 +938,7 @@ int pgpPrtComment(pgpTag tag, const byte *h, unsigned int hlen)
return 0;
}
int pgpPubkeyFingerprint(const byte * pkt, unsigned int pktlen,
int pgpPubkeyFingerprint(const byte * pkt, /*@unused@*/ unsigned int pktlen,
byte * keyid)
{
const byte *s = pkt;
@ -958,11 +958,13 @@ int pgpPubkeyFingerprint(const byte * pkt, unsigned int pktlen,
switch (v->pubkey_algo) {
case PGPPUBKEYALGO_RSA:
s += (pgpMpiLen(s) - 8);
memcpy(keyid, s, 8);
/*@-boundswrite@*/
memmove(keyid, s, 8);
/*@=boundswrite@*/
rc = 0;
break;
/*@innerbreak@*/ break;
default: /* TODO: md5 of mpi bodies (i.e. no length) */
break;
/*@innerbreak@*/ break;
}
} break;
case 4:
@ -975,11 +977,11 @@ int pgpPubkeyFingerprint(const byte * pkt, unsigned int pktlen,
case PGPPUBKEYALGO_RSA:
for (i = 0; i < 2; i++)
s += pgpMpiLen(s);
break;
/*@innerbreak@*/ break;
case PGPPUBKEYALGO_DSA:
for (i = 0; i < 4; i++)
s += pgpMpiLen(s);
break;
/*@innerbreak@*/ break;
}
ctx = rpmDigestInit(PGPHASHALGO_SHA1, RPMDIGEST_NONE);
@ -987,7 +989,9 @@ int pgpPubkeyFingerprint(const byte * pkt, unsigned int pktlen,
(void) rpmDigestFinal(ctx, (void **)&SHA1, NULL, 0);
s = SHA1 + 12;
memcpy(keyid, s, 8);
/*@-boundswrite@*/
memmove(keyid, s, 8);
/*@=boundswrite@*/
rc = 0;
if (SHA1) free(SHA1);
@ -1031,10 +1035,12 @@ int pgpPrtPkt(const byte *pkt, unsigned int pleft)
case PGPTAG_PUBLIC_KEY:
/* Get the public key fingerprint. */
if (_digp) {
/*@-mods@*/
if (!pgpPubkeyFingerprint(pkt, pktlen, _digp->signid))
_digp->saved |= PGPDIG_SAVED_ID;
else
memset(_digp->signid, 0, sizeof(_digp->signid));
/*@=mods@*/
}
/*@fallthrough@*/
case PGPTAG_PUBLIC_SUBKEY: