Start narrowing the scope of bounds annotations by adding more annotations.
CVS patchset: 5537
CVS date: 2002/07/02 23:54:35
+strict # lclint level
# --- in progress
-#+bounds
-+boundswrite
++bounds
+#+boundswrite
+slovak-fcns
-redecl
+strict # lclint level
# --- in progress
-#+bounds # 416
-+boundswrite # 169
++bounds
# --- not-yet at strict level
-exportconst # 4
/*@=boundswrite@*/
#ifndef ASM_AESSETIV
+/*@-boundsread@*/
int aesSetIV(aesParam* ap, const uint32* iv)
{
if (iv)
return 0;
}
+/*@=boundsread@*/
#endif
#define etfs(i) \
#endif
#ifndef ASM_AESCBCDECRYPT
+/*@-boundsread@*/
int aesCBCDecrypt(aesParam* ap, int count, uint32* dst, const uint32* src)
{
if (count > 0)
}
return 0;
}
+/*@=boundsread@*/
#endif
#define CRC24_INIT 0xb704ceL
#define CRC24_POLY 0x1864cfbL
+/*@-boundsread@*/
char * b64crc (const unsigned char * data, int ns)
{
const unsigned char *s = data;
ns = 3;
return b64encode(data, ns);
}
+/*@=boundsread@*/
/*@=internalglobs =modfilesys @*/
const char * b64decode_whitespace = B64DECODE_WHITESPACE;
return entropySourceList+index;
}
+/*@-boundsread@*/
const entropySource* entropySourceFind(const char* name)
{
register int index;
}
return (const entropySource*) 0;
}
+/*@=boundsread@*/
const entropySource* entropySourceDefault()
{
return (const entropySource*) 0;
}
+/*@-boundsread@*/
int entropyGatherNext(uint32* data, int size)
{
const char* selection = getenv("BEECRYPT_ENTROPY");
}
return -1;
}
+/*@=boundsread@*/
/*@-type@*/ /* FIX: cast? */
/*@observer@*/ /*@unchecked@*/
/*@=compmempass@*/
}
+/*@-boundsread@*/
const randomGenerator* randomGeneratorFind(const char* name)
{
register int index;
}
return (const randomGenerator*) 0;
}
+/*@=boundsread@*/
const randomGenerator* randomGeneratorDefault()
{
/*@=compmempass@*/
}
+/*@-boundsread@*/
const hashFunction* hashFunctionFind(const char* name)
{
register int index;
}
return (const hashFunction*) 0;
}
+/*@=boundsread@*/
int hashFunctionContextInit(hashFunctionContext* ctxt, const hashFunction* hash)
{
/*@=compmempass@*/
}
+/*@-boundsread@*/
const keyedHashFunction* keyedHashFunctionFind(const char* name)
{
register int index;
}
return (const keyedHashFunction*) 0;
}
+/*@=boundsread@*/
int keyedHashFunctionContextInit(keyedHashFunctionContext* ctxt, const keyedHashFunction* mac)
{
/*@=compmempass@*/
}
+/*@-boundsread@*/
const blockCipher* blockCipherFind(const char* name)
{
register int index;
return (const blockCipher*) 0;
}
+/*@=boundsread@*/
int blockCipherContextInit(blockCipherContext* ctxt, const blockCipher* ciph)
{
}
/*@=boundswrite@*/
+/*@-boundsread@*/
memchunk* pkcs5Unpad(int blockbytes, memchunk* tmp)
{
if (tmp)
return tmp;
/*@=temptrans@*/
}
+/*@=boundsread@*/
/*@-boundswrite@*/
memchunk* pkcs5PadCopy(int blockbytes, const memchunk* src)
const blockCipher blowfish = { "Blowfish", sizeof(blowfishParam), 8, 64, 448, 32, (blockCipherSetup) blowfishSetup, (blockCipherSetIV) blowfishSetIV, (blockCipherEncrypt) blowfishEncrypt, (blockCipherDecrypt) blowfishDecrypt, blowfishModes };
/*@=sizeoftype@*/
+/*@-boundsread@*/
int blowfishSetup(blowfishParam* bp, const uint32* key, int keybits, /*@unused@*/ cipherOperation op)
{
if (((keybits & 7) == 0) && (keybits >= 64) && (keybits <= 448))
}
return -1;
}
+/*@=boundsread@*/
#ifndef ASM_BLOWFISHSETIV
+/*@-boundsread@*/
int blowfishSetIV(blowfishParam* bp, const uint32* iv)
{
if (iv)
return 0;
}
+/*@=boundsread@*/
#endif
#ifndef ASM_BLOWFISHENCRYPT
#endif
#ifndef ASM_BLOWFISHCBCDECRYPT
+/*@-boundsread@*/
int blowfishCBCDecrypt(blowfishParam* bp, int count, uint32* dst, const uint32* src)
{
if (count > 0)
}
return 0;
}
+/*@=boundsread@*/
#endif
register int total = 0;
while (count-- > 0)
{
+/*@-boundsread@*/
register int rc = writeInt(*(i++), ofp);
+/*@=boundsread@*/
if (rc < 0)
break;
total += rc;
register int total = 0;
while (count-- > 0)
{
+/*@-boundsread@*/
register int rc = writeChar(*(c++), ofp);
+/*@=boundsread@*/
if (rc < 0)
break;
total += rc;
a += b;
#ifndef ASM_MD5PROCESS
+/*@-boundsread@*/
void md5Process(md5Param* p)
{
register uint32 a,b,c,d;
p->h[2] += c;
p->h[3] += d;
}
+/*@=boundsread@*/
#endif
/*@-boundswrite@*/
#endif
#ifndef ASM_MP32ODD
+/*@-boundsread@*/
int mp32odd(register uint32 xsize, register const uint32* xdata)
{
return (xdata[xsize-1] & 0x1);
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32EVEN
+/*@-boundsread@*/
int mp32even(register uint32 xsize, register const uint32* xdata)
{
return !(xdata[xsize-1] & 0x1);
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32Z
+/*@-boundsread@*/
int mp32z(register uint32 xsize, register const uint32* xdata)
{
while (xsize--)
return 0;
return 1;
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32NZ
+/*@-boundsread@*/
int mp32nz(register uint32 xsize, register const uint32* xdata)
{
while (xsize--)
return 1;
return 0;
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32EQ
+/*@-boundsread@*/
int mp32eq(register uint32 size, register const uint32* xdata, register const uint32* ydata)
{
while (size--)
return 1;
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32EQX
#endif
#ifndef ASM_MP32NE
+/*@-boundsread@*/
int mp32ne(register uint32 size, register const uint32* xdata, register const uint32* ydata)
{
while (size--)
return 0;
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32NEX
#endif
#ifndef ASM_MP32GT
+/*@-boundsread@*/
int mp32gt(register uint32 size, register const uint32* xdata, register const uint32* ydata)
{
while (size--)
}
return 0;
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32GTX
#endif
#ifndef ASM_MP32LT
+/*@-boundsread@*/
int mp32lt(register uint32 size, register const uint32* xdata, register const uint32* ydata)
{
while (size--)
}
return 0;
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32LTX
#endif
#ifndef ASM_MP32GE
+/*@-boundsread@*/
int mp32ge(register uint32 size, register const uint32* xdata, register const uint32* ydata)
{
while (size--)
}
return 1;
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32GEX
+/*@-boundsread@*/
int mp32gex(register uint32 xsize, register const uint32* xdata, register uint32 ysize, register const uint32* ydata)
{
if (xsize > ysize)
else
return mp32ge(xsize, xdata, ydata);
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32LE
+/*@-boundsread@*/
int mp32le(register uint32 size, register const uint32* xdata, register const uint32* ydata)
{
while (size--)
}
return 1;
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32LEX
+/*@-boundsread@*/
int mp32lex(register uint32 xsize, register const uint32* xdata, register uint32 ysize, register const uint32* ydata)
{
if (xsize > ysize)
else
return mp32le(xsize, xdata, ydata);
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32ISONE
+/*@-boundsread@*/
int mp32isone(register uint32 xsize, register const uint32* xdata)
{
xdata += xsize;
}
return 0;
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32ISTWO
+/*@-boundsread@*/
int mp32istwo(register uint32 xsize, register const uint32* xdata)
{
xdata += xsize;
}
return 0;
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32EQMONE
+/*@-boundsread@*/
int mp32eqmone(register uint32 size, register const uint32* xdata, register const uint32* ydata)
{
xdata += size;
}
return 0;
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32LEONE
+/*@-boundsread@*/
int mp32leone(register uint32 xsize, register const uint32* xdata)
{
xdata += xsize;
return 1;
}
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32MSBSET
int mp32msbset(/*@unused@*/ register uint32 xsize, register const uint32* xdata)
{
+/*@-boundsread@*/
return ((*xdata) & 0x80000000);
+/*@=boundsread@*/
}
#endif
#ifndef ASM_MP32LSBSET
int mp32lsbset(register uint32 xsize, register const uint32* xdata)
{
+/*@-boundsread@*/
return xdata[xsize-1] & 0x1;
+/*@=boundsread@*/
}
#endif
#ifndef ASM_MP32SETMSB
void mp32setmsb(/*@unused@*/ register uint32 xsize, register uint32* xdata)
{
+/*@-boundsread@*/
*xdata |= 0x80000000;
+/*@=boundsread@*/
}
#endif
#ifndef ASM_MP32SETLSB
void mp32setlsb(register uint32 xsize, register uint32* xdata)
{
+/*@-boundsread@*/
xdata[xsize-1] |= 0x00000001;
+/*@=boundsread@*/
}
#endif
#ifndef ASM_MP32CLRMSB
void mp32clrmsb(/*@unused@*/ register uint32 xsize, register uint32* xdata)
{
+/*@-boundsread@*/
*xdata &= 0x7fffffff;
+/*@=boundsread@*/
}
#endif
#ifndef ASM_MP32CLRLSB
void mp32clrlsb(register uint32 xsize, register uint32* xdata)
{
+/*@-boundsread@*/
xdata[xsize-1] &= 0xfffffffe;
+/*@=boundsread@*/
}
#endif
do
{
--size;
+/*@-boundsread@*/
xdata[size] ^= ydata[size];
+/*@=boundsread@*/
} while (size);
}
#endif
{
while (xsize)
{
+/*@-boundsread@*/
if (*xdata)
return xsize;
+/*@=boundsread@*/
xdata++;
xsize--;
}
void mp32sdivtwo(register uint32 xsize, register uint32* xdata)
{
mp32divtwo(xsize, xdata);
+/*@-boundsread@*/
if (*xdata & 0x40000000)
*xdata |= 0x80000000;
+/*@=boundsread@*/
}
#endif
while (i < xsize)
{
+/*@-boundsread@*/
register uint32 temp = xdata[i++];
+/*@=boundsread@*/
if (temp)
{
while (!(temp & 0x80000000))
while (xsize--)
{
+/*@-boundsread@*/
register uint32 temp = xdata[xsize];
+/*@=boundsread@*/
if (temp)
{
while (!(temp & 0x1))
*/
#ifndef ASM_MP32PRINT
+/*@-boundsread@*/
void mp32print(register FILE * fp, register uint32 xsize, register const uint32* xdata)
{
if (xdata == NULL)
fprintf(fp, "%08x", *(xdata++));
(void) fflush(fp);
}
+/*@=boundsread@*/
#endif
#ifndef ASM_MP32PRINTLN
+/*@-boundsread@*/
void mp32println(register FILE * fp, register uint32 xsize, register const uint32* xdata)
{
if (xdata == NULL)
fprintf(fp, "\n");
(void) fflush(fp);
}
+/*@=boundsread@*/
#endif
* mp32bpowmod_w
* needs workspace of 4*size+2 words
*/
+/*@-boundsread@*/
void mp32bpowmod_w(const mp32barrett* b, uint32 xsize, const uint32* xdata, uint32 psize, const uint32* pdata, uint32* result, uint32* wksp)
{
/*
/*@=nullpass@*/
}
}
+/*@=boundsread@*/
+/*@-boundsread@*/
void mp32bpowmodsld_w(const mp32barrett* b, const uint32* slide, uint32 psize, const uint32* pdata, uint32* result, uint32* wksp)
{
/*
}
/*@=charindex@*/
}
+/*@=boundsread@*/
/**
* mp32btwopowmod_w
* needs workspace of (4*size+2) words
*/
+/*@-boundsread@*/
void mp32btwopowmod_w(const mp32barrett* b, uint32 psize, const uint32* pdata, uint32* result, uint32* wksp)
{
/*
}
}
}
+/*@=boundsread@*/
#ifdef DYING
/**
/**
* Computes the inverse (modulo b) of x, and returns 1 if x was invertible.
*/
+/*@-boundsread@*/
int mp32binv_w(const mp32barrett* b, uint32 xsize, const uint32* xdata, uint32* result, uint32* wksp)
{
uint32 ysize = b->size+1;
return 1;
}
+/*@=boundsread@*/
#endif
/**
* needs workspace of (7*size+2) words
*/
+/*@-boundsread@*/
int mp32bpprime_w(const mp32barrett* b, randomGeneratorContext* rc, int t, uint32* wksp)
{
/*
return 0;
}
+/*@=boundsread@*/
void mp32bnrnd(const mp32barrett* b, randomGeneratorContext* rc, mp32number* result)
{
/**
*/
+/*@-boundsread@*/
static void mp32prndbits(mp32barrett* p, uint8 msbclr, uint8 lsbset, randomGeneratorContext* rc)
/*@modifies p @*/
{
p->modl[size] |= (((uint32)0xffffffff) >> (32 - lsbset));
/*@=shiftnegative@*/
}
+/*@=boundsread@*/
/**
* mp32psppdiv_w
* needs workspace of (3*size) words
*/
+/*@-boundsread@*/
static int mp32psppdiv_w(const mp32barrett* p, /*@out@*/ uint32* wksp)
/*@globals mp32spprod @*/
/*@modifies wksp @*/
return mp32isone(size, wksp);
}
+/*@=boundsread@*/
/**
* mp32pmilrabtwo_w
/**
*/
+/*@-boundsread@*/
static void mtprngReload(mtprngParam* mp)
/*@modifies mp @*/
{
mp->left = N;
mp->nextw = mp->state;
}
+/*@=boundsread@*/
int mtprngSetup(mtprngParam* mp)
{
b = ROTR32(b, 2)
#ifndef ASM_SHA1PROCESS
+/*@-boundsread@*/
void sha1Process(register sha1Param *p)
{
register uint32 a, b, c, d, e;
p->h[3] += d;
p->h[4] += e;
}
+/*@=boundsread@*/
#endif
/*@-boundswrite@*/
d += temp
#ifndef ASM_SHA256PROCESS
+/*@-boundsread@*/
void sha256Process(register sha256Param *p)
{
register uint32 a, b, c, d, e, f, g, h, temp;
p->h[6] += g;
p->h[7] += h;
}
+/*@=boundsread@*/
#endif
/*@-boundswrite@*/
case ':':
checking = 0;
/*@switchbreak@*/ break;
+/*@-boundsread@*/
default:
if (checking && !(isprint(*s) || isspace(*s))) return 0;
/*@switchbreak@*/ break;
+/*@=boundsread@*/
}
}
return 1;
+strict # lclint level
# --- in progress
-#+bounds # 281
-+boundswrite # 132
++bounds
# --- +partial artifacts
-declundef
if (_build_debug)
fprintf(stderr, "*** rootURL %s buildDirURL %s\n", rootURL, buildDirURL);
+/*@-boundsread@*/
if (buildDirURL && buildDirURL[0] != '/' &&
(urlSplit(buildDirURL, &u) != 0)) {
rc = RPMERR_SCRIPT;
goto exit;
}
+/*@=boundsread@*/
if (u != NULL) {
switch (u->urltype) {
case URL_IS_FTP:
/*@-mods@*/
errno = 0;
/*@=mods@*/
+/*@-boundsread@*/
(void) execvp(argv[0], (char *const *)argv);
+/*@=boundsread@*/
rpmError(RPMERR_SCRIPT, _("Exec of %s failed (%s): %s\n"),
scriptName, name, strerror(errno));
/* packaging on the first run, and skip RMSOURCE altogether */
if (spec->BASpecs != NULL)
for (x = 0; x < spec->BACount; x++) {
+/*@-boundsread@*/
if ((rc = buildSpec(spec->BASpecs[x],
(what & ~RPMBUILD_RMSOURCE) |
(x ? 0 : (what & RPMBUILD_PACKAGESOURCE)),
test))) {
goto exit;
}
+/*@=boundsread@*/
}
} else {
if ((what & RPMBUILD_PREP) &&
result = v->data.i != 0;
break;
case VALUE_TYPE_STRING:
+/*@-boundsread@*/
result = v->data.s[0] != '\0';
+/*@=boundsread@*/
break;
default:
break;
x = hge(h, RPMTAG_OLDFILENAMES, &fnt, (void **) &files, &count);
x = hge(h, RPMTAG_FILEMTIMES, NULL, (void **) &mtime, NULL);
+/*@-boundsread@*/
for (x = 0; x < count; x++) {
if ((currentTime - mtime[x]) > tc)
rpmMessage(RPMMESS_WARNING, _("TIMECHECK failure: %s\n"), files[x]);
}
files = hfd(files, fnt);
+/*@=boundsread@*/
}
/**
{
static int_32 buildTime[1];
+/*@-boundsread@*/
if (buildTime[0] == 0)
buildTime[0] = (int_32) time(NULL);
+/*@=boundsread@*/
return buildTime;
}
FD_t cfd;
int rc, ec;
+/*@-boundsread@*/
{ const char *fmode = rpmExpand(fmodeMacro, NULL);
if (!(fmode && fmode[0] == 'w'))
fmode = xstrdup("w9.gzdio");
/*@=nullpass@*/
fmode = _free(fmode);
}
+/*@=boundsread@*/
if (cfd == NULL)
return 1;
{
char *res = s;
+/*@-boundsread@*/
while (*s != '\0') {
if (! xisspace(*s))
res = s;
s++;
}
+/*@=boundsread@*/
/*@-temptrans -retalias@*/
return res;
if (!hge(h, tag, &type, (void **)&names, &count))
return -1;
+/*@-boundsread@*/
while (count--) {
if (!xstrcasecmp(names[count], name))
break;
}
names = hfd(names, type);
+/*@=boundsread@*/
return (count >= 0 ? 1 : 0);
}
int res = 0;
rpmTag * p;
+/*@-boundsread@*/
for (p = requiredTags; *p != 0; p++) {
if (!headerIsEntry(h, *p)) {
rpmError(RPMERR_BADSPEC,
res = 1;
}
}
+/*@=boundsread@*/
return res;
}
for (ot = optionalTags; ot->ot_mac != NULL; ot++) {
if (!headerIsEntry(h, ot->ot_tag)) {
+/*@-boundsread@*/
const char *val = rpmExpand(ot->ot_mac, NULL);
if (val && *val != '%')
(void) headerAddEntry(h, ot->ot_tag, RPM_STRING_TYPE, (void *)val, 1);
val = _free(val);
+/*@=boundsread@*/
}
}
}
for (fm = fixmacs; *fm; fm++) {
const char *fix;
+/*@-boundsread@*/
/*@-nullpass@*/
fix = rpmExpand(*fm, " .", NULL);
/*@=nullpass@*/
if (fix && *fix != '%')
appendLineStringBuf(spec->prep, fix);
fix = _free(fix);
+/*@=boundsread@*/
}
}
/*@-usereleased@*/
for (lines = saveLines; *lines; lines++) {
res = 0;
+/*@-boundsread@*/
if (! strncmp(*lines, "%setup", sizeof("%setup")-1)) {
res = doSetupMacro(spec, *lines);
} else if (! strncmp(*lines, "%patch", sizeof("%patch")-1)) {
} else {
appendLineStringBuf(spec->prep, *lines);
}
+/*@=boundsread@*/
if (res && !spec->force) {
freeSplitString(saveLines);
sb = freeStringBuf(sb);
break;
}
+/*@-boundsread@*/
for (r = field; *r != '\0'; r = re) {
SKIPWHITE(r);
if (*r == '\0')
version = _free(version);
}
+/*@=boundsread@*/
return 0;
}
{
struct PartRec *p;
+/*@-boundsread@*/
if (partList[0].len == 0)
initParts(partList);
+/*@=boundsread@*/
for (p = partList; p->token != NULL; p++) {
char c;
if (xstrncasecmp(line, p->token, p->len))
continue;
+/*@-boundsread@*/
c = *(line + p->len);
+/*@=boundsread@*/
if (c == '\0' || xisspace(c))
break;
}
size_t toklen = strlen(token);
int rc = 0;
+/*@-boundsread@*/
while ( *(b = be) != '\0' ) {
SKIPSPACE(b);
be = b;
rc = 1;
break;
}
+/*@=boundsread@*/
return rc;
}
if (indextag)
xx = hge(h, indextag, NULL, (void **) &indexes, NULL);
+/*@-boundsread@*/
while (len > 0) {
len--;
if (strcmp(names[len], depName))
break;
}
+/*@=boundsread@*/
names = hfd(names, dnt);
versions = hfd(versions, dvt);
if (duplicate)
return NULL;
}
+/*@-boundsread@*/
int parseNoSource(Spec spec, const char * field, int tag)
{
const char *f, *fe;
return 0;
}
+/*@=boundsread@*/
/*@-boundswrite@*/
int addSource(Spec spec, Package pkg, const char *field, int tag)
+strict # lclint level
# --- in progress
++bounds
+slovak-fcns
-redecl
-/*@-boundsread@*/
/** \ingroup payload
* \file lib/cpio.c
* Handle cpio payloads within rpm packages.
if ( (end - phys) != sizeof(phys) ) return CPIOERR_BAD_HEADER;
#define SET_NUM_FIELD(phys, val, space) \
sprintf(space, "%8.8lx", (unsigned long) (val)); \
- memcpy(phys, space, 8);
+ /*@-boundsread@*/ \
+ memcpy(phys, space, 8) \
+ /*@=boundsread@*/
int cpioTrailerWrite(FSM_t fsm)
{
/*@=branchstate@*/
return msg;
}
-/*@=boundsread@*/
-/*@-boundsread@*/
/** \ingroup rpmts
* \file lib/depends.c
*/
* @param b 2nd instance address
* @return result of comparison
*/
-static int intcmp(const void * a, const void * b) /*@*/
+static int intcmp(const void * a, const void * b)
+ /*@requires maxRead(a) == 0 /\ maxRead(b) == 0 @*/
{
const int * aptr = a;
const int * bptr = b;
goto exit;
}
+/*@-boundsread@*/
{ rpmdbMatchIterator mi;
Header h2;
}
mi = rpmdbFreeIterator(mi);
}
+/*@=boundsread@*/
obsoletes = rpmdsLink(rpmteDS(p, RPMTAG_OBSOLETENAME), "Obsoletes");
obsoletes = rpmdsInit(obsoletes);
return ec;
}
-#ifdef DYING
-void rpmtsAvailablePackage(rpmts ts, Header h, fnpyKey key)
-{
- int scareMem = 0;
- rpmds provides = rpmdsNew(h, RPMTAG_PROVIDENAME, scareMem);
- rpmfi fi = rpmfiNew(ts, NULL, h, RPMTAG_BASENAMES, scareMem);
-
- /* XXX FIXME: return code RPMAL_NOMATCH is error */
- (void) rpmalAdd(&ts->availablePackages, RPMAL_NOMATCH, key,
- provides, fi);
- fi = rpmfiFree(fi, 1);
- provides = rpmdsFree(provides);
-}
-#endif
-
int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset)
{
return removePackage(ts, h, dboffset, RPMAL_NOMATCH);
/*@-observertrans -mayaliasunique@*/
while ((start = strstr(rcProvidesString, Name))) {
/*@=observertrans =mayaliasunique@*/
+/*@-boundsread@*/
if (xisspace(start[i]) || start[i] == '\0' || start[i] == ',') {
rpmdsNotify(dep, _("(rpmrc provides)"), rc);
goto exit;
}
+/*@=boundsread@*/
rcProvidesString = start + 1;
}
}
/* XXX only the installer does not have the database open here. */
if (rpmtsGetRdb(ts) != NULL) {
+/*@-boundsread@*/
if (Name[0] == '/') {
/* depFlags better be 0! */
}
mi = rpmdbFreeIterator(mi);
}
+/*@=boundsread@*/
mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, Name, 0);
(void) rpmdbPruneIterator(mi,
/*
* Search for an unsatisfied dependency.
*/
+/*@-boundsread@*/
if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOSUGGEST) && ts->solve != NULL)
xx = (*ts->solve) (ts, dep);
+/*@=boundsread@*/
unsatisfied:
rc = 1; /* dependency is unsatisfied */
* @param q predecessor element (i.e. with Provides: )
* @return 1 if dependency is to be ignored.
*/
+/*@-boundsread@*/
static int ignoreDep(const rpmte p, const rpmte q)
/*@globals badDeps, badDepsInitialized @*/
/*@modifies badDeps, badDepsInitialized @*/
return 0;
/*@=compdef@*/
}
+/*@=boundsread@*/
/**
* Recursively mark all nodes with their predecessors.
/* Avoid redundant relations. */
/* XXX TODO: add control bit. */
+/*@-boundsread@*/
if (selected[i] != 0)
return 0;
+/*@=boundsread@*/
/*@-boundswrite@*/
selected[i] = 1;
/*@=boundswrite@*/
/*@=branchstate@*/
return rc;
}
-/*@=boundsread@*/
-/*@-boundsread@*/
/** \ingroup header
* \file lib/formats.c
*/
* @return formatted string
*/
static /*@only@*/ char * triggertypeFormat(int_32 type, const void * data,
- /*@unused@*/ char * formatPrefix, /*@unused@*/ int padding,
- /*@unused@*/ int element) /*@*/
+ /*@unused@*/ char * formatPrefix, /*@unused@*/ int padding,
+ /*@unused@*/ int element)
+ /*@requires maxRead(data) >= 0 @*/
{
const int_32 * item = data;
char * val;
* @param element (unused)
* @return formatted string
*/
-static /*@only@*/ char * permsFormat(int_32 type, const void * data, char * formatPrefix,
- int padding, /*@unused@*/ int element)
- /*@modifies formatPrefix @*/
+static /*@only@*/ char * permsFormat(int_32 type, const void * data,
+ char * formatPrefix, int padding, /*@unused@*/ int element)
+ /*@modifies formatPrefix @*/
+ /*@requires maxRead(data) >= 0 @*/
{
char * val;
char * buf;
-/*@-boundswrite@*/
if (type != RPM_INT32_TYPE) {
val = xstrdup(_("(not a number)"));
} else {
val = xmalloc(15 + padding);
+/*@-boundswrite@*/
strcat(formatPrefix, "s");
+/*@=boundswrite@*/
buf = rpmPermsString(*((int_32 *) data));
/*@-formatconst@*/
sprintf(val, formatPrefix, buf);
/*@=formatconst@*/
buf = _free(buf);
}
-/*@=boundswrite@*/
return val;
}
* @return formatted string
*/
static /*@only@*/ char * fflagsFormat(int_32 type, const void * data,
- char * formatPrefix, int padding, /*@unused@*/ int element)
- /*@modifies formatPrefix @*/
+ char * formatPrefix, int padding, /*@unused@*/ int element)
+ /*@modifies formatPrefix @*/
+ /*@requires maxRead(data) >= 0 @*/
{
char * val;
char buf[15];
int anint = *((int_32 *) data);
-/*@-boundswrite@*/
if (type != RPM_INT32_TYPE) {
val = xstrdup(_("(not a number)"));
} else {
buf[0] = '\0';
+/*@-boundswrite@*/
if (anint & RPMFILE_DOC)
strcat(buf, "d");
if (anint & RPMFILE_CONFIG)
strcat(buf, "l");
if (anint & RPMFILE_README)
strcat(buf, "r");
+/*@=boundswrite@*/
val = xmalloc(5 + padding);
+/*@-boundswrite@*/
strcat(formatPrefix, "s");
+/*@=boundswrite@*/
/*@-formatconst@*/
sprintf(val, formatPrefix, buf);
/*@=formatconst@*/
}
-/*@=boundswrite@*/
return val;
}
{
char * val;
-/*@-boundswrite@*/
if (type != RPM_BIN_TYPE) {
val = xstrdup(_("(not a blob)"));
} else {
int lc;
int nt = ((element + 2) / 3) * 4;
+/*@-boundswrite@*/
/*@-globs@*/
/* Add additional bytes necessary for eol string(s). */
if (b64encode_chars_per_line > 0 && b64encode_eolstr != NULL) {
t = stpcpy(t, enc);
enc = _free(enc);
}
- }
/*@=boundswrite@*/
+ }
return val;
}
* @return formatted string
*/
static /*@only@*/ char * depflagsFormat(int_32 type, const void * data,
- char * formatPrefix, int padding, /*@unused@*/ int element)
- /*@modifies formatPrefix @*/
+ char * formatPrefix, int padding, /*@unused@*/ int element)
+ /*@modifies formatPrefix @*/
+ /*@requires maxRead(data) >= 0 @*/
{
char * val;
char buf[10];
int anint = *((int_32 *) data);
-/*@-boundswrite@*/
if (type != RPM_INT32_TYPE) {
val = xstrdup(_("(not a number)"));
} else {
buf[0] = '\0';
+/*@-boundswrite@*/
if (anint & RPMSENSE_LESS)
strcat(buf, "<");
if (anint & RPMSENSE_GREATER)
strcat(buf, ">");
if (anint & RPMSENSE_EQUAL)
strcat(buf, "=");
+/*@=boundswrite@*/
val = xmalloc(5 + padding);
+/*@-boundswrite@*/
strcat(formatPrefix, "s");
+/*@=boundswrite@*/
/*@-formatconst@*/
sprintf(val, formatPrefix, buf);
/*@=formatconst@*/
}
-/*@=boundswrite@*/
return val;
}
/*@globals fileSystem, internalState @*/
/*@modifies *type, *data, *count, *freeData,
fileSystem, internalState @*/
+ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0
+ /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/
{
const char ** list;
+/*@-boundswrite@*/
if (rpmGetFilesystemList(&list, count)) {
return 1;
}
+/*@=boundswrite@*/
-/*@-boundswrite@*/
*type = RPM_STRING_ARRAY_TYPE;
*((const char ***) data) = list;
*freeData = 0;
-/*@=boundswrite@*/
return 0;
}
* @return 0 on success
*/
static int instprefixTag(Header h, /*@null@*/ /*@out@*/ rpmTagType * type,
- /*@null@*/ /*@out@*/ const void ** data,
- /*@null@*/ /*@out@*/ int_32 * count,
- /*@null@*/ /*@out@*/ int * freeData)
- /*@modifies *type, *data, *freeData @*/
+ /*@null@*/ /*@out@*/ const void ** data,
+ /*@null@*/ /*@out@*/ int_32 * count,
+ /*@null@*/ /*@out@*/ int * freeData)
+ /*@modifies *type, *data, *freeData @*/
+ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0
+ /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/
{
HGE_t hge = (HGE_t)headerGetEntryMinMemory;
HFD_t hfd = headerFreeData;
rpmTagType ipt;
char ** array;
-/*@-boundswrite@*/
if (hge(h, RPMTAG_INSTALLPREFIX, type, (void **)data, count)) {
if (freeData) *freeData = 0;
return 0;
} else if (hge(h, RPMTAG_INSTPREFIXES, &ipt, (void **) &array, count)) {
+/*@-boundsread@*/
if (data) *data = xstrdup(array[0]);
+/*@=boundsread@*/
if (freeData) *freeData = 1;
if (type) *type = RPM_STRING_TYPE;
array = hfd(array, ipt);
return 0;
}
-/*@=boundswrite@*/
return 1;
}
fileSystem, internalState @*/
/*@modifies *type, *data, *count, *freeData, rpmGlobalMacroContext,
fileSystem, internalState @*/
+ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0
+ /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/
{
HGE_t hge = (HGE_t)headerGetEntryMinMemory;
const char ** filenames;
rpmBuildFileList(h, &filenames, &numFiles);
}
+/*@-boundswrite@*/
if (rpmGetFilesystemList(NULL, count)) {
return 1;
}
+/*@=boundswrite@*/
-/*@-boundswrite@*/
*type = RPM_INT32_TYPE;
*freeData = 1;
return 0;
}
+/*@-boundswrite@*/
if (rpmGetFilesystemUsage(filenames, filesizes, numFiles, &usages, 0))
return 1;
+/*@=boundswrite@*/
*data = usages;
-/*@=boundswrite@*/
filenames = _free(filenames);
* @retval freeData address of data-was-malloc'ed indicator
* @return 0 on success
*/
-/*@-bounds@*/
+/*@-bounds@*/ /* LCL: segfault */
static int triggercondsTag(Header h, /*@out@*/ rpmTagType * type,
- /*@out@*/ const void ** data, /*@out@*/ int_32 * count,
- /*@out@*/ int * freeData)
- /*@modifies *type, *data, *count, *freeData @*/
+ /*@out@*/ const void ** data, /*@out@*/ int_32 * count,
+ /*@out@*/ int * freeData)
+ /*@modifies *type, *data, *count, *freeData @*/
+ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0
+ /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/
{
HGE_t hge = (HGE_t)headerGetEntryMinMemory;
HFD_t hfd = headerFreeData;
* @retval freeData address of data-was-malloc'ed indicator
* @return 0 on success
*/
-/*@-bounds@*/
static int triggertypeTag(Header h, /*@out@*/ rpmTagType * type,
- /*@out@*/ const void ** data, /*@out@*/ int_32 * count,
- /*@out@*/ int * freeData)
- /*@modifies *type, *data, *count, *freeData @*/
+ /*@out@*/ const void ** data, /*@out@*/ int_32 * count,
+ /*@out@*/ int * freeData)
+ /*@modifies *type, *data, *count, *freeData @*/
+ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0
+ /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/
{
HGE_t hge = (HGE_t)headerGetEntryMinMemory;
HFD_t hfd = headerFreeData;
return 0;
}
-/*@=bounds@*/
/**
* Retrieve file paths.
* @return 0 on success
*/
static int filenamesTag(Header h, /*@out@*/ rpmTagType * type,
- /*@out@*/ const void ** data, /*@out@*/ int_32 * count,
- /*@out@*/ int * freeData)
- /*@modifies *type, *data, *count, *freeData @*/
+ /*@out@*/ const void ** data, /*@out@*/ int_32 * count,
+ /*@out@*/ int * freeData)
+ /*@modifies *type, *data, *count, *freeData @*/
+ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0
+ /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/
{
*type = RPM_STRING_ARRAY_TYPE;
rpmBuildFileList(h, (const char ***) data, count);
-/*@-boundswrite@*/
*freeData = 1;
*freeData = 0; /* XXX WTFO? */
-/*@=boundswrite@*/
return 0;
}
/*@out@*/ int * freeData)
/*@globals rpmGlobalMacroContext @*/
/*@modifies *type, *data, *count, *freeData, rpmGlobalMacroContext @*/
+ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0
+ /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/
{
HGE_t hge = (HGE_t)headerGetEntryMinMemory;
char * dstring = rpmExpand(_macro_i18ndomains, NULL);
int rc;
-/*@-boundswrite@*/
*type = RPM_STRING_TYPE;
*data = NULL;
*count = 0;
*freeData = 0;
-/*@=boundswrite@*/
if (dstring && *dstring) {
char *domain, *de;
unsetenv(language);
/*@i@*/ ++_nl_msg_cat_cntr;
-/*@-boundswrite@*/
if (domain && msgid) {
*data = /*@-unrecog@*/ dgettext(domain, msgid) /*@=unrecog@*/;
*data = xstrdup(*data); /* XXX xstrdup has side effects. */
*count = 1;
*freeData = 1;
}
-/*@=boundswrite@*/
dstring = _free(dstring);
if (*data)
return 0;
rc = hge(h, tag, type, (void **)data, count);
-/*@-boundswrite@*/
if (rc && (*data) != NULL) {
*data = xstrdup(*data);
*freeData = 1;
*freeData = 0;
*data = NULL;
*count = 0;
-/*@=boundswrite@*/
return 1;
}
/*@out@*/ int * freeData)
/*@globals rpmGlobalMacroContext @*/
/*@modifies *type, *data, *count, *freeData, rpmGlobalMacroContext @*/
+ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0
+ /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/
{
return i18nTag(h, RPMTAG_SUMMARY, type, data, count, freeData);
}
/*@out@*/ int * freeData)
/*@globals rpmGlobalMacroContext @*/
/*@modifies *type, *data, *count, *freeData, rpmGlobalMacroContext @*/
+ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0
+ /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/
{
return i18nTag(h, RPMTAG_DESCRIPTION, type, data, count, freeData);
}
/*@out@*/ int * freeData)
/*@globals rpmGlobalMacroContext @*/
/*@modifies *type, *data, *count, *freeData, rpmGlobalMacroContext @*/
+ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0
+ /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/
{
return i18nTag(h, RPMTAG_GROUP, type, data, count, freeData);
}
{ HEADER_EXT_MORE, NULL, { (void *) headerDefaultFormats } }
} ;
/*@=type@*/
-/*@=boundsread@*/
-/*@-boundsread@*/
/*@-mods@*/
/**
* \file lib/fs.c
/*@-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@*/
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);
}
/*@=usereleased =onlytrans@*/
/*@=mods@*/
-/*@=boundsread@*/
-/*@-boundsread@*/
/** \ingroup payload
* \file lib/fsm.c
* File state machine to handle a payload from a package.
/** \ingroup payload
*/
+/*@-boundsread@*/
static int cpioStrCmp(const void * a, const void * b)
/*@*/
{
return strcmp(afn, bfn);
}
+/*@=boundsread@*/
/** \ingroup payload
* Locate archive path in file info.
* @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 @*/
{
}
return ix;
}
+/*@=boundsread@*/
/** \ingroup payload
* Directory name iterator.
* @param reverse traverse directory names in reverse order?
* @return directory name iterator
*/
+/*@-boundsread@*/
/*@-usereleased@*/
static /*@only@*/ void * dnlInitIterator(/*@special@*/ const FSM_t fsm,
int reverse)
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@*/ const char * dnlNextIterator(/*@null@*/ DNLI_t dnli)
/*@modifies dnli @*/
{
}
return dn;
}
+/*@=boundsread@*/
/** \ingroup payload
* Save hard link in chain.
* @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 @*/
rc = fsmStage(fsm, FSM_MAP);
return rc;
}
+/*@=boundsread@*/
/** \ingroup payload
* Destroy set of hard links.
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);
/* 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) {
* @param fsm file state machine data
* @return 0 on success
*/
+/*@-boundsread@*/
static int fsmMakeLinks(/*@special@*/ FSM_t fsm)
/*@uses fsm->path, fsm->opath, fsm->nsuffix, fsm->ix, fsm->li @*/
/*@globals fileSystem@*/
fsm->opath = opath;
return ec;
}
+/*@=boundsread@*/
/** \ingroup payload
* Commit hard linked file set atomically.
((_x)[sizeof("/dev/log")-1] == '\0' || \
(_x)[sizeof("/dev/log")-1] == ';'))
+/*@-boundsread@*/
/*@-compmempass@*/
int fsmStage(FSM_t fsm, fileStage stage)
{
return rc;
}
/*@=compmempass@*/
+/*@=boundsread@*/
/*@obserever@*/ const char *const fileActionString(fileAction a)
{
}
/*@noteached@*/
}
-/*@=boundsread@*/
-/*@-boundsread@*/
/**
* \file lib/misc.c
*/
}
/*@notreached@*/
}
-/*@=boundsread@*/
-/*@-boundsread@*/
/** \ingroup header
* \file lib/package.c
*/
if (keyids != NULL)
for (i = 0; i < nkeyids; i++) {
+/*@-boundsread@*/
if (keyid == keyids[i])
return 1;
+/*@=boundsread@*/
}
keyids = xrealloc(keyids, (nkeyids + 1) * sizeof(*keyids));
goto exit;
}
+/*@-boundsread@*/
if (l->magic[0] != RPMLEAD_MAGIC0 || l->magic[1] != RPMLEAD_MAGIC1
|| l->magic[2] != RPMLEAD_MAGIC2 || l->magic[3] != RPMLEAD_MAGIC3) {
rc = RPMRC_NOTFOUND;
goto exit;
}
+/*@=boundsread@*/
switch (l->major) {
case 1:
sig = rpmFreeSignature(sig);
return rc;
}
-/*@=boundsread@*/
-/*@-boundsread@*/
/** \ingroup rpmcli
* \file lib/poptALL.c
* Popt tables for all rpm modes.
/*@=globs =mods@*/
#if !defined(__LCLINT__)
- (void)setlocale(LC_ALL, "" );
+ (void) setlocale(LC_ALL, "" );
- (void)bindtextdomain(PACKAGE, LOCALEDIR);
- (void)textdomain(PACKAGE);
+ (void) bindtextdomain(PACKAGE, LOCALEDIR);
+ (void) textdomain(PACKAGE);
#endif
rpmSetVerbosity(RPMMESS_NORMAL);
return optCon;
}
/*@=globstate@*/
-
-/*@=boundsread@*/
-/*@-boundsread@*/
/** \ingroup rpmcli
* \file lib/poptI.c
* Popt tables for install modes.
POPT_TABLEEND
};
/*@=bitwisesigned =compmempass @*/
-/*@=boundsread@*/
-/*@-bounds@*/
/** \ingroup rpmcli
* \file lib/poptQV.c
* Popt tables for query/verify modes.
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);
POPT_TABLEEND
};
-/*@=bounds@*/
-/*@-boundsread@*/
/** \ingroup rpmts payload
* \file lib/psm.c
* Package state machine to handle a package from a transaction set.
else if (!epochOne && epochTwo)
return -1;
else if (epochOne && epochTwo) {
+/*@-boundsread@*/
if (*epochOne < *epochTwo)
return -1;
else if (*epochOne > *epochTwo)
return 1;
+/*@=boundsread@*/
}
rc = headerGetEntry(first, RPMTAG_VERSION, NULL, (void **) &one, NULL);
continue;
switch (type) {
case RPM_INT32_TYPE:
+/*@-boundsread@*/
sprintf(numbuf, "%d", *body.i32p);
+/*@=boundsread@*/
addMacro(NULL, tagm->macroname, NULL, numbuf, -1);
/*@switchbreak@*/ break;
case RPM_STRING_TYPE:
/*@=nullstate@*/
}
/*@=nullpass@*/
-/*@=boundsread@*/
* @retval num address of number of file systems (or NULL)
* @return 0 on success, 1 on error
*/
+/*@-incondefs@*/
int rpmGetFilesystemList( /*@null@*/ /*@out@*/ const char *** listptr,
/*@null@*/ /*@out@*/ int * num)
/*@globals fileSystem, internalState @*/
- /*@modifies *listptr, *num, fileSystem, internalState @*/;
+ /*@modifies *listptr, *num, fileSystem, internalState @*/
+ /*@requires maxSet(listptr) >= 0 /\ maxSet(num) >= 0 @*/
+ /*@ensures maxRead(num) == 0 @*/;
+/*@=incondefs@*/
/**
* Determine per-file system usage for a list of files.
* @param flags (unused)
* @return 0 on success, 1 on error
*/
+/*@-incondefs@*/
int rpmGetFilesystemUsage(const char ** fileList, int_32 * fssizes,
int numFiles, /*@null@*/ /*@out@*/ uint_32 ** usagesPtr,
int flags)
/*@globals rpmGlobalMacroContext,
fileSystem, internalState @*/
/*@modifies *usagesPtr, rpmGlobalMacroContext,
- fileSystem, internalState @*/;
+ fileSystem, internalState @*/
+ /*@requires maxSet(fileList) >= 0 /\ maxSet(fssizes) == 0
+ /\ maxSet(usagesPtr) >= 0 @*/
+ /*@ensures maxRead(usagesPtr) == 0 @*/;
+/*@=incondefs@*/
/* ==================================================================== */
/** \name RPMEIU */
-/*@-boundsread@*/
/** \ingroup rpmts
* \file lib/transaction.c
*/
/**
*/
+/*@-boundsread@*/
static fileAction decideFileFate(const rpmts ts,
const rpmfi ofi, rpmfi nfi)
/*@globals fileSystem @*/
*/
return save;
}
+/*@=boundsread@*/
/**
*/
+/*@-boundsread@*/
static int filecmp(rpmfi afi, rpmfi bfi)
/*@*/
{
return 0;
}
+/*@=boundsread@*/
/**
*/
return 0;
/*@=nullstate@*/
}
-/*@=boundsread@*/
+strict # lclint level
# --- in progress
-#+bounds # 56
-+boundswrite # 40
++bounds
# --- +partial artifacts
-exportlocal # 14
if ((con->os - con->optionStack + 1) == POPT_OPTION_DEPTH)
return POPT_ERROR_OPTSTOODEEP;
+/*@-boundsread@*/
if (nextCharArg && *nextCharArg)
con->os->nextCharArg = nextCharArg;
+/*@=boundsread@*/
con->os++;
con->os->next = 0;
}
helpLength = strlen(help);
+/*@-boundsread@*/
while (helpLength > lineLength) {
const char * ch;
char format[10];
while (isspace(*help) && *help) help++;
helpLength = strlen(help);
}
+/*@=boundsread@*/
if (helpLength) fprintf(fp, "%s\n", help);
fprintf(fp, POPT_("Usage:"));
if (!(con->flags & POPT_CONTEXT_KEEP_FIRST)) {
+/*@-boundsread@*/
/*@-nullderef@*/ /* LCL: wazzup? */
fn = con->optionStack->argv[0];
/*@=nullderef@*/
+/*@=boundsread@*/
if (fn == NULL) return len;
if (strchr(fn, '/')) fn = strrchr(fn, '/') + 1;
fprintf(fp, " %s", fn);
if (singleDash)
fprintf(stdout, " -");
+/*@-boundsread@*/
rest = poptGetArgs(optCon);
if (rest) {
fprintf(stdout, " rest:");
rest++;
}
}
+/*@=boundsread@*/
fprintf(stdout, "\n");
+strict # lclint level
# --- in progress
-#+bounds # 0
-+boundswrite # 0
++bounds
+slovak-fcns
# --- +partial artifacts
{ "q_extentsize", 0,POPT_ARG_INT, &db3dbi.dbi_q_extentsize, 0,
NULL, NULL },
- { NULL, 0,0, NULL, 0, NULL, NULL }
+ POPT_TABLEEND
};
/*@=compmempass =immediatetrans =exportlocal =exportheadervar@*/
+/*@-boundswrite@*/
static int dbSaveLong(const struct dbOption * opt, int argInfo, long aLong)
/*@modifies opt->arg @*/
{
}
return 0;
}
+/*@=boundswrite@*/
+/*@-boundswrite@*/
static int dbSaveInt(const struct dbOption * opt, int argInfo, long aLong)
/*@modifies opt->arg @*/
{
}
return 0;
}
+/*@=boundswrite@*/
dbiIndex db3Free(dbiIndex dbi)
{
static const char *db3_config_default =
"db3:hash:mpool:cdb:usecursors:verbose:mp_mmapsize=8Mb:mp_size=512Kb:pagesize=512:perms=0644";
+/*@-bounds@*/
dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag)
{
dbiIndex dbi = xcalloc(1, sizeof(*dbi));
return dbi;
/*@=globstate@*/
}
+/*@=bounds@*/
+/*@-boundswrite@*/
const char *const prDbiOpenFlags(int dbflags, int print_dbenv_flags)
{
static char buf[256];
}
return buf;
}
+/*@=boundswrite@*/
#endif
* @param scareMemory
* @return pointer to the finger print associated with a file path.
*/
+/*@-bounds@*/ /* LCL: segfault */
static fingerPrint doLookup(fingerPrintCache cache,
const char * dirName, const char * baseName, int scareMemory)
/*@modifies cache @*/
/*@-nullret@*/ return fp; /*@=nullret@*/ /* LCL: can't happen. */
/*@=compdef@*/
}
+/*@=bounds@*/
fingerPrint fpLookup(fingerPrintCache cache, const char * dirName,
const char * baseName, int scareMemory)
ch = 0;
chptr = fp->baseName;
+/*@-boundsread@*/
while (*chptr != '\0') ch ^= *chptr++;
+/*@=boundsread@*/
hash |= ((unsigned)ch) << 24;
hash |= (((((unsigned)fp->entry->dev) >> 8) ^ fp->entry->dev) & 0xFF) << 16;
return hash;
}
+/*@-boundsread@*/
int fpEqual(const void * key1, const void * key2)
{
const fingerPrint *k1 = key1;
return 1;
}
+/*@=boundsread@*/
+/*@-bounds@*/
void fpLookupList(fingerPrintCache cache, const char ** dirNames,
const char ** baseNames, const int * dirIndexes,
int fileCount, fingerPrint * fpList)
}
}
}
+/*@=bounds@*/
#ifdef UNUSED
/**
{
Header h = xcalloc(1, sizeof(*h));
+/*@-boundsread@*/
/*@-assignexpose@*/
h->hv = *hdrVec; /* structure assignment */
/*@=assignexpose@*/
+/*@=boundsread@*/
h->blob = NULL;
h->indexAlloced = INDEX_MALLOC_SIZE;
h->indexUsed = 0;
? xcalloc(h->indexAlloced, sizeof(*h->index))
: NULL);
- /*@-globstate -observertrans @*/
h->nrefs = 0;
+ /*@-globstate -observertrans @*/
return headerLink(h, "headerNew");
/*@=globstate =observertrans @*/
}
/**
*/
-static int indexCmp(const void * avp, const void * bvp) /*@*/
+static int indexCmp(const void * avp, const void * bvp)
+ /*@*/
{
/*@-castexpose@*/
indexEntry ap = (indexEntry) avp, bp = (indexEntry) bvp;
/*@modifies h @*/
{
if (!(h->flags & HEADERFLAG_SORTED)) {
+/*@-boundsread@*/
qsort(h->index, h->indexUsed, sizeof(*h->index), indexCmp);
+/*@=boundsread@*/
h->flags |= HEADERFLAG_SORTED;
}
}
void headerUnsort(Header h)
/*@modifies h @*/
{
+/*@-boundsread@*/
qsort(h->index, h->indexUsed, sizeof(*h->index), offsetCmp);
+/*@=boundsread@*/
}
/** \ingroup header
/* Alignment */
type = entry->info.type;
+/*@-boundsread@*/
if (typeSizes[type] > 1) {
diff = typeSizes[type] - (size % typeSizes[type]);
if (diff != typeSizes[type]) {
pad += diff;
}
}
+/*@=boundsread@*/
/*@-sizeoftype@*/
size += sizeof(struct entryInfo_s) + entry->length;
}
} else {
const char ** src = (const char **)p;
+/*@-boundsread@*/
while (i--) {
/* add one for null termination */
length += strlen(*src++) + 1;
}
+/*@=boundsread@*/
}
} break;
default:
+/*@-boundsread@*/
if (typeSizes[type] != -1) {
length = typeSizes[type] * count;
break;
}
+/*@=boundsread@*/
/*@-modfilesys@*/
fprintf(stderr, _("Data type %d not supported\n"), (int) type);
/*@=modfilesys@*/
* @param regionid region offset
* @return no. bytes of data in region, -1 on error
*/
-/*@-boundswrite@*/
static int regionSwab(/*@null@*/ indexEntry entry, int il, int dl,
entryInfo pe, char * dataStart, int regionid)
/*@modifies *entry, *dataStart @*/
int tdel, tl = dl;
struct indexEntry_s ieprev;
+/*@-boundswrite@*/
memset(&ieprev, 0, sizeof(ieprev));
+/*@=boundswrite@*/
for (; il > 0; il--, pe++) {
struct indexEntry_s ie;
int_32 type;
if (entry) {
ie.info.offset = regionid;
+/*@-boundswrite@*/
*entry = ie; /* structure assignment */
+/*@=boundswrite@*/
entry++;
}
/* Alignment */
type = ie.info.type;
+/*@-boundsread@*/
if (typeSizes[type] > 1) {
unsigned diff;
diff = typeSizes[type] - (dl % typeSizes[type]);
ieprev.length += diff;
}
}
+/*@=boundsread@*/
tdel = (tprev ? (t - tprev) : 0);
if (ieprev.info.type == RPM_I18NSTRING_TYPE)
tdel = ieprev.length;
/* Perform endian conversions */
switch (ntohl(pe->type)) {
+/*@-bounds@*/
case RPM_INT32_TYPE:
{ int_32 * it = (int_32 *)t;
for (; ie.info.count > 0; ie.info.count--, it += 1)
*it = htons(*it);
t = (char *) it;
} /*@switchbreak@*/ break;
+/*@=bounds@*/
default:
t += ie.length;
/*@switchbreak@*/ break;
return dl;
}
-/*@=boundswrite@*/
/** \ingroup header
*/
-/*@-boundswrite@*/
static /*@only@*/ /*@null@*/ void * doHeaderUnload(Header h,
/*@out@*/ int * lengthPtr)
/*@modifies h, *lengthPtr @*/
+ /*@requires maxSet(lengthPtr) >= 0 @*/
{
int_32 * ei = NULL;
entryInfo pe;
len = sizeof(il) + sizeof(dl) + (il * sizeof(*pe)) + dl;
+/*@-boundswrite@*/
ei = xmalloc(len);
ei[0] = htonl(il);
ei[1] = htonl(dl);
+/*@=boundswrite@*/
pe = (entryInfo) &ei[2];
dataStart = te = (char *) (pe + il);
int_32 stei[4];
legacy = 1;
+/*@-boundswrite@*/
memcpy(pe+1, src, rdl);
memcpy(te, src + rdl, rdlen);
+/*@=boundswrite@*/
te += rdlen;
pe->offset = htonl(te - dataStart);
stei[1] = pe->type;
stei[2] = htonl(-rdl-entry->info.count);
stei[3] = pe->count;
+/*@-boundswrite@*/
memcpy(te, stei, entry->info.count);
+/*@=boundswrite@*/
te += entry->info.count;
ril++;
rdlen += entry->info.count;
} else {
+/*@-boundswrite@*/
memcpy(pe+1, src + sizeof(*pe), ((ril-1) * sizeof(*pe)));
memcpy(te, src + (ril * sizeof(*pe)), rdlen+entry->info.count+drlen);
+/*@=boundswrite@*/
te += rdlen;
{ /*@-castexpose@*/
entryInfo se = (entryInfo)src;
unsigned diff;
diff = typeSizes[type] - ((te - dataStart) % typeSizes[type]);
if (diff != typeSizes[type]) {
+/*@-boundswrite@*/
memset(te, 0, diff);
+/*@=boundswrite@*/
te += diff;
pad += diff;
}
pe->offset = htonl(te - dataStart);
/* copy data w/ endian conversions */
+/*@-boundswrite@*/
switch (entry->info.type) {
case RPM_INT32_TYPE:
count = entry->info.count;
te += entry->length;
/*@switchbreak@*/ break;
}
+/*@=boundswrite@*/
pe++;
}
/*@=usereleased@*/
return (void *) ei;
}
-/*@=boundswrite@*/
/** \ingroup header
* Convert header to on-disk representation.
/*@modifies h @*/
{
int length;
+/*@-boundswrite@*/
void * uh = doHeaderUnload(h, &length);
+/*@=boundswrite@*/
return uh;
}
* @param tag tag
* @return 0 on success, 1 on failure (INCONSISTENT)
*/
-/*@-boundswrite@*/
static
int headerRemoveEntry(Header h, int_32 tag)
/*@modifies h @*/
if (ne > 0) {
h->indexUsed -= ne;
ne = last - first;
+/*@-boundswrite@*/
if (ne > 0)
memmove(entry, first, (ne * sizeof(*entry)));
+/*@=boundswrite@*/
}
return 0;
}
-/*@=boundswrite@*/
/** \ingroup header
* Convert header to in-memory representation.
* @param uh on-disk header blob (i.e. with offsets)
* @return header
*/
-/*@-boundswrite@*/
static /*@null@*/
Header headerLoad(/*@kept@*/ void * uh)
/*@modifies uh @*/
}
/* If any duplicate entries were replaced, move new entries down. */
+/*@-boundswrite@*/
if (h->indexUsed < (save - ne)) {
memmove(h->index + h->indexUsed, firstEntry,
(ne * sizeof(*entry)));
}
+/*@=boundswrite@*/
h->indexUsed += ne;
}
}
return h;
/*@=refcounttrans =globstate@*/
}
-/*@=boundswrite@*/
/** \ingroup header
* Convert header to on-disk representation, and then reload.
* @param tag region tag
* @return on-disk header (with offsets)
*/
-/*@-boundswrite@*/
static /*@null@*/
Header headerReload(/*@only@*/ Header h, int tag)
/*@modifies h @*/
Header nh;
int length;
/*@-onlytrans@*/
+/*@-boundswrite@*/
void * uh = doHeaderUnload(h, &length);
+/*@=boundswrite@*/
h = headerFree(h, "headerReload");
/*@=onlytrans@*/
uh = _free(uh);
nh->flags |= HEADERFLAG_ALLOCATED;
if (ENTRY_IS_REGION(nh->index)) {
+/*@-boundswrite@*/
if (tag == HEADER_SIGNATURES || tag == HEADER_IMMUTABLE)
nh->index[0].info.tag = tag;
+/*@=boundswrite@*/
}
return nh;
}
-/*@=boundswrite@*/
/** \ingroup header
* Make a copy and convert header to in-memory representation.
/*@*/
{
int_32 * ei = (int_32 *) uh;
+/*@-boundsread@*/
int_32 il = ntohl(ei[0]); /* index length */
int_32 dl = ntohl(ei[1]); /* data length */
+/*@=boundsread@*/
/*@-sizeoftype@*/
size_t pvlen = sizeof(il) + sizeof(dl) +
(il * sizeof(struct entryInfo_s)) + dl;
/* Sanity checks on header intro. */
/*@-branchstate@*/
if (!(hdrchkTags(il) || hdrchkData(dl)) && pvlen < headerMaxbytes) {
+/*@-boundsread@*/
nuh = memcpy(xmalloc(pvlen), uh, pvlen);
+/*@=boundsread@*/
if ((h = headerLoad(nuh)) != NULL)
h->flags |= HEADERFLAG_ALLOCATED;
}
* @param magicp read (and verify) 8 bytes of (magic, 0)?
* @return header (or NULL on error)
*/
-/*@-boundswrite@*/
static /*@null@*/
Header headerRead(FD_t fd, enum hMagic magicp)
/*@modifies fd @*/
i = 0;
+/*@-boundsread@*/
if (magicp == HEADER_MAGIC_YES) {
magic = block[i++];
if (memcmp(&magic, header_magic, sizeof(magic)))
il = ntohl(block[i]); i++;
dl = ntohl(block[i]); i++;
+/*@=boundsread@*/
/*@-sizeoftype@*/
len = sizeof(il) + sizeof(dl) + (il * sizeof(struct entryInfo_s)) + dl;
if (hdrchkTags(il) || hdrchkData(dl) || len > headerMaxbytes)
goto exit;
+/*@-boundswrite@*/
ei = xmalloc(len);
ei[0] = htonl(il);
ei[1] = htonl(dl);
len -= sizeof(il) + sizeof(dl);
+/*@=boundswrite@*/
+/*@-boundsread@*/
/*@-type@*/ /* FIX: cast? */
if (timedRead(fd, (char *)&ei[2], len) != len)
goto exit;
/*@=type@*/
+/*@=boundsread@*/
h = headerLoad(ei);
return h;
/*@-mustmod@*/
}
-/*@=boundswrite@*/
/** \ingroup header
* Write (with unload) header to file handle.
if (h == NULL)
return 1;
+/*@-boundswrite@*/
uh = doHeaderUnload(h, &length);
+/*@=boundswrite@*/
if (uh == NULL)
return 1;
switch (magicp) {
* @param minMem string pointers refer to header memory?
* @return 1 on success, otherwise error.
*/
-/*@-boundswrite@*/
static int copyEntry(const indexEntry entry,
/*@null@*/ /*@out@*/ hTYP_t type,
/*@null@*/ /*@out@*/ hPTR_t * p,
/*@null@*/ /*@out@*/ hCNT_t c,
int minMem)
/*@modifies *type, *p, *c @*/
+ /*@requires maxSet(type) >= 0 /\ maxSet(p) >= 0 /\ maxSet(c) >= 0 @*/
{
int_32 count = entry->info.count;
int rc = 1; /* XXX 1 on success. */
/*@-castexpose@*/
entryInfo pe = (entryInfo) (ei + 2);
/*@=castexpose@*/
+/*@-boundsread@*/
char * dataStart = (char *) (pe + ntohl(ei[0]));
+/*@=boundsread@*/
int_32 rdl = -entry->info.offset; /* negative offset */
int_32 ril = rdl/sizeof(*pe);
rdl += REGION_TAG_COUNT;
}
+/*@-bounds@*/
*p = xmalloc(count);
ei = (int_32 *) *p;
ei[0] = htonl(ril);
dataStart = (char *) memcpy(pe + ril, dataStart, rdl);
/*@=sizeoftype@*/
+/*@=bounds@*/
rc = regionSwab(NULL, ril, 0, pe, dataStart, 0);
/* XXX 1 on success. */
char * t;
int i;
+/*@-bounds@*/
/*@-mods@*/
if (minMem) {
*p = xmalloc(tableSize);
memcpy(t, entry->data, entry->length);
}
/*@=mods@*/
+/*@=bounds@*/
for (i = 0; i < count; i++) {
+/*@-boundswrite@*/
*ptrEntry++ = t;
+/*@=boundswrite@*/
t = strchr(t, 0);
t++;
}
if (c) *c = count;
return rc;
}
-/*@=boundswrite@*/
/**
* Does locale match entry in header i18n table?
return entry->data;
/*@=mods@*/
+/*@-boundsread@*/
for (l = lang; *l != '\0'; l = le) {
const char *td;
char *ed;
}
}
+/*@=boundsread@*/
return entry->data;
}
* @param minMem string pointers reference header memory?
* @return 1 on success, 0 on not found
*/
-/*@-boundswrite@*/
static int intGetEntry(Header h, int_32 tag,
/*@null@*/ /*@out@*/ hTAG_t type,
/*@null@*/ /*@out@*/ hPTR_t * p,
/*@null@*/ /*@out@*/ hCNT_t c,
int minMem)
/*@modifies *type, *p, *c @*/
+ /*@requires maxSet(type) >= 0 /\ maxSet(p) >= 0 /\ maxSet(c) >= 0 @*/
{
indexEntry entry;
int rc;
/* XXX 1 on success */
return ((rc == 1) ? 1 : 0);
}
-/*@=boundswrite@*/
/** \ingroup header
* Free data allocated when retrieved from header.
return intGetEntry(h, tag, type, p, c, 1);
}
-/*@-boundswrite@*/
int headerGetRawEntry(Header h, int_32 tag, int_32 * type, hPTR_t * p,
int_32 * c)
{
/* XXX 1 on success */
return ((rc == 1) ? 1 : 0);
}
-/*@=boundswrite@*/
/**
*/
-/*@-boundswrite@*/
static void copyData(int_32 type, /*@out@*/ void * dstPtr, const void * srcPtr,
int_32 c, int dataLength)
/*@modifies *dstPtr @*/
i = c;
src = (const char **) srcPtr;
dst = dstPtr;
+/*@-bounds@*/
while (i--) {
if (*src) {
int len = strlen(*src) + 1;
}
src++;
}
+/*@=bounds@*/
break;
default:
+/*@-boundswrite@*/
memmove(dstPtr, srcPtr, dataLength);
+/*@=boundswrite@*/
break;
}
}
-/*@=boundswrite@*/
/**
* Return (malloc'ed) copy of entry data.
* @retval lengthPtr no. bytes in returned data
* @return (malloc'ed) copy of entry data
*/
-/*@-boundswrite@*/
static void * grabData(int_32 type, hPTR_t p, int_32 c,
/*@out@*/ int * lengthPtr)
/*@modifies *lengthPtr @*/
+ /*@requires maxSet(lengthPtr) >= 0 @*/
{
int length = dataLength(type, p, c, 0);
void * data = xmalloc(length);
*lengthPtr = length;
return data;
}
-/*@=boundswrite@*/
/** \ingroup header
* Add tag to header.
entry->info.type = type;
entry->info.count = c;
entry->info.offset = 0;
+/*@-boundswrite@*/
entry->data = grabData(type, p, c, &entry->length);
+/*@=boundswrite@*/
+/*@-boundsread@*/
if (h->indexUsed > 0 && tag < h->index[h->indexUsed-1].info.tag)
h->flags &= ~HEADERFLAG_SORTED;
+/*@=boundsread@*/
h->indexUsed++;
return 1;
* @param c number of values
* @return 1 on success, 0 on failure
*/
-/*@-boundswrite@*/
static
int headerAppendEntry(Header h, int_32 tag, int_32 type,
const void * p, int_32 c)
if (ENTRY_IN_REGION(entry)) {
char * t = xmalloc(entry->length + length);
+/*@-bounds@*/
memcpy(t, entry->data, entry->length);
+/*@=bounds@*/
entry->data = t;
entry->info.offset = 0;
} else
return 1;
}
-/*@=boundswrite@*/
/** \ingroup header
* Add or append element to tag array in header.
* @param lang locale
* @return 1 on success, 0 on failure
*/
-/*@-bounds@*/
static
int headerAddI18NString(Header h, int_32 tag, const char * string,
const char * lang)
return 0;
}
-/*@=bounds@*/
/** \ingroup header
* Modify tag in header.
* @param num number of elements
* @return NULL always
*/
-/*@-boundswrite@*/
static /*@null@*/ sprintfToken
freeFormat( /*@only@*/ /*@null@*/ sprintfToken format, int num)
/*@modifies *format @*/
for (i = 0; i < num; i++) {
switch (format[i].type) {
case PTOK_ARRAY:
+/*@-boundswrite@*/
format[i].u.array.format =
freeFormat(format[i].u.array.format,
format[i].u.array.numTokens);
+/*@=boundswrite@*/
/*@switchbreak@*/ break;
case PTOK_COND:
+/*@-boundswrite@*/
format[i].u.cond.ifFormat =
freeFormat(format[i].u.cond.ifFormat,
format[i].u.cond.numIfTokens);
format[i].u.cond.elseFormat =
freeFormat(format[i].u.cond.elseFormat,
format[i].u.cond.numElseTokens);
+/*@=boundswrite@*/
/*@switchbreak@*/ break;
case PTOK_NONE:
case PTOK_TAG:
format = _free(format);
return NULL;
}
-/*@=boundswrite@*/
/**
*/
-/*@-boundswrite@*/
static void findTag(char * name, const headerTagTableEntry tags,
const headerSprintfExtension extensions,
/*@out@*/ headerTagTableEntry * tagMatch,
/*@out@*/ headerSprintfExtension * extMatch)
/*@modifies *tagMatch, *extMatch @*/
+ /*@requires maxSet(tagMatch) >= 0 /\ maxSet(extMatch) >= 0 @*/
{
headerTagTableEntry entry;
headerSprintfExtension ext;
*extMatch = NULL;
if (strncmp("RPMTAG_", name, sizeof("RPMTAG_")-1)) {
+/*@-boundswrite@*/
char * t = alloca(strlen(name) + sizeof("RPMTAG_"));
(void) stpcpy( stpcpy(t, "RPMTAG_"), name);
tagname = t;
+/*@=boundswrite@*/
} else {
tagname = name;
}
return;
}
}
-/*@=boundswrite@*/
/* forward ref */
static int parseExpression(sprintfToken token, char * str,
const headerTagTableEntry tags,
const headerSprintfExtension extensions,
/*@out@*/char ** endPtr, /*@null@*/ /*@out@*/ errmsg_t * errmsg)
- /*@modifies str, *str, *token, *endPtr, *errmsg @*/;
+ /*@modifies str, *str, *token, *endPtr, *errmsg @*/
+ /*@requires maxSet(endPtr) >= 0 /\ maxSet(errmsg) >= 0 @*/;
/**
*/
/*@null@*/ /*@out@*/ char ** endPtr, int state,
/*@null@*/ /*@out@*/ errmsg_t * errmsg)
/*@modifies str, *str, *formatPtr, *numTokensPtr, *endPtr, *errmsg @*/
+ /*@requires maxSet(formatPtr) >= 0 /\ maxSet(numTokensPtr) >= 0
+ /\ maxSet(endPtr) >= 0 /\ maxSet(errmsg) >= 0 @*/
{
char * chptr, * start, * next, * dst;
sprintfToken format;
/*@=boundswrite@*/
/**
+ * @param h
+ * @param fn
+ * @retval typeptr
+ * @retval data
+ * @retval countptr
+ * @param ext
* @return 0 on success, 1 on failure
*/
static int getExtension(Header h, headerTagTagFunction fn,
/*@out@*/ hCNT_t countptr,
extensionCache ext)
/*@modifies *typeptr, *data, *countptr, ext @*/
+ /*@requires maxSet(typeptr) >= 0 /\ maxSet(data) >= 0
+ /\ maxSet(countptr) >= 0 @*/
{
if (!ext->avail) {
if (fn(h, &ext->type, &ext->data, &ext->count, &ext->freeit))
ext->avail = 1;
}
-/*@-boundswrite@*/
if (typeptr) *typeptr = ext->type;
if (data) *data = ext->data;
if (countptr) *countptr = ext->count;
-/*@=boundswrite@*/
return 0;
}
extensionCache extCache, int element,
char ** valp, int * vallenp, int * allocedp)
/*@modifies extCache, *valp, *vallenp, *allocedp @*/
+ /*@requires maxSet(valp) >= 0 /\ maxSet(vallenp) >= 0
+ /\ maxSet(allocedp) >= 0 @*/
{
char * val = NULL;
int need = 0;
memset(buf, 0, sizeof(buf));
/*@-branchstate@*/
if (tag->ext) {
+/*@-boundswrite@*/
if (getExtension(h, tag->ext, &type, &data, &count,
extCache + tag->extNum))
{
type = RPM_STRING_TYPE;
data = "(none)";
}
+/*@=boundswrite@*/
} else {
if (!headerGetEntry(h, tag->tag, &type, (void **)&data, &count)) {
count = 1;
/*@-branchstate@*/
if (val && need > 0) {
-/*@-boundswrite@*/
if (((*vallenp) + need) >= (*allocedp)) {
if ((*allocedp) <= need)
(*allocedp) += need;
/*@=unqualifiedtrans@*/
}
t = (*valp) + (*vallenp);
+/*@-boundswrite@*/
te = stpcpy(t, val);
+/*@=boundswrite@*/
(*vallenp) += (te - t);
val = _free(val);
-/*@=boundswrite@*/
}
/*@=branchstate@*/
extensionCache extCache, int element,
char ** valp, int * vallenp, int * allocedp)
/*@modifies h, extCache, *valp, *vallenp, *allocedp @*/
+ /*@requires maxSet(valp) >= 0 /\ maxSet(vallenp) >= 0
+ /\ maxSet(allocedp) >= 0 @*/
{
char * t, * te;
int i, j;
break;
case PTOK_STRING:
-/*@-boundswrite@*/
need = token->u.string.len;
if (need <= 0) break;
if (((*vallenp) + need) >= (*allocedp)) {
/*@=unqualifiedtrans@*/
}
t = (*valp) + (*vallenp);
+/*@-boundswrite@*/
te = stpcpy(t, token->u.string.string);
- (*vallenp) += (te - t);
/*@=boundswrite@*/
+ (*vallenp) += (te - t);
break;
case PTOK_TAG:
need = condNumFormats * 20;
if (condFormat == NULL || need <= 0) break;
-/*@-boundswrite@*/
if (((*vallenp) + need) >= (*allocedp)) {
if ((*allocedp) <= need)
(*allocedp) += need;
(*valp) = xrealloc((*valp), (*allocedp)+1);
/*@=unqualifiedtrans@*/
}
-/*@=boundswrite@*/
t = (*valp) + (*vallenp);
for (i = 0; i < condNumFormats; i++)
if (token->u.array.format[i].u.tag.ext) {
const void * data;
+/*@-boundswrite@*/
if (getExtension(h, token->u.array.format[i].u.tag.ext,
&type, &data, &numElements,
extCache +
token->u.array.format[i].u.tag.extNum))
continue;
+/*@=boundswrite@*/
} else {
if (!headerGetEntry(h, token->u.array.format[i].u.tag.tag,
&type, NULL, &numElements))
/*@loopbreak@*/ break;
}
-/*@-boundswrite@*/
if (numElements == -1) {
need = sizeof("(none)") - 1;
if (((*vallenp) + need) >= (*allocedp)) {
/*@=unqualifiedtrans@*/
}
t = (*valp) + (*vallenp);
+/*@-boundswrite@*/
te = stpcpy(t, "(none)");
+/*@=boundswrite@*/
(*vallenp) += (te - t);
} else {
need = numElements * token->u.array.numTokens * 10;
valp, vallenp, allocedp);
}
}
-/*@=boundswrite@*/
break;
}
/*fmtString = escapeString(fmt);*/
fmtString = xstrdup(fmt);
+/*@-boundswrite@*/
if (parseFormat(fmtString, tags, exts, &format, &numTokens,
NULL, PARSER_BEGIN, errmsg)) {
fmtString = _free(fmtString);
return NULL;
}
+/*@=boundswrite@*/
extCache = allocateExtensionCache(exts);
val = xstrdup("");
for (i = 0; i < numTokens; i++) {
+/*@-boundswrite@*/
/*@-mods@*/
t = singleSprintf(h, format + i, exts, extCache, 0,
&val, &vallen, &alloced);
/*@=mods@*/
+/*@=boundswrite@*/
}
if (val != NULL && vallen < alloced)
if (type != RPM_INT32_TYPE) {
val = xstrdup(_("(not a number)"));
} else {
-/*@-boundswrite@*/
val = xmalloc(20 + padding);
+/*@-boundswrite@*/
strcat(formatPrefix, "o");
+/*@=boundswrite@*/
/*@-formatconst@*/
sprintf(val, formatPrefix, *((int_32 *) data));
/*@=formatconst@*/
-/*@=boundswrite@*/
}
return val;
if (type != RPM_INT32_TYPE) {
val = xstrdup(_("(not a number)"));
} else {
-/*@-boundswrite@*/
val = xmalloc(20 + padding);
+/*@-boundswrite@*/
strcat(formatPrefix, "x");
+/*@=boundswrite@*/
/*@-formatconst@*/
sprintf(val, formatPrefix, *((int_32 *) data));
/*@=formatconst@*/
-/*@=boundswrite@*/
}
return val;
struct tm * tstruct;
char buf[50];
-/*@-boundswrite@*/
val = xmalloc(50 + padding);
+/*@-boundswrite@*/
strcat(formatPrefix, "s");
+/*@=boundswrite@*/
/* this is important if sizeof(int_32) ! sizeof(time_t) */
{ time_t dateint = *((int_32 *) data);
/*@-formatconst@*/
sprintf(val, formatPrefix, buf);
/*@=formatconst@*/
-/*@=boundswrite@*/
}
return val;
/**
*/
-/*@-boundswrite@*/
static char * shescapeFormat(int_32 type, hPTR_t data,
char * formatPrefix, int padding, /*@unused@*/int element)
/*@modifies formatPrefix @*/
if (type == RPM_INT32_TYPE) {
result = xmalloc(padding + 20);
+/*@-boundswrite@*/
strcat(formatPrefix, "d");
+/*@=boundswrite@*/
/*@-formatconst@*/
sprintf(result, formatPrefix, *((int_32 *) data));
/*@=formatconst@*/
} else {
buf = alloca(strlen(data) + padding + 2);
+/*@-boundswrite@*/
strcat(formatPrefix, "s");
+/*@=boundswrite@*/
/*@-formatconst@*/
sprintf(buf, formatPrefix, data);
/*@=formatconst@*/
+/*@-boundswrite@*/
result = dst = xmalloc(strlen(buf) * 4 + 3);
*dst++ = '\'';
for (src = buf; *src != '\0'; src++) {
}
*dst++ = '\'';
*dst = '\0';
+/*@=boundswrite@*/
}
return result;
}
-/*@=boundswrite@*/
/*@-type@*/ /* FIX: cast? */
const struct headerSprintfExtension_s headerDefaultFormats[] = {
/*@null@*/ /*@out@*/ hPTR_t * p,
/*@null@*/ /*@out@*/ hCNT_t c)
/*@modifies hi, *tag, *type, *p, *c @*/
+ /*@requires maxSet(tag) >= 0 /\ maxSet(type) >= 0
+ /\ maxSet(p) >= 0 /\ maxSet(c) >= 0 @*/
{
Header h = hi->h;
int slot = hi->next_index;
hi->next_index++;
/*@=noeffect@*/
-/*@-boundswrite@*/
if (tag)
*tag = entry->info.tag;
-/*@=boundswrite@*/
rc = copyEntry(entry, type, p, c, 0);
/** \ingroup header
*/
-enum headerSprintfExtenstionType {
+enum headerSprintfExtensionType {
HEADER_EXT_LAST = 0, /*!< End of extension chain. */
HEADER_EXT_FORMAT, /*!< headerTagFormatFunction() extension */
HEADER_EXT_MORE, /*!< Chain to next table. */
*/
typedef /*only@*/ char * (*headerTagFormatFunction)(int_32 type,
const void * data, char * formatPrefix,
- int padding, int element);
+ int padding, int element)
+ /*@requires maxSet(data) >= 0 @*/;
+
/** \ingroup header
* HEADER_EXT_FORMAT format function prototype.
* This is allowed to fail, which indicates the tag doesn't exist.
/*@null@*/ /*@out@*/ hTYP_t type,
/*@null@*/ /*@out@*/ hPTR_t * data,
/*@null@*/ /*@out@*/ hCNT_t count,
- /*@null@*/ /*@out@*/ int * freeData);
+ /*@null@*/ /*@out@*/ int * freeData)
+ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0
+ /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/;
/** \ingroup header
* Define header tag output formats.
*/
typedef /*@abstract@*/ struct headerSprintfExtension_s * headerSprintfExtension;
struct headerSprintfExtension_s {
- enum headerSprintfExtenstionType type; /*!< Type of extension. */
+ enum headerSprintfExtensionType type; /*!< Type of extension. */
/*@observer@*/ /*@null@*/
const char * name; /*!< Name of extension. */
union {
* Include calculation for 8 bytes of (magic, 0)?
*/
enum hMagic {
- HEADER_MAGIC_NO = 0,
- HEADER_MAGIC_YES = 1
+ HEADER_MAGIC_NO = 0,
+ HEADER_MAGIC_YES = 1
};
/** \ingroup header
*/
/*@-enummemuse -typeuse @*/
typedef enum rpmSubTagType_e {
- RPM_REGION_TYPE = -10,
- RPM_BIN_ARRAY_TYPE = -11,
+ RPM_REGION_TYPE = -10,
+ RPM_BIN_ARRAY_TYPE = -11,
/*!<@todo Implement, kinda like RPM_STRING_ARRAY_TYPE for known (but variable)
length binary data. */
- RPM_XREF_TYPE = -12
+ RPM_XREF_TYPE = -12
/*!<@todo Implement, intent is to to carry a (???,tagNum,valNum) cross
reference to retrieve data from other tags. */
} rpmSubTagType;
* @return header (or NULL on error)
*/
typedef
-/*@null@*/ Header (*HDRhdrread) (FD_t fd, enum hMagic magicp)
+/*@null@*/ Header (*HDRread) (FD_t fd, enum hMagic magicp)
/*@modifies fd @*/;
/** \ingroup header
* @return 0 on success, 1 on error
*/
typedef
-int (*HDRhdrwrite) (FD_t fd, /*@null@*/ Header h, enum hMagic magicp)
+int (*HDRwrite) (FD_t fd, /*@null@*/ Header h, enum hMagic magicp)
/*@globals fileSystem @*/
/*@modifies fd, h, fileSystem @*/;
* @return formatted output string (malloc'ed)
*/
typedef
-/*@only@*/ char * (*HDRhdrsprintf) (Header h, const char * fmt,
+/*@only@*/ char * (*HDRsprintf) (Header h, const char * fmt,
const struct headerTagTableEntry_s * tags,
const struct headerSprintfExtension_s * extensions,
/*@null@*/ /*@out@*/ errmsg_t * errmsg)
HDRcopy hdrcopy;
HDRload hdrload;
HDRcopyload hdrcopyload;
- HDRhdrread hdrread;
- HDRhdrwrite hdrwrite;
+ HDRread hdrread;
+ HDRwrite hdrwrite;
HDRisentry hdrisentry;
HDRfreetag hdrfreetag;
HDRget hdrget;
HDRaddi18n hdraddi18n;
HDRmodify hdrmodify;
HDRremove hdrremove;
- HDRhdrsprintf hdrsprintf;
+ HDRsprintf hdrsprintf;
HDRcopytags hdrcopytags;
HDRfreeiter hdrfreeiter;
HDRinititer hdrinititer;
#include "debug.h"
+/*@-boundswrite@*/
char ** headerGetLangs(Header h)
{
char **s, *e, **table;
if ((table = (char **)xcalloc((count+1), sizeof(char *))) == NULL)
return NULL;
-/*@-boundswrite@*/
for (i = 0, e = *s; i < count > 0; i++, e += strlen(e)+1)
table[i] = e;
table[count] = NULL;
-/*@=boundswrite@*/
/*@-nullret@*/ return table; /*@=nullret@*/ /* LCL: double indirection? */
}
+/*@=boundswrite@*/
+/*@-boundsread@*/
/*@-type@*/ /* FIX: shrug */
void headerDump(Header h, FILE *f, int flags,
const struct headerTagTableEntry_s * tags)
}
/*@=type@*/
/*@=sizeoftype@*/
+/*@=boundsread@*/
* @return 1 on success, 0 on failure
*/
/*@-exportlocal@*/
+/*@-incondefs@*/
int headerGetRawEntry(Header h, int_32 tag,
/*@null@*/ /*@out@*/ hTYP_t type,
/*@null@*/ /*@out@*/ hPTR_t * p,
/*@null@*/ /*@out@*/ hCNT_t c)
- /*@modifies *type, *p, *c @*/;
+ /*@modifies *type, *p, *c @*/
+ /*@requires maxSet(type) >= 0 /\ maxSet(p) >= 0 /\ maxSet(c) >= 0 @*/;
+/*@=incondefs@*/
/*@=exportlocal@*/
/** \ingroup header
if (fdno < 0)
return fdno;
+/*@-boundsread@*/
if (!(cmd && *cmd))
return fdno;
+/*@=boundsread@*/
#if HAVE_LIBELF_GELF_H && HAVE_LIBELF
{ Elf *elf = NULL;
if (dbiTags != NULL)
for (dbix = 0; dbix < dbiTagsMax; dbix++) {
+/*@-boundsread@*/
if (rpmtag == dbiTags[dbix])
return dbix;
+/*@=boundsread@*/
}
return -1;
}
/**
* Initialize database (index, tag) tuple from configuration.
*/
+/*@-bounds@*/
static void dbiTagsInit(void)
/*@globals rpmGlobalMacroContext, dbiTags, dbiTagsMax @*/
/*@modifies rpmGlobalMacroContext, dbiTags, dbiTagsMax @*/
dbiTagStr = _free(dbiTagStr);
}
+/*@=bounds@*/
/*@-redecl@*/
#define DB1vec NULL
};
/*@=nullassign@*/
+/*@-bounds@*/
dbiIndex dbiOpen(rpmdb db, rpmTag rpmtag, /*@unused@*/ unsigned int flags)
{
int dbix;
return dbi;
/*@=compdef =nullstate@*/
}
+/*@=bounds@*/
/**
* Create and initialize item for index database set.
set->count = data->size / dbi->dbi_jlen;
set->recs = xmalloc(set->count * sizeof(*(set->recs)));
+/*@-boundswrite@*/
switch (dbi->dbi_jlen) {
default:
case 2*sizeof(int_32):
sdbir += sizeof(hdrNum.ui);
memcpy(&tagNum.ui, sdbir, sizeof(tagNum.ui));
sdbir += sizeof(tagNum.ui);
+/*@-boundsread@*/
if (_dbbyteswapped) {
_DBSWAP(hdrNum);
_DBSWAP(tagNum);
}
+/*@=boundsread@*/
set->recs[i].hdrNum = hdrNum.ui;
set->recs[i].tagNum = tagNum.ui;
set->recs[i].fpNum = 0;
memcpy(&hdrNum.ui, sdbir, sizeof(hdrNum.ui));
sdbir += sizeof(hdrNum.ui);
+/*@-boundsread@*/
if (_dbbyteswapped) {
_DBSWAP(hdrNum);
}
+/*@=boundsread@*/
set->recs[i].hdrNum = hdrNum.ui;
set->recs[i].tagNum = 0;
set->recs[i].fpNum = 0;
break;
}
*setp = set;
+/*@=boundswrite@*/
/*@-compdef@*/
return 0;
/*@=compdef@*/
* @param set index set
* @return 0 on success
*/
+/*@-bounds@*/
static int set2dbt(dbiIndex dbi, DBT * data, dbiIndexSet set)
/*@modifies *data @*/
{
return 0;
/*@=compdef@*/
}
+/*@=bounds@*/
/* XXX assumes hdrNum is first int in dbiIndexItem */
static int hdrNumCmp(const void * one, const void * two)
* @param sortset should resulting set be sorted?
* @return 0 success, 1 failure (bad args)
*/
+/*@-bounds@*/ /* LCL: segfault */
static int dbiAppendSet(dbiIndexSet set, const void * recs,
int nrecs, size_t recsize, int sortset)
/*@modifies *set @*/
return 0;
}
+/*@=bounds@*/
/**
* Remove element(s) from set of index database items.
/*@-modunconnomods@*/
hash = ht->fn(key) % ht->numBuckets;
+/*@-boundsread@*/
b = ht->buckets[hash];
+/*@=boundsread@*/
while (b && b->key && ht->eq(b->key, key))
b = b->next;
const char * chp = string;
len = strlen(string);
+/*@-boundsread@*/
for (i = 0; i < len; i++, chp++) {
xorValue ^= *chp;
sum += *chp;
}
+/*@=boundsread@*/
return ((((unsigned)len) << 16) + (((unsigned)sum) << 8) + xorValue);
}
int i;
for (i = 0; i < ht->numBuckets; i++) {
+/*@-boundsread@*/
b = ht->buckets[i];
+/*@=boundsread@*/
if (b == NULL)
continue;
/*@-boundswrite@*/
+strict # lclint level
# --- in progress
-#+bounds # 334
-+boundswrite # 152
++bounds
# --- +partial artifacts
-declundef
/*@modifies param, digest @*/; /*!< Digest finish. */
};
+/*@-boundsread@*/
DIGEST_CTX
rpmDigestDup(DIGEST_CTX octx)
{
nctx->param = memcpy(xcalloc(1, nctx->paramlen), octx->param, nctx->paramlen);
return nctx;
}
+/*@=boundsread@*/
DIGEST_CTX
rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags)
/*@notreached@*/ break;
}
+/*@-boundsread@*/
xx = (*ctx->Reset) (ctx->param);
+/*@=boundsread@*/
DPRINTF((stderr, "*** Init(%x) ctx %p param %p\n", flags, ctx, ctx->param));
return ctx;
+/*@-boundsread@*/
/*@-sysunrecog -noeffectuncon -nullpass -sizeoftype -unrecog -usereleased @*/
/*@-compdef -compmempass -dependenttrans -retalias @*/
/*-
}
/*@=compdef =compmempass =dependenttrans =retalias @*/
/*@=sysunrecog =noeffectuncon =nullpass =sizeoftype =unrecog =usereleased @*/
+/*@=boundsread@*/
+/*@-boundsread@*/
/** \ingroup rpmrc rpmio
* \file rpmio/macro.c
*/
}
#endif /* EVAL_MACROS */
#endif /* DEBUG_MACROS */
+/*@=boundsread@*/
}
#endif
+/*@-boundsread@*/
/*@-compdef@*/ /* FIX: address->s_addr undefined. */
static int getHostAddress(const char * host, /*@out@*/ struct in_addr * address)
/*@globals errno @*/
return 0;
}
/*@=compdef@*/
+/*@=boundsread@*/
static int tcpConnect(FD_t ctrl, const char * host, int port)
/*@globals fileSystem @*/
int notifier = -1;
if (urlNotify) {
+/*@-boundsread@*/
/*@-noeffectuncon @*/ /* FIX: check rc */
(void)(*urlNotify) (NULL, RPMCALLBACK_INST_OPEN_FILE,
0, 0, NULL, urlNotifyData);
/*@=noeffectuncon @*/
+/*@=boundsread@*/
}
while (1) {
if (urlNotify && urlNotifyCount > 0) {
int n = itemsCopied/urlNotifyCount;
if (n != notifier) {
+/*@-boundsread@*/
/*@-noeffectuncon @*/ /* FIX: check rc */
(void)(*urlNotify) (NULL, RPMCALLBACK_INST_PROGRESS,
itemsCopied, 0, NULL, urlNotifyData);
/*@=noeffectuncon @*/
+/*@=boundsread@*/
notifier = n;
}
}
/*@=modfilesys@*/
if (urlNotify) {
+/*@-boundsread@*/
/*@-noeffectuncon @*/ /* FIX: check rc */
(void)(*urlNotify) (NULL, RPMCALLBACK_INST_OPEN_FILE,
itemsCopied, itemsCopied, NULL, urlNotifyData);
/*@=noeffectuncon @*/
+/*@=boundsread@*/
}
return rc;
FDSANE(fd);
for (i = fd->nfps; i >= 0; i--) {
+/*@-boundsread@*/
FDSTACK_t * fps = &fd->fps[i];
+/*@=boundsread@*/
if (fps->io != gzdio)
continue;
rc = fps->fp;
FDSANE(fd);
for (i = fd->nfps; i >= 0; i--) {
+/*@-boundsread@*/
FDSTACK_t * fps = &fd->fps[i];
+/*@=boundsread@*/
if (fps->io != bzdio)
continue;
rc = fps->fp;
/*@=modfilesys@*/
if (fdGetIo(fd) == fpio) {
+/*@-boundsread@*/
/*@+voidabstract -nullpass@*/
rc = fwrite(buf, size, nmemb, fdGetFILE(fd));
/*@=voidabstract =nullpass@*/
+/*@=boundsread@*/
return rc;
}
fd = fdLink(fd, "Fclose");
/*@-branchstate@*/
while (fd->nfps >= 0) {
+/*@-boundsread@*/
FDSTACK_t * fps = &fd->fps[fd->nfps];
+/*@=boundsread@*/
if (fps->io == fpio) {
FILE *fp;
if (path == NULL || fmode == NULL)
return NULL;
+ stdio[0] = '\0';
cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, &flags);
if (stdio[0] == '\0')
return NULL;
if (fd == NULL) return -1;
for (i = fd->nfps; rc == 0 && i >= 0; i--) {
+/*@-boundsread@*/
FDSTACK_t * fps = &fd->fps[i];
+/*@=boundsread@*/
int ec;
if (fps->io == fpio) {
int i, rc = -1;
for (i = fd->nfps ; rc == -1 && i >= 0; i--) {
+/*@-boundsread@*/
rc = fd->fps[i].fdno;
+/*@=boundsread@*/
}
/*@-modfilesys@*/
DBGIO(fd, (stderr, "==> Fileno(%p) rc %d %s\n", (fd ? fd : NULL), rc, fdbg(fd)));
+/*@-boundsread@*/
/** \ingroup rpmio
* \file rpmio/rpmlog.c
*/
{
return rpmlogSetCallback(cb);
}
+/*@=boundsread@*/
+/*@-boundsread@*/
/** \ingroup rpmio signature
* \file rpmio/rpmpgp.c
* Routines to handle RFC-2440 detached signatures.
return ec;
}
/*@=boundswrite@*/
+/*@=boundsread@*/
}
/*@=boundswrite@*/
+/*@-boundsread@*/
static int
is_num (int idx)
/*@*/
return 0;
return 1;
}
+/*@=boundsread@*/
+/*@-boundsread@*/
static int
is_dos_date(/*@null@*/ const char *str)
/*@*/
return 1;
return 0;
}
+/*@=boundsread@*/
static int
is_week (/*@null@*/ const char * str, /*@out@*/ struct tm * tim)
dt = (char *) (av + (ac + 1));
i = dir->offset + 1;
+/*@-boundsread@*/
if (i < 0 || i >= ac || av[i] == NULL)
return NULL;
+/*@=boundsread@*/
dir->offset = i;
dp->d_ino = i + 1; /* W2DO? */
dp->d_off = 0; /* W2DO? */
dp->d_reclen = 0; /* W2DO? */
+/*@-boundsread@*/
dp->d_type = dt[i];
+/*@=boundsread@*/
strncpy(dp->d_name, av[i], sizeof(dp->d_name));
/*@+voidabstract@*/
* @retval pathp pointer to path component of url
* @return type of url
*/
+/*@-incondefs@*/
urltype urlPath(const char * url, /*@out@*/ const char ** pathp)
+ /*@ensures maxSet(*pathp) == 0 /\ maxRead(*pathp) == 0 @*/
/*@modifies *pathp @*/;
+/*@=incondefs@*/
/**
* Parse URL string into a control structure.
do
{
+/*@-boundsread@*/
c1 = xtolower (*p1++);
c2 = xtolower (*p2++);
+/*@=boundsread@*/
if (c1 == '\0')
break;
}
do
{
+/*@-boundsread@*/
c1 = xtolower (*p1++);
c2 = xtolower (*p2++);
+/*@=boundsread@*/
if (c1 == '\0' || c1 != c2)
break;
} while (--n > 0);
{
struct urlstring *us;
+/*@-boundsread@*/
if (url && *url) {
for (us = urlstrings; us->leadin != NULL; us++) {
if (strncmp(url, us->leadin, strlen(us->leadin)))
return us->ret;
}
}
+/*@=boundsread@*/
return URL_IS_UNKNOWN;
}
* Split URL into components. The URL can look like
* service://user:password@host:port/path
*/
-/*@-boundswrite@*/
+/*@-bounds@*/
/*@-modfilesys@*/
int urlSplit(const char * url, urlinfo *uret)
{
return 0;
}
/*@=modfilesys@*/
-/*@=boundswrite@*/
+/*@=bounds@*/
int urlGetFile(const char * url, const char * dest)
{
}
+/*@-bounds@*/ /* LCL: segfault */
/*@-mods@*/ /* FIX: shrug */
#if !defined(__GLIBC__) && !defined(__LCLINT__)
int main(int argc, const char ** argv, /*@unused@*/ char ** envp)
/*@=globstate@*/
}
/*@=mods@*/
+/*@=bounds@*/