idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
10,000 | SPR_ListEntry(struct rx_call *call, afs_int32 aid, struct prcheckentry *aentry)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = listEntry(call, aid, aentry, &cid);
osi_auditU(call, PTS_LstEntEvent, code, AUD_ID, aid, AUD_END);
ViceLog(125, ("PTS_ListEntry: code %d cid %d aid %d\n", code, cid,... | Bypass | 0 | SPR_ListEntry(struct rx_call *call, afs_int32 aid, struct prcheckentry *aentry)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = listEntry(call, aid, aentry, &cid);
osi_auditU(call, PTS_LstEntEvent, code, AUD_ID, aid, AUD_END);
ViceLog(125, ("PTS_ListEntry: code %d cid %d aid %d\n", code, cid,... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,001 | SPR_ListMax(struct rx_call *call, afs_int32 *uid, afs_int32 *gid)
{
afs_int32 code;
code = listMax(call, uid, gid);
osi_auditU(call, PTS_LstMaxEvent, code, AUD_END);
ViceLog(125, ("PTS_ListMax: code %d\n", code));
return code;
}
| Bypass | 0 | SPR_ListMax(struct rx_call *call, afs_int32 *uid, afs_int32 *gid)
{
afs_int32 code;
code = listMax(call, uid, gid);
osi_auditU(call, PTS_LstMaxEvent, code, AUD_END);
ViceLog(125, ("PTS_ListMax: code %d\n", code));
return code;
}
| @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,002 | SPR_ListOwned(struct rx_call *call, afs_int32 aid, prlist *alist,
afs_int32 *lastP)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = listOwned(call, aid, alist, lastP, &cid);
osi_auditU(call, PTS_LstOwnEvent, code, AUD_ID, aid, AUD_END);
ViceLog(125, ("PTS_ListOwned: code %d cid %d aid ... | Bypass | 0 | SPR_ListOwned(struct rx_call *call, afs_int32 aid, prlist *alist,
afs_int32 *lastP)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = listOwned(call, aid, alist, lastP, &cid);
osi_auditU(call, PTS_LstOwnEvent, code, AUD_ID, aid, AUD_END);
ViceLog(125, ("PTS_ListOwned: code %d cid %d aid ... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,003 | SPR_ListSuperGroups(struct rx_call *call, afs_int32 aid, prlist *alist,
afs_int32 *over)
{
#if defined(SUPERGROUPS)
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = listSuperGroups(call, aid, alist, over, &cid);
osi_auditU(call, PTS_LstSGrps, code, AUD_ID, aid, AUD_END);
ViceLog(125, ("PTS... | Bypass | 0 | SPR_ListSuperGroups(struct rx_call *call, afs_int32 aid, prlist *alist,
afs_int32 *over)
{
#if defined(SUPERGROUPS)
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = listSuperGroups(call, aid, alist, over, &cid);
osi_auditU(call, PTS_LstSGrps, code, AUD_ID, aid, AUD_END);
ViceLog(125, ("PTS... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,004 | SPR_NameToID(struct rx_call *call, namelist *aname, idlist *aid)
{
afs_int32 code;
code = nameToID(call, aname, aid);
osi_auditU(call, PTS_NmToIdEvent, code, AUD_END);
ViceLog(125, ("PTS_NameToID: code %d\n", code));
return code;
}
| Bypass | 0 | SPR_NameToID(struct rx_call *call, namelist *aname, idlist *aid)
{
afs_int32 code;
code = nameToID(call, aname, aid);
osi_auditU(call, PTS_NmToIdEvent, code, AUD_END);
ViceLog(125, ("PTS_NameToID: code %d\n", code));
return code;
}
| @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,005 | SPR_RemoveFromGroup(struct rx_call *call, afs_int32 aid, afs_int32 gid)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = removeFromGroup(call, aid, gid, &cid);
osi_auditU(call, PTS_RmFmGrpEvent, code, AUD_ID, gid, AUD_ID, aid,
AUD_END);
ViceLog(5, ("PTS_RemoveFromGroup: code %d cid %d ... | Bypass | 0 | SPR_RemoveFromGroup(struct rx_call *call, afs_int32 aid, afs_int32 gid)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = removeFromGroup(call, aid, gid, &cid);
osi_auditU(call, PTS_RmFmGrpEvent, code, AUD_ID, gid, AUD_ID, aid,
AUD_END);
ViceLog(5, ("PTS_RemoveFromGroup: code %d cid %d ... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,006 | SPR_SetFieldsEntry(struct rx_call *call,
afs_int32 id,
afs_int32 mask, /* specify which fields to update */
afs_int32 flags, afs_int32 ngroups, afs_int32 nusers,
afs_int32 spare1, afs_int32 spare2)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code =
setFieldsEntry(call, id, mask, fla... | Bypass | 0 | SPR_SetFieldsEntry(struct rx_call *call,
afs_int32 id,
afs_int32 mask, /* specify which fields to update */
afs_int32 flags, afs_int32 ngroups, afs_int32 nusers,
afs_int32 spare1, afs_int32 spare2)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code =
setFieldsEntry(call, id, mask, fla... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,007 | SPR_SetMax(struct rx_call *call, afs_int32 aid, afs_int32 gflag)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = setMax(call, aid, gflag, &cid);
osi_auditU(call, PTS_SetMaxEvent, code, AUD_ID, aid, AUD_LONG, gflag,
AUD_END);
ViceLog(125, ("PTS_SetMax: code %d cid %d aid %d gflag %d\n"... | Bypass | 0 | SPR_SetMax(struct rx_call *call, afs_int32 aid, afs_int32 gflag)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = setMax(call, aid, gflag, &cid);
osi_auditU(call, PTS_SetMaxEvent, code, AUD_ID, aid, AUD_LONG, gflag,
AUD_END);
ViceLog(125, ("PTS_SetMax: code %d cid %d aid %d gflag %d\n"... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,008 | SPR_UpdateEntry(struct rx_call *call, afs_int32 aid, char *name,
struct PrUpdateEntry *uentry)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = UpdateEntry(call, aid, name, uentry, &cid);
osi_auditU(call, PTS_UpdEntEvent, code, AUD_ID, aid, AUD_STR, name, AUD_END);
ViceLog(5, ("PTS_Up... | Bypass | 0 | SPR_UpdateEntry(struct rx_call *call, afs_int32 aid, char *name,
struct PrUpdateEntry *uentry)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = UpdateEntry(call, aid, name, uentry, &cid);
osi_auditU(call, PTS_UpdEntEvent, code, AUD_ID, aid, AUD_STR, name, AUD_END);
ViceLog(5, ("PTS_Up... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,009 | SPR_WhereIsIt(struct rx_call *call, afs_int32 aid, afs_int32 *apos)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = whereIsIt(call, aid, apos, &cid);
osi_auditU(call, PTS_WheIsItEvent, code, AUD_ID, aid, AUD_LONG, *apos,
AUD_END);
ViceLog(125, ("PTS_WhereIsIt: code %d cid %d aid %d ap... | Bypass | 0 | SPR_WhereIsIt(struct rx_call *call, afs_int32 aid, afs_int32 *apos)
{
afs_int32 code;
afs_int32 cid = ANONYMOUSID;
code = whereIsIt(call, aid, apos, &cid);
osi_auditU(call, PTS_WheIsItEvent, code, AUD_ID, aid, AUD_LONG, *apos,
AUD_END);
ViceLog(125, ("PTS_WhereIsIt: code %d cid %d aid %d ap... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,010 | UpdateEntry(struct rx_call *call, afs_int32 aid, char *name,
struct PrUpdateEntry *uentry, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
struct prentry tentry;
afs_int32 loc;
int id = 0;
code = Initdb();
if (code)
return code;
if (code != PRSUCCESS)
return code;
if... | Bypass | 0 | UpdateEntry(struct rx_call *call, afs_int32 aid, char *name,
struct PrUpdateEntry *uentry, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
struct prentry tentry;
afs_int32 loc;
int id = 0;
code = Initdb();
if (code)
return code;
if (code != PRSUCCESS)
return code;
if... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,011 | WhoIsThis(struct rx_call *acall, struct ubik_trans *at, afs_int32 *aid)
{
int foreign = 0;
/* aid is set to the identity of the caller, if known, else ANONYMOUSID */
/* returns -1 and sets aid to ANONYMOUSID on any failure */
struct rx_connection *tconn;
afs_int32 code;
char tcell[MAXKTCREALMLEN... | Bypass | 0 | WhoIsThis(struct rx_call *acall, struct ubik_trans *at, afs_int32 *aid)
{
int foreign = 0;
/* aid is set to the identity of the caller, if known, else ANONYMOUSID */
/* returns -1 and sets aid to ANONYMOUSID on any failure */
struct rx_connection *tconn;
afs_int32 code;
char tcell[MAXKTCREALMLEN... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,012 | WhoIsThisWithName(struct rx_call *acall, struct ubik_trans *at, afs_int32 *aid,
char *aname)
{
/* aid is set to the identity of the caller, if known, else ANONYMOUSID */
/* returns -1 and sets aid to ANONYMOUSID on any failure */
struct rx_connection *tconn;
afs_int32 code;
char tcell[MAXKTCREAL... | Bypass | 0 | WhoIsThisWithName(struct rx_call *acall, struct ubik_trans *at, afs_int32 *aid,
char *aname)
{
/* aid is set to the identity of the caller, if known, else ANONYMOUSID */
/* returns -1 and sets aid to ANONYMOUSID on any failure */
struct rx_connection *tconn;
afs_int32 code;
char tcell[MAXKTCREAL... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,013 | addToGroup(struct rx_call *call, afs_int32 aid, afs_int32 gid, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 tempu;
afs_int32 tempg;
struct prentry tentry;
struct prentry uentry;
code = Initdb();
if (code != PRSUCCESS)
return code;
if (gid == ANYUSERID || gid =... | Bypass | 0 | addToGroup(struct rx_call *call, afs_int32 aid, afs_int32 gid, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 tempu;
afs_int32 tempg;
struct prentry tentry;
struct prentry uentry;
code = Initdb();
if (code != PRSUCCESS)
return code;
if (gid == ANYUSERID || gid =... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,014 | addWildCards(struct ubik_trans *tt, prlist *alist, afs_uint32 host)
{
afs_int32 temp;
struct prentry tentry;
prlist wlist;
unsigned wild = htonl(0xffffff00);
struct in_addr iaddr;
afs_int32 hostid;
int size = 0, i, code;
int added = 0;
char hoststr[16];
while ((host = (host & wi... | Bypass | 0 | addWildCards(struct ubik_trans *tt, prlist *alist, afs_uint32 host)
{
afs_int32 temp;
struct prentry tentry;
prlist wlist;
unsigned wild = htonl(0xffffff00);
struct in_addr iaddr;
afs_int32 hostid;
int size = 0, i, code;
int added = 0;
char hoststr[16];
while ((host = (host & wi... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,015 | getCPS(struct rx_call *call, afs_int32 aid, prlist *alist, afs_int32 *over,
afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 temp;
struct prentry tentry;
*over = 0;
alist->prlist_len = 0;
alist->prlist_val = NULL;
code = Initdb();
if (code != PRSUCCESS)
ret... | Bypass | 0 | getCPS(struct rx_call *call, afs_int32 aid, prlist *alist, afs_int32 *over,
afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 temp;
struct prentry tentry;
*over = 0;
alist->prlist_len = 0;
alist->prlist_val = NULL;
code = Initdb();
if (code != PRSUCCESS)
ret... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,016 | getCPS2(struct rx_call *call, afs_int32 aid, afs_uint32 ahost, prlist *alist,
afs_int32 *over, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 temp;
struct prentry tentry;
struct prentry host_tentry;
afs_int32 hostid;
int host_list = 0;
struct in_addr iaddr;
char ... | Bypass | 0 | getCPS2(struct rx_call *call, afs_int32 aid, afs_uint32 ahost, prlist *alist,
afs_int32 *over, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 temp;
struct prentry tentry;
struct prentry host_tentry;
afs_int32 hostid;
int host_list = 0;
struct in_addr iaddr;
char ... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,017 | iNewEntry(struct rx_call *call, char aname[], afs_int32 aid, afs_int32 oid,
afs_int32 *cid)
{
/* used primarily for conversion - not intended to be used as usual means
* of entering people into the database. */
struct ubik_trans *tt;
afs_int32 code;
afs_int32 gflag = 0;
int admin;
stolo... | Bypass | 0 | iNewEntry(struct rx_call *call, char aname[], afs_int32 aid, afs_int32 oid,
afs_int32 *cid)
{
/* used primarily for conversion - not intended to be used as usual means
* of entering people into the database. */
struct ubik_trans *tt;
afs_int32 code;
afs_int32 gflag = 0;
int admin;
stolo... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,018 | idToName(struct rx_call *call, idlist *aid, namelist *aname)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 i;
int size;
int count = 0;
/* leave this first for rpc stub */
size = aid->idlist_len;
if (size == 0)
return 0;
if (size < 0 || size > INT_MAX / PR_MAXNAMELEN)
return P... | Bypass | 0 | idToName(struct rx_call *call, idlist *aid, namelist *aname)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 i;
int size;
int count = 0;
/* leave this first for rpc stub */
size = aid->idlist_len;
if (size == 0)
return 0;
if (size < 0 || size > INT_MAX / PR_MAXNAMELEN)
return P... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,019 | inCPS(prlist CPS, afs_int32 id)
{
int i;
for (i = (CPS.prlist_len - 1); i >= 0; i--) {
if (CPS.prlist_val[i] == id)
return (1);
}
return (0);
}
| Bypass | 0 | inCPS(prlist CPS, afs_int32 id)
{
int i;
for (i = (CPS.prlist_len - 1); i >= 0; i--) {
if (CPS.prlist_val[i] == id)
return (1);
}
return (0);
}
| @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,020 | isAMemberOf(struct rx_call *call, afs_int32 uid, afs_int32 gid, afs_int32 *flag,
afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
code = Initdb();
if (code != PRSUCCESS)
return code;
code = ubik_BeginTransReadAny(dbase, UBIK_READTRANS, &tt);
if (code)
return code;
code = ubik... | Bypass | 0 | isAMemberOf(struct rx_call *call, afs_int32 uid, afs_int32 gid, afs_int32 *flag,
afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
code = Initdb();
if (code != PRSUCCESS)
return code;
code = ubik_BeginTransReadAny(dbase, UBIK_READTRANS, &tt);
if (code)
return code;
code = ubik... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,021 | listElements(struct rx_call *call, afs_int32 aid, prlist *alist,
afs_int32 *over, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 temp;
struct prentry tentry;
*over = 0;
alist->prlist_len = 0;
alist->prlist_val = NULL;
code = Initdb();
if (code != PRSUCCESS... | Bypass | 0 | listElements(struct rx_call *call, afs_int32 aid, prlist *alist,
afs_int32 *over, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 temp;
struct prentry tentry;
*over = 0;
alist->prlist_len = 0;
alist->prlist_val = NULL;
code = Initdb();
if (code != PRSUCCESS... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,022 | listEntries(struct rx_call *call, afs_int32 flag, afs_int32 startindex,
prentries *bulkentries, afs_int32 *nextstartindex, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 i, eof, pos, maxentries, f;
struct prentry tentry;
afs_int32 pollcount = 0;
*nextstartindex = -1;
... | Bypass | 0 | listEntries(struct rx_call *call, afs_int32 flag, afs_int32 startindex,
prentries *bulkentries, afs_int32 *nextstartindex, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 i, eof, pos, maxentries, f;
struct prentry tentry;
afs_int32 pollcount = 0;
*nextstartindex = -1;
... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,023 | listEntry(struct rx_call *call, afs_int32 aid, struct prcheckentry *aentry,
afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 temp;
struct prentry tentry;
code = Initdb();
if (code != PRSUCCESS)
return code;
code = ubik_BeginTransReadAny(dbase, UBIK_READTRANS, &tt);
... | Bypass | 0 | listEntry(struct rx_call *call, afs_int32 aid, struct prcheckentry *aentry,
afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 temp;
struct prentry tentry;
code = Initdb();
if (code != PRSUCCESS)
return code;
code = ubik_BeginTransReadAny(dbase, UBIK_READTRANS, &tt);
... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,024 | listOwned(struct rx_call *call, afs_int32 aid, prlist *alist, afs_int32 *lastP,
afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
struct prentry tentry;
afs_int32 head = 0;
afs_int32 start;
alist->prlist_len = 0;
alist->prlist_val = NULL;
if (!lastP)
return PRBADARG;
sta... | Bypass | 0 | listOwned(struct rx_call *call, afs_int32 aid, prlist *alist, afs_int32 *lastP,
afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
struct prentry tentry;
afs_int32 head = 0;
afs_int32 start;
alist->prlist_len = 0;
alist->prlist_val = NULL;
if (!lastP)
return PRBADARG;
sta... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,025 | listSuperGroups(struct rx_call *call, afs_int32 aid, prlist *alist,
afs_int32 *over, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 temp;
struct prentry tentry;
alist->prlist_len = 0;
alist->prlist_val = (afs_int32 *) 0;
code = Initdb();
if (code != PRSUCCESS)
go... | Bypass | 0 | listSuperGroups(struct rx_call *call, afs_int32 aid, prlist *alist,
afs_int32 *over, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 temp;
struct prentry tentry;
alist->prlist_len = 0;
alist->prlist_val = (afs_int32 *) 0;
code = Initdb();
if (code != PRSUCCESS)
go... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,026 | nameToID(struct rx_call *call, namelist *aname, idlist *aid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 i;
int size;
int count = 0;
/* Initialize return struct */
aid->idlist_len = 0;
aid->idlist_val = NULL;
size = aname->namelist_len;
if (size == 0)
return 0;
if (... | Bypass | 0 | nameToID(struct rx_call *call, namelist *aname, idlist *aid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 i;
int size;
int count = 0;
/* Initialize return struct */
aid->idlist_len = 0;
aid->idlist_val = NULL;
size = aname->namelist_len;
if (size == 0)
return 0;
if (... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,027 | put_prentries(struct prentry *tentry, prentries *bulkentries)
{
struct prlistentries *entry;
if (bulkentries->prentries_val == 0) {
bulkentries->prentries_len = 0;
bulkentries->prentries_val =
(struct prlistentries *)malloc(PR_MAXENTRIES *
sizeof(struct prentry));
if (!bulkentries->prentries_va... | Bypass | 0 | put_prentries(struct prentry *tentry, prentries *bulkentries)
{
struct prlistentries *entry;
if (bulkentries->prentries_val == 0) {
bulkentries->prentries_len = 0;
bulkentries->prentries_val =
(struct prlistentries *)malloc(PR_MAXENTRIES *
sizeof(struct prentry));
if (!bulkentries->prentries_va... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,028 | removeFromGroup(struct rx_call *call, afs_int32 aid, afs_int32 gid,
afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 tempu;
afs_int32 tempg;
struct prentry uentry;
struct prentry gentry;
code = Initdb();
if (code != PRSUCCESS)
return code;
code = ubik_BeginTrans... | Bypass | 0 | removeFromGroup(struct rx_call *call, afs_int32 aid, afs_int32 gid,
afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 tempu;
afs_int32 tempg;
struct prentry uentry;
struct prentry gentry;
code = Initdb();
if (code != PRSUCCESS)
return code;
code = ubik_BeginTrans... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,029 | setFieldsEntry(struct rx_call *call,
afs_int32 id,
afs_int32 mask, /* specify which fields to update */
afs_int32 flags, afs_int32 ngroups, afs_int32 nusers,
afs_int32 spare1, afs_int32 spare2, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 pos;
struct... | Bypass | 0 | setFieldsEntry(struct rx_call *call,
afs_int32 id,
afs_int32 mask, /* specify which fields to update */
afs_int32 flags, afs_int32 ngroups, afs_int32 nusers,
afs_int32 spare1, afs_int32 spare2, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 pos;
struct... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,030 | setMax(struct rx_call *call, afs_int32 aid, afs_int32 gflag, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
code = Initdb();
if (code != PRSUCCESS)
return code;
code = ubik_BeginTrans(dbase, UBIK_WRITETRANS, &tt);
if (code)
return code;
code = ubik_SetLock(tt, 1, 1, LOCKWRITE);
... | Bypass | 0 | setMax(struct rx_call *call, afs_int32 aid, afs_int32 gflag, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
code = Initdb();
if (code != PRSUCCESS)
return code;
code = ubik_BeginTrans(dbase, UBIK_WRITETRANS, &tt);
if (code)
return code;
code = ubik_SetLock(tt, 1, 1, LOCKWRITE);
... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,031 | whereIsIt(struct rx_call *call, afs_int32 aid, afs_int32 *apos, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 temp;
code = Initdb();
if (code != PRSUCCESS)
return code;
code = ubik_BeginTransReadAny(dbase, UBIK_READTRANS, &tt);
if (code)
return code;
code = ubik_S... | Bypass | 0 | whereIsIt(struct rx_call *call, afs_int32 aid, afs_int32 *apos, afs_int32 *cid)
{
afs_int32 code;
struct ubik_trans *tt;
afs_int32 temp;
code = Initdb();
if (code != PRSUCCESS)
return code;
code = ubik_BeginTransReadAny(dbase, UBIK_READTRANS, &tt);
if (code)
return code;
code = ubik_S... | @@ -345,13 +345,19 @@ newEntry(struct rx_call *call, char aname[], afs_int32 flag, afs_int32 oid,
* automatic id assignment.
*/
code = WhoIsThisWithName(call, tt, cid, cname);
- if (code != 2) { /* 2 specifies that this is a foreign cell request */
- if (code)
- ABORT_WITH(... | CWE-284 | null | null |
10,032 | static void register_types(void)
{
type_register_static(&rng_backend_info);
}
| DoS Overflow Mem. Corr. | 0 | static void register_types(void)
{
type_register_static(&rng_backend_info);
}
| @@ -20,9 +20,20 @@ void rng_backend_request_entropy(RngBackend *s, size_t size,
void *opaque)
{
RngBackendClass *k = RNG_BACKEND_GET_CLASS(s);
+ RngRequest *req;
if (k->request_entropy) {
- k->request_entropy(s, size, receive_entropy, opaque);
+ req = g_ma... | CWE-119 | null | null |
10,033 | static void rng_backend_finalize(Object *obj)
{
RngBackend *s = RNG_BACKEND(obj);
rng_backend_free_requests(s);
}
| DoS Overflow Mem. Corr. | 0 | static void rng_backend_finalize(Object *obj)
{
RngBackend *s = RNG_BACKEND(obj);
rng_backend_free_requests(s);
}
| @@ -20,9 +20,20 @@ void rng_backend_request_entropy(RngBackend *s, size_t size,
void *opaque)
{
RngBackendClass *k = RNG_BACKEND_GET_CLASS(s);
+ RngRequest *req;
if (k->request_entropy) {
- k->request_entropy(s, size, receive_entropy, opaque);
+ req = g_ma... | CWE-119 | null | null |
10,034 | static void rng_backend_free_requests(RngBackend *s)
{
GSList *i;
for (i = s->requests; i; i = i->next) {
rng_backend_free_request(i->data);
}
g_slist_free(s->requests);
s->requests = NULL;
}
| DoS Overflow Mem. Corr. | 0 | static void rng_backend_free_requests(RngBackend *s)
{
GSList *i;
for (i = s->requests; i; i = i->next) {
rng_backend_free_request(i->data);
}
g_slist_free(s->requests);
s->requests = NULL;
}
| @@ -20,9 +20,20 @@ void rng_backend_request_entropy(RngBackend *s, size_t size,
void *opaque)
{
RngBackendClass *k = RNG_BACKEND_GET_CLASS(s);
+ RngRequest *req;
if (k->request_entropy) {
- k->request_entropy(s, size, receive_entropy, opaque);
+ req = g_ma... | CWE-119 | null | null |
10,035 | static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp)
{
RngBackend *s = RNG_BACKEND(obj);
RngBackendClass *k = RNG_BACKEND_GET_CLASS(s);
Error *local_err = NULL;
if (value == s->opened) {
return;
}
if (!value && s->opened) {
error_setg(errp, QERR_PERMIS... | DoS Overflow Mem. Corr. | 0 | static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp)
{
RngBackend *s = RNG_BACKEND(obj);
RngBackendClass *k = RNG_BACKEND_GET_CLASS(s);
Error *local_err = NULL;
if (value == s->opened) {
return;
}
if (!value && s->opened) {
error_setg(errp, QERR_PERMIS... | @@ -20,9 +20,20 @@ void rng_backend_request_entropy(RngBackend *s, size_t size,
void *opaque)
{
RngBackendClass *k = RNG_BACKEND_GET_CLASS(s);
+ RngRequest *req;
if (k->request_entropy) {
- k->request_entropy(s, size, receive_entropy, opaque);
+ req = g_ma... | CWE-119 | null | null |
10,036 | uint32_t net_checksum_add_cont(int len, uint8_t *buf, int seq)
{
uint32_t sum = 0;
int i;
for (i = seq; i < seq + len; i++) {
if (i & 1) {
sum += (uint32_t)buf[i - seq];
} else {
sum += (uint32_t)buf[i - seq] << 8;
}
}
return sum;
}
| DoS Overflow | 0 | uint32_t net_checksum_add_cont(int len, uint8_t *buf, int seq)
{
uint32_t sum = 0;
int i;
for (i = seq; i < seq + len; i++) {
if (i & 1) {
sum += (uint32_t)buf[i - seq];
} else {
sum += (uint32_t)buf[i - seq] << 8;
}
}
return sum;
}
| @@ -60,6 +60,11 @@ void net_checksum_calculate(uint8_t *data, int length)
int hlen, plen, proto, csum_offset;
uint16_t csum;
+ /* Ensure data has complete L2 & L3 headers. */
+ if (length < 14 + 20) {
+ return;
+ }
+
if ((data[14] & 0xf0) != 0x40)
return; /* not IPv4 */
hle... | CWE-119 | null | null |
10,037 | uint16_t net_checksum_finish(uint32_t sum)
{
while (sum>>16)
sum = (sum & 0xFFFF)+(sum >> 16);
return ~sum;
}
| DoS Overflow | 0 | uint16_t net_checksum_finish(uint32_t sum)
{
while (sum>>16)
sum = (sum & 0xFFFF)+(sum >> 16);
return ~sum;
}
| @@ -60,6 +60,11 @@ void net_checksum_calculate(uint8_t *data, int length)
int hlen, plen, proto, csum_offset;
uint16_t csum;
+ /* Ensure data has complete L2 & L3 headers. */
+ if (length < 14 + 20) {
+ return;
+ }
+
if ((data[14] & 0xf0) != 0x40)
return; /* not IPv4 */
hle... | CWE-119 | null | null |
10,038 | uint16_t net_checksum_tcpudp(uint16_t length, uint16_t proto,
uint8_t *addrs, uint8_t *buf)
{
uint32_t sum = 0;
sum += net_checksum_add(length, buf); // payload
sum += net_checksum_add(8, addrs); // src + dst address
sum += proto + length; ... | DoS Overflow | 0 | uint16_t net_checksum_tcpudp(uint16_t length, uint16_t proto,
uint8_t *addrs, uint8_t *buf)
{
uint32_t sum = 0;
sum += net_checksum_add(length, buf); // payload
sum += net_checksum_add(8, addrs); // src + dst address
sum += proto + length; ... | @@ -60,6 +60,11 @@ void net_checksum_calculate(uint8_t *data, int length)
int hlen, plen, proto, csum_offset;
uint16_t csum;
+ /* Ensure data has complete L2 & L3 headers. */
+ if (length < 14 + 20) {
+ return;
+ }
+
if ((data[14] & 0xf0) != 0x40)
return; /* not IPv4 */
hle... | CWE-119 | null | null |
10,039 | static uint32_t ne2000_asic_ioport_read(void *opaque, uint32_t addr)
{
NE2000State *s = opaque;
int ret;
if (s->dcfg & 0x01) {
/* 16 bit access */
ret = ne2000_mem_readw(s, s->rsar);
ne2000_dma_update(s, 2);
} else {
/* 8 bit access */
ret = ne2000_mem_readb(s, s... | DoS | 0 | static uint32_t ne2000_asic_ioport_read(void *opaque, uint32_t addr)
{
NE2000State *s = opaque;
int ret;
if (s->dcfg & 0x01) {
/* 16 bit access */
ret = ne2000_mem_readw(s, s->rsar);
ne2000_dma_update(s, 2);
} else {
/* 8 bit access */
ret = ne2000_mem_readb(s, s... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,040 | static uint32_t ne2000_asic_ioport_readl(void *opaque, uint32_t addr)
{
NE2000State *s = opaque;
int ret;
/* 32 bit access */
ret = ne2000_mem_readl(s, s->rsar);
ne2000_dma_update(s, 4);
#ifdef DEBUG_NE2000
printf("NE2000: asic readl val=0x%04x\n", ret);
#endif
return ret;
}
| DoS | 0 | static uint32_t ne2000_asic_ioport_readl(void *opaque, uint32_t addr)
{
NE2000State *s = opaque;
int ret;
/* 32 bit access */
ret = ne2000_mem_readl(s, s->rsar);
ne2000_dma_update(s, 4);
#ifdef DEBUG_NE2000
printf("NE2000: asic readl val=0x%04x\n", ret);
#endif
return ret;
}
| @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,041 | static void ne2000_asic_ioport_write(void *opaque, uint32_t addr, uint32_t val)
{
NE2000State *s = opaque;
#ifdef DEBUG_NE2000
printf("NE2000: asic write val=0x%04x\n", val);
#endif
if (s->rcnt == 0)
return;
if (s->dcfg & 0x01) {
/* 16 bit access */
ne2000_mem_writew(s, s->rsar,... | DoS | 0 | static void ne2000_asic_ioport_write(void *opaque, uint32_t addr, uint32_t val)
{
NE2000State *s = opaque;
#ifdef DEBUG_NE2000
printf("NE2000: asic write val=0x%04x\n", val);
#endif
if (s->rcnt == 0)
return;
if (s->dcfg & 0x01) {
/* 16 bit access */
ne2000_mem_writew(s, s->rsar,... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,042 | static void ne2000_asic_ioport_writel(void *opaque, uint32_t addr, uint32_t val)
{
NE2000State *s = opaque;
#ifdef DEBUG_NE2000
printf("NE2000: asic writel val=0x%04x\n", val);
#endif
if (s->rcnt == 0)
return;
/* 32 bit access */
ne2000_mem_writel(s, s->rsar, val);
ne2000_dma_update(s, ... | DoS | 0 | static void ne2000_asic_ioport_writel(void *opaque, uint32_t addr, uint32_t val)
{
NE2000State *s = opaque;
#ifdef DEBUG_NE2000
printf("NE2000: asic writel val=0x%04x\n", val);
#endif
if (s->rcnt == 0)
return;
/* 32 bit access */
ne2000_mem_writel(s, s->rsar, val);
ne2000_dma_update(s, ... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,043 | static void ne2000_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
k->realize = pci_ne2000_realize;
k->exit = pci_ne2000_exit;
k->romfile = "efi-ne2k_pci.rom",
k->vendor_id = PCI_VENDOR_ID_REALTEK;
k->device_id... | DoS | 0 | static void ne2000_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
k->realize = pci_ne2000_realize;
k->exit = pci_ne2000_exit;
k->romfile = "efi-ne2k_pci.rom",
k->vendor_id = PCI_VENDOR_ID_REALTEK;
k->device_id... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,044 | static inline void ne2000_dma_update(NE2000State *s, int len)
{
s->rsar += len;
/* wrap */
/* XXX: check what to do if rsar > stop */
if (s->rsar == s->stop)
s->rsar = s->start;
if (s->rcnt <= len) {
s->rcnt = 0;
/* signal end of transfer */
s->isr |= ENISR_RDC;
... | DoS | 0 | static inline void ne2000_dma_update(NE2000State *s, int len)
{
s->rsar += len;
/* wrap */
/* XXX: check what to do if rsar > stop */
if (s->rsar == s->stop)
s->rsar = s->start;
if (s->rcnt <= len) {
s->rcnt = 0;
/* signal end of transfer */
s->isr |= ENISR_RDC;
... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,045 | static void ne2000_instance_init(Object *obj)
{
PCIDevice *pci_dev = PCI_DEVICE(obj);
PCINE2000State *d = DO_UPCAST(PCINE2000State, dev, pci_dev);
NE2000State *s = &d->ne2000;
device_add_bootindex_property(obj, &s->c.bootindex,
"bootindex", "/ethernet-phy@0",
... | DoS | 0 | static void ne2000_instance_init(Object *obj)
{
PCIDevice *pci_dev = PCI_DEVICE(obj);
PCINE2000State *d = DO_UPCAST(PCINE2000State, dev, pci_dev);
NE2000State *s = &d->ne2000;
device_add_bootindex_property(obj, &s->c.bootindex,
"bootindex", "/ethernet-phy@0",
... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,046 | static uint32_t ne2000_ioport_read(void *opaque, uint32_t addr)
{
NE2000State *s = opaque;
int offset, page, ret;
addr &= 0xf;
if (addr == E8390_CMD) {
ret = s->cmd;
} else {
page = s->cmd >> 6;
offset = addr | (page << 4);
switch(offset) {
case EN0_TSR:
... | DoS | 0 | static uint32_t ne2000_ioport_read(void *opaque, uint32_t addr)
{
NE2000State *s = opaque;
int offset, page, ret;
addr &= 0xf;
if (addr == E8390_CMD) {
ret = s->cmd;
} else {
page = s->cmd >> 6;
offset = addr | (page << 4);
switch(offset) {
case EN0_TSR:
... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,047 | static void ne2000_ioport_write(void *opaque, uint32_t addr, uint32_t val)
{
NE2000State *s = opaque;
int offset, page, index;
addr &= 0xf;
#ifdef DEBUG_NE2000
printf("NE2000: write addr=0x%x val=0x%02x\n", addr, val);
#endif
if (addr == E8390_CMD) {
/* control register */
s->cmd = ... | DoS | 0 | static void ne2000_ioport_write(void *opaque, uint32_t addr, uint32_t val)
{
NE2000State *s = opaque;
int offset, page, index;
addr &= 0xf;
#ifdef DEBUG_NE2000
printf("NE2000: write addr=0x%x val=0x%02x\n", addr, val);
#endif
if (addr == E8390_CMD) {
/* control register */
s->cmd = ... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,048 | static inline uint32_t ne2000_mem_readb(NE2000State *s, uint32_t addr)
{
if (addr < 32 ||
(addr >= NE2000_PMEM_START && addr < NE2000_MEM_SIZE)) {
return s->mem[addr];
} else {
return 0xff;
}
}
| DoS | 0 | static inline uint32_t ne2000_mem_readb(NE2000State *s, uint32_t addr)
{
if (addr < 32 ||
(addr >= NE2000_PMEM_START && addr < NE2000_MEM_SIZE)) {
return s->mem[addr];
} else {
return 0xff;
}
}
| @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,049 | static inline uint32_t ne2000_mem_readl(NE2000State *s, uint32_t addr)
{
addr &= ~1; /* XXX: check exact behaviour if not even */
if (addr < 32
|| (addr >= NE2000_PMEM_START
&& addr + sizeof(uint32_t) <= NE2000_MEM_SIZE)) {
return ldl_le_p(s->mem + addr);
} else {
return ... | DoS | 0 | static inline uint32_t ne2000_mem_readl(NE2000State *s, uint32_t addr)
{
addr &= ~1; /* XXX: check exact behaviour if not even */
if (addr < 32
|| (addr >= NE2000_PMEM_START
&& addr + sizeof(uint32_t) <= NE2000_MEM_SIZE)) {
return ldl_le_p(s->mem + addr);
} else {
return ... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,050 | static inline uint32_t ne2000_mem_readw(NE2000State *s, uint32_t addr)
{
addr &= ~1; /* XXX: check exact behaviour if not even */
if (addr < 32 ||
(addr >= NE2000_PMEM_START && addr < NE2000_MEM_SIZE)) {
return le16_to_cpu(*(uint16_t *)(s->mem + addr));
} else {
return 0xffff;
}
... | DoS | 0 | static inline uint32_t ne2000_mem_readw(NE2000State *s, uint32_t addr)
{
addr &= ~1; /* XXX: check exact behaviour if not even */
if (addr < 32 ||
(addr >= NE2000_PMEM_START && addr < NE2000_MEM_SIZE)) {
return le16_to_cpu(*(uint16_t *)(s->mem + addr));
} else {
return 0xffff;
}
... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,051 | static inline void ne2000_mem_writel(NE2000State *s, uint32_t addr,
uint32_t val)
{
addr &= ~1; /* XXX: check exact behaviour if not even */
if (addr < 32
|| (addr >= NE2000_PMEM_START
&& addr + sizeof(uint32_t) <= NE2000_MEM_SIZE)) {
stl_le_p(s->... | DoS | 0 | static inline void ne2000_mem_writel(NE2000State *s, uint32_t addr,
uint32_t val)
{
addr &= ~1; /* XXX: check exact behaviour if not even */
if (addr < 32
|| (addr >= NE2000_PMEM_START
&& addr + sizeof(uint32_t) <= NE2000_MEM_SIZE)) {
stl_le_p(s->... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,052 | static inline void ne2000_mem_writew(NE2000State *s, uint32_t addr,
uint32_t val)
{
addr &= ~1; /* XXX: check exact behaviour if not even */
if (addr < 32 ||
(addr >= NE2000_PMEM_START && addr < NE2000_MEM_SIZE)) {
*(uint16_t *)(s->mem + addr) = cpu_to_le16(v... | DoS | 0 | static inline void ne2000_mem_writew(NE2000State *s, uint32_t addr,
uint32_t val)
{
addr &= ~1; /* XXX: check exact behaviour if not even */
if (addr < 32 ||
(addr >= NE2000_PMEM_START && addr < NE2000_MEM_SIZE)) {
*(uint16_t *)(s->mem + addr) = cpu_to_le16(v... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,053 | static int ne2000_post_load(void* opaque, int version_id)
{
NE2000State* s = opaque;
if (version_id < 2) {
s->rxcr = 0x0c;
}
return 0;
}
| DoS | 0 | static int ne2000_post_load(void* opaque, int version_id)
{
NE2000State* s = opaque;
if (version_id < 2) {
s->rxcr = 0x0c;
}
return 0;
}
| @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,054 | ssize_t ne2000_receive(NetClientState *nc, const uint8_t *buf, size_t size_)
{
NE2000State *s = qemu_get_nic_opaque(nc);
int size = size_;
uint8_t *p;
unsigned int total_len, next, avail, len, index, mcast_idx;
uint8_t buf1[60];
static const uint8_t broadcast_macaddr[6] =
{ 0xff, 0xff, 0... | DoS | 0 | ssize_t ne2000_receive(NetClientState *nc, const uint8_t *buf, size_t size_)
{
NE2000State *s = qemu_get_nic_opaque(nc);
int size = size_;
uint8_t *p;
unsigned int total_len, next, avail, len, index, mcast_idx;
uint8_t buf1[60];
static const uint8_t broadcast_macaddr[6] =
{ 0xff, 0xff, 0... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,055 | static void ne2000_register_types(void)
{
type_register_static(&ne2000_info);
}
| DoS | 0 | static void ne2000_register_types(void)
{
type_register_static(&ne2000_info);
}
| @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,056 | void ne2000_reset(NE2000State *s)
{
int i;
s->isr = ENISR_RESET;
memcpy(s->mem, &s->c.macaddr, 6);
s->mem[14] = 0x57;
s->mem[15] = 0x57;
/* duplicate prom data */
for(i = 15;i >= 0; i--) {
s->mem[2 * i] = s->mem[i];
s->mem[2 * i + 1] = s->mem[i];
}
}
| DoS | 0 | void ne2000_reset(NE2000State *s)
{
int i;
s->isr = ENISR_RESET;
memcpy(s->mem, &s->c.macaddr, 6);
s->mem[14] = 0x57;
s->mem[15] = 0x57;
/* duplicate prom data */
for(i = 15;i >= 0; i--) {
s->mem[2 * i] = s->mem[i];
s->mem[2 * i + 1] = s->mem[i];
}
}
| @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,057 | static uint32_t ne2000_reset_ioport_read(void *opaque, uint32_t addr)
{
NE2000State *s = opaque;
ne2000_reset(s);
return 0;
}
| DoS | 0 | static uint32_t ne2000_reset_ioport_read(void *opaque, uint32_t addr)
{
NE2000State *s = opaque;
ne2000_reset(s);
return 0;
}
| @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,058 | void ne2000_setup_io(NE2000State *s, DeviceState *dev, unsigned size)
{
memory_region_init_io(&s->io, OBJECT(dev), &ne2000_ops, s, "ne2000", size);
}
| DoS | 0 | void ne2000_setup_io(NE2000State *s, DeviceState *dev, unsigned size)
{
memory_region_init_io(&s->io, OBJECT(dev), &ne2000_ops, s, "ne2000", size);
}
| @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,059 | static void ne2000_update_irq(NE2000State *s)
{
int isr;
isr = (s->isr & s->imr) & 0x7f;
#if defined(DEBUG_NE2000)
printf("NE2000: Set IRQ to %d (%02x %02x)\n",
isr ? 1 : 0, s->isr, s->imr);
#endif
qemu_set_irq(s->irq, (isr != 0));
}
| DoS | 0 | static void ne2000_update_irq(NE2000State *s)
{
int isr;
isr = (s->isr & s->imr) & 0x7f;
#if defined(DEBUG_NE2000)
printf("NE2000: Set IRQ to %d (%02x %02x)\n",
isr ? 1 : 0, s->isr, s->imr);
#endif
qemu_set_irq(s->irq, (isr != 0));
}
| @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,060 | static void ne2000_write(void *opaque, hwaddr addr,
uint64_t data, unsigned size)
{
NE2000State *s = opaque;
if (addr < 0x10 && size == 1) {
ne2000_ioport_write(s, addr, data);
} else if (addr == 0x10) {
if (size <= 2) {
ne2000_asic_ioport_write(s, addr,... | DoS | 0 | static void ne2000_write(void *opaque, hwaddr addr,
uint64_t data, unsigned size)
{
NE2000State *s = opaque;
if (addr < 0x10 && size == 1) {
ne2000_ioport_write(s, addr, data);
} else if (addr == 0x10) {
if (size <= 2) {
ne2000_asic_ioport_write(s, addr,... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,061 | static void pci_ne2000_realize(PCIDevice *pci_dev, Error **errp)
{
PCINE2000State *d = DO_UPCAST(PCINE2000State, dev, pci_dev);
NE2000State *s;
uint8_t *pci_conf;
pci_conf = d->dev.config;
pci_conf[PCI_INTERRUPT_PIN] = 1; /* interrupt pin A */
s = &d->ne2000;
ne2000_setup_io(s, DEVICE(pci_... | DoS | 0 | static void pci_ne2000_realize(PCIDevice *pci_dev, Error **errp)
{
PCINE2000State *d = DO_UPCAST(PCINE2000State, dev, pci_dev);
NE2000State *s;
uint8_t *pci_conf;
pci_conf = d->dev.config;
pci_conf[PCI_INTERRUPT_PIN] = 1; /* interrupt pin A */
s = &d->ne2000;
ne2000_setup_io(s, DEVICE(pci_... | @@ -155,6 +155,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary) | CWE-20 | null | null |
10,062 | static int is_rndis(USBNetState *s)
{
return s->dev.config ?
s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
| DoS Overflow +Info | 0 | static int is_rndis(USBNetState *s)
{
return s->dev.config ?
s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
| @@ -916,8 +916,9 @@ static int rndis_query_response(USBNetState *s,
bufoffs = le32_to_cpu(buf->InformationBufferOffset) + 8;
buflen = le32_to_cpu(buf->InformationBufferLength);
- if (bufoffs + buflen > length)
+ if (buflen > length || bufoffs >= length || bufoffs + buflen > length) {
return U... | CWE-189 | null | null |
10,063 | static int ndis_set(USBNetState *s, uint32_t oid,
uint8_t *inbuf, unsigned int inlen)
{
switch (oid) {
case OID_GEN_CURRENT_PACKET_FILTER:
s->filter = le32_to_cpup((le32 *) inbuf);
if (s->filter) {
s->rndis_state = RNDIS_DATA_INITIALIZED;
} else {
... | DoS Overflow +Info | 0 | static int ndis_set(USBNetState *s, uint32_t oid,
uint8_t *inbuf, unsigned int inlen)
{
switch (oid) {
case OID_GEN_CURRENT_PACKET_FILTER:
s->filter = le32_to_cpup((le32 *) inbuf);
if (s->filter) {
s->rndis_state = RNDIS_DATA_INITIALIZED;
} else {
... | @@ -916,8 +916,9 @@ static int rndis_query_response(USBNetState *s,
bufoffs = le32_to_cpu(buf->InformationBufferOffset) + 8;
buflen = le32_to_cpu(buf->InformationBufferLength);
- if (bufoffs + buflen > length)
+ if (buflen > length || bufoffs >= length || bufoffs + buflen > length) {
return U... | CWE-189 | null | null |
10,064 | static void rndis_clear_responsequeue(USBNetState *s)
{
struct rndis_response *r;
while ((r = s->rndis_resp.tqh_first)) {
QTAILQ_REMOVE(&s->rndis_resp, r, entries);
g_free(r);
}
}
| DoS Overflow +Info | 0 | static void rndis_clear_responsequeue(USBNetState *s)
{
struct rndis_response *r;
while ((r = s->rndis_resp.tqh_first)) {
QTAILQ_REMOVE(&s->rndis_resp, r, entries);
g_free(r);
}
}
| @@ -916,8 +916,9 @@ static int rndis_query_response(USBNetState *s,
bufoffs = le32_to_cpu(buf->InformationBufferOffset) + 8;
buflen = le32_to_cpu(buf->InformationBufferLength);
- if (bufoffs + buflen > length)
+ if (buflen > length || bufoffs >= length || bufoffs + buflen > length) {
return U... | CWE-189 | null | null |
10,065 | static int rndis_get_response(USBNetState *s, uint8_t *buf)
{
int ret = 0;
struct rndis_response *r = s->rndis_resp.tqh_first;
if (!r)
return ret;
QTAILQ_REMOVE(&s->rndis_resp, r, entries);
ret = r->length;
memcpy(buf, r->buf, r->length);
g_free(r);
return ret;
}
| DoS Overflow +Info | 0 | static int rndis_get_response(USBNetState *s, uint8_t *buf)
{
int ret = 0;
struct rndis_response *r = s->rndis_resp.tqh_first;
if (!r)
return ret;
QTAILQ_REMOVE(&s->rndis_resp, r, entries);
ret = r->length;
memcpy(buf, r->buf, r->length);
g_free(r);
return ret;
}
| @@ -916,8 +916,9 @@ static int rndis_query_response(USBNetState *s,
bufoffs = le32_to_cpu(buf->InformationBufferOffset) + 8;
buflen = le32_to_cpu(buf->InformationBufferLength);
- if (bufoffs + buflen > length)
+ if (buflen > length || bufoffs >= length || bufoffs + buflen > length) {
return U... | CWE-189 | null | null |
10,066 | static int rndis_init_response(USBNetState *s, rndis_init_msg_type *buf)
{
rndis_init_cmplt_type *resp =
rndis_queue_response(s, sizeof(rndis_init_cmplt_type));
if (!resp)
return USB_RET_STALL;
resp->MessageType = cpu_to_le32(RNDIS_INITIALIZE_CMPLT);
resp->MessageLength = cpu_to_le... | DoS Overflow +Info | 0 | static int rndis_init_response(USBNetState *s, rndis_init_msg_type *buf)
{
rndis_init_cmplt_type *resp =
rndis_queue_response(s, sizeof(rndis_init_cmplt_type));
if (!resp)
return USB_RET_STALL;
resp->MessageType = cpu_to_le32(RNDIS_INITIALIZE_CMPLT);
resp->MessageLength = cpu_to_le... | @@ -916,8 +916,9 @@ static int rndis_query_response(USBNetState *s,
bufoffs = le32_to_cpu(buf->InformationBufferOffset) + 8;
buflen = le32_to_cpu(buf->InformationBufferLength);
- if (bufoffs + buflen > length)
+ if (buflen > length || bufoffs >= length || bufoffs + buflen > length) {
return U... | CWE-189 | null | null |
10,067 | static int rndis_keepalive_response(USBNetState *s,
rndis_keepalive_msg_type *buf)
{
rndis_keepalive_cmplt_type *resp =
rndis_queue_response(s, sizeof(rndis_keepalive_cmplt_type));
if (!resp)
return USB_RET_STALL;
resp->MessageType = cpu_to_le32(RNDIS_KEEPALIVE_CMPLT);
... | DoS Overflow +Info | 0 | static int rndis_keepalive_response(USBNetState *s,
rndis_keepalive_msg_type *buf)
{
rndis_keepalive_cmplt_type *resp =
rndis_queue_response(s, sizeof(rndis_keepalive_cmplt_type));
if (!resp)
return USB_RET_STALL;
resp->MessageType = cpu_to_le32(RNDIS_KEEPALIVE_CMPLT);
... | @@ -916,8 +916,9 @@ static int rndis_query_response(USBNetState *s,
bufoffs = le32_to_cpu(buf->InformationBufferOffset) + 8;
buflen = le32_to_cpu(buf->InformationBufferLength);
- if (bufoffs + buflen > length)
+ if (buflen > length || bufoffs >= length || bufoffs + buflen > length) {
return U... | CWE-189 | null | null |
10,068 | static int rndis_parse(USBNetState *s, uint8_t *data, int length)
{
uint32_t msg_type;
le32 *tmp = (le32 *) data;
msg_type = le32_to_cpup(tmp);
switch (msg_type) {
case RNDIS_INITIALIZE_MSG:
s->rndis_state = RNDIS_INITIALIZED;
return rndis_init_response(s, (rndis_init_msg_type *) d... | DoS Overflow +Info | 0 | static int rndis_parse(USBNetState *s, uint8_t *data, int length)
{
uint32_t msg_type;
le32 *tmp = (le32 *) data;
msg_type = le32_to_cpup(tmp);
switch (msg_type) {
case RNDIS_INITIALIZE_MSG:
s->rndis_state = RNDIS_INITIALIZED;
return rndis_init_response(s, (rndis_init_msg_type *) d... | @@ -916,8 +916,9 @@ static int rndis_query_response(USBNetState *s,
bufoffs = le32_to_cpu(buf->InformationBufferOffset) + 8;
buflen = le32_to_cpu(buf->InformationBufferLength);
- if (bufoffs + buflen > length)
+ if (buflen > length || bufoffs >= length || bufoffs + buflen > length) {
return U... | CWE-189 | null | null |
10,069 | static void *rndis_queue_response(USBNetState *s, unsigned int length)
{
struct rndis_response *r =
g_malloc0(sizeof(struct rndis_response) + length);
if (QTAILQ_EMPTY(&s->rndis_resp)) {
usb_wakeup(s->intr, 0);
}
QTAILQ_INSERT_TAIL(&s->rndis_resp, r, entries);
r->length = lengt... | DoS Overflow +Info | 0 | static void *rndis_queue_response(USBNetState *s, unsigned int length)
{
struct rndis_response *r =
g_malloc0(sizeof(struct rndis_response) + length);
if (QTAILQ_EMPTY(&s->rndis_resp)) {
usb_wakeup(s->intr, 0);
}
QTAILQ_INSERT_TAIL(&s->rndis_resp, r, entries);
r->length = lengt... | @@ -916,8 +916,9 @@ static int rndis_query_response(USBNetState *s,
bufoffs = le32_to_cpu(buf->InformationBufferOffset) + 8;
buflen = le32_to_cpu(buf->InformationBufferLength);
- if (bufoffs + buflen > length)
+ if (buflen > length || bufoffs >= length || bufoffs + buflen > length) {
return U... | CWE-189 | null | null |
10,070 | static int rndis_reset_response(USBNetState *s, rndis_reset_msg_type *buf)
{
rndis_reset_cmplt_type *resp =
rndis_queue_response(s, sizeof(rndis_reset_cmplt_type));
if (!resp)
return USB_RET_STALL;
resp->MessageType = cpu_to_le32(RNDIS_RESET_CMPLT);
resp->MessageLength = cpu_to_le3... | DoS Overflow +Info | 0 | static int rndis_reset_response(USBNetState *s, rndis_reset_msg_type *buf)
{
rndis_reset_cmplt_type *resp =
rndis_queue_response(s, sizeof(rndis_reset_cmplt_type));
if (!resp)
return USB_RET_STALL;
resp->MessageType = cpu_to_le32(RNDIS_RESET_CMPLT);
resp->MessageLength = cpu_to_le3... | @@ -916,8 +916,9 @@ static int rndis_query_response(USBNetState *s,
bufoffs = le32_to_cpu(buf->InformationBufferOffset) + 8;
buflen = le32_to_cpu(buf->InformationBufferLength);
- if (bufoffs + buflen > length)
+ if (buflen > length || bufoffs >= length || bufoffs + buflen > length) {
return U... | CWE-189 | null | null |
10,071 | static void usb_net_handle_control(USBDevice *dev, USBPacket *p,
int request, int value, int index, int length, uint8_t *data)
{
USBNetState *s = (USBNetState *) dev;
int ret;
ret = usb_desc_handle_control(dev, p, request, value, index, length, data);
if (ret >= 0) {
return;
... | DoS Overflow +Info | 0 | static void usb_net_handle_control(USBDevice *dev, USBPacket *p,
int request, int value, int index, int length, uint8_t *data)
{
USBNetState *s = (USBNetState *) dev;
int ret;
ret = usb_desc_handle_control(dev, p, request, value, index, length, data);
if (ret >= 0) {
return;
... | @@ -916,8 +916,9 @@ static int rndis_query_response(USBNetState *s,
bufoffs = le32_to_cpu(buf->InformationBufferOffset) + 8;
buflen = le32_to_cpu(buf->InformationBufferLength);
- if (bufoffs + buflen > length)
+ if (buflen > length || bufoffs >= length || bufoffs + buflen > length) {
return U... | CWE-189 | null | null |
10,072 | static void usb_net_handle_datain(USBNetState *s, USBPacket *p)
{
int len;
if (s->in_ptr > s->in_len) {
usb_net_reset_in_buf(s);
p->status = USB_RET_NAK;
return;
}
if (!s->in_len) {
p->status = USB_RET_NAK;
return;
}
len = s->in_len - s->in_ptr;
if (l... | DoS Overflow +Info | 0 | static void usb_net_handle_datain(USBNetState *s, USBPacket *p)
{
int len;
if (s->in_ptr > s->in_len) {
usb_net_reset_in_buf(s);
p->status = USB_RET_NAK;
return;
}
if (!s->in_len) {
p->status = USB_RET_NAK;
return;
}
len = s->in_len - s->in_ptr;
if (l... | @@ -916,8 +916,9 @@ static int rndis_query_response(USBNetState *s,
bufoffs = le32_to_cpu(buf->InformationBufferOffset) + 8;
buflen = le32_to_cpu(buf->InformationBufferLength);
- if (bufoffs + buflen > length)
+ if (buflen > length || bufoffs >= length || bufoffs + buflen > length) {
return U... | CWE-189 | null | null |
10,073 | static int ndis_query(USBNetState *s, uint32_t oid,
size_t outlen)
{
unsigned int i;
switch (oid) {
/* general oids (table 4-1) */
/* mandatory */
case OID_GEN_SUPPORTED_LIST:
for (i = 0; i < ARRAY_SIZE(oid_supported_list); i++)
((le32 *) outbuf)[i] = cpu_... | DoS | 0 | static int ndis_query(USBNetState *s, uint32_t oid,
size_t outlen)
{
unsigned int i;
switch (oid) {
/* general oids (table 4-1) */
/* mandatory */
case OID_GEN_SUPPORTED_LIST:
for (i = 0; i < ARRAY_SIZE(oid_supported_list); i++)
((le32 *) outbuf)[i] = cpu_... | @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,074 | static int rndis_set_response(USBNetState *s,
rndis_set_msg_type *buf, unsigned int length)
{
rndis_set_cmplt_type *resp =
rndis_queue_response(s, sizeof(rndis_set_cmplt_type));
uint32_t bufoffs, buflen;
int ret;
if (!resp)
return USB_RET_STALL;
bufoffs = le32_t... | DoS | 0 | static int rndis_set_response(USBNetState *s,
rndis_set_msg_type *buf, unsigned int length)
{
rndis_set_cmplt_type *resp =
rndis_queue_response(s, sizeof(rndis_set_cmplt_type));
uint32_t bufoffs, buflen;
int ret;
if (!resp)
return USB_RET_STALL;
bufoffs = le32_t... | @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,075 | static void usb_net_class_initfn(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
uc->realize = usb_net_realize;
uc->product_desc = "QEMU USB Network Interface";
uc->usb_desc = &desc_net;
uc->handle_reset = u... | DoS | 0 | static void usb_net_class_initfn(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
uc->realize = usb_net_realize;
uc->product_desc = "QEMU USB Network Interface";
uc->usb_desc = &desc_net;
uc->handle_reset = u... | @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,076 | static void usb_net_handle_data(USBDevice *dev, USBPacket *p)
{
USBNetState *s = (USBNetState *) dev;
switch(p->pid) {
case USB_TOKEN_IN:
switch (p->ep->nr) {
case 1:
usb_net_handle_statusin(s, p);
break;
case 2:
usb_net_handle_datain(s, p);
... | DoS | 0 | static void usb_net_handle_data(USBDevice *dev, USBPacket *p)
{
USBNetState *s = (USBNetState *) dev;
switch(p->pid) {
case USB_TOKEN_IN:
switch (p->ep->nr) {
case 1:
usb_net_handle_statusin(s, p);
break;
case 2:
usb_net_handle_datain(s, p);
... | @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,077 | static void usb_net_handle_dataout(USBNetState *s, USBPacket *p)
{
int sz = sizeof(s->out_buf) - s->out_ptr;
struct rndis_packet_msg_type *msg =
(struct rndis_packet_msg_type *) s->out_buf;
uint32_t len;
#ifdef TRAFFIC_DEBUG
fprintf(stderr, "usbnet: data out len %zu\n", p->iov.size);
io... | DoS | 0 | static void usb_net_handle_dataout(USBNetState *s, USBPacket *p)
{
int sz = sizeof(s->out_buf) - s->out_ptr;
struct rndis_packet_msg_type *msg =
(struct rndis_packet_msg_type *) s->out_buf;
uint32_t len;
#ifdef TRAFFIC_DEBUG
fprintf(stderr, "usbnet: data out len %zu\n", p->iov.size);
io... | @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,078 | static void usb_net_handle_destroy(USBDevice *dev)
{
USBNetState *s = (USBNetState *) dev;
/* TODO: remove the nd_table[] entry */
rndis_clear_responsequeue(s);
qemu_del_nic(s->nic);
}
| DoS | 0 | static void usb_net_handle_destroy(USBDevice *dev)
{
USBNetState *s = (USBNetState *) dev;
/* TODO: remove the nd_table[] entry */
rndis_clear_responsequeue(s);
qemu_del_nic(s->nic);
}
| @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,079 | static void usb_net_handle_reset(USBDevice *dev)
{
}
| DoS | 0 | static void usb_net_handle_reset(USBDevice *dev)
{
}
| @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,080 | static void usb_net_handle_statusin(USBNetState *s, USBPacket *p)
{
le32 buf[2];
if (p->iov.size < 8) {
p->status = USB_RET_STALL;
return;
}
buf[0] = cpu_to_le32(1);
buf[1] = cpu_to_le32(0);
usb_packet_copy(p, buf, 8);
if (!s->rndis_resp.tqh_first) {
p->status = USB... | DoS | 0 | static void usb_net_handle_statusin(USBNetState *s, USBPacket *p)
{
le32 buf[2];
if (p->iov.size < 8) {
p->status = USB_RET_STALL;
return;
}
buf[0] = cpu_to_le32(1);
buf[1] = cpu_to_le32(0);
usb_packet_copy(p, buf, 8);
if (!s->rndis_resp.tqh_first) {
p->status = USB... | @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,081 | static USBDevice *usb_net_init(USBBus *bus, const char *cmdline)
{
Error *local_err = NULL;
USBDevice *dev;
QemuOpts *opts;
int idx;
opts = qemu_opts_parse_noisily(qemu_find_opts("net"), cmdline, false);
if (!opts) {
return NULL;
}
qemu_opt_set(opts, "type", "nic", &error_abort)... | DoS | 0 | static USBDevice *usb_net_init(USBBus *bus, const char *cmdline)
{
Error *local_err = NULL;
USBDevice *dev;
QemuOpts *opts;
int idx;
opts = qemu_opts_parse_noisily(qemu_find_opts("net"), cmdline, false);
if (!opts) {
return NULL;
}
qemu_opt_set(opts, "type", "nic", &error_abort)... | @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,082 | static void usb_net_instance_init(Object *obj)
{
USBDevice *dev = USB_DEVICE(obj);
USBNetState *s = USB_NET(dev);
device_add_bootindex_property(obj, &s->conf.bootindex,
"bootindex", "/ethernet-phy@0",
&dev->qdev, NULL);
}
| DoS | 0 | static void usb_net_instance_init(Object *obj)
{
USBDevice *dev = USB_DEVICE(obj);
USBNetState *s = USB_NET(dev);
device_add_bootindex_property(obj, &s->conf.bootindex,
"bootindex", "/ethernet-phy@0",
&dev->qdev, NULL);
}
| @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,083 | static void usb_net_realize(USBDevice *dev, Error **errrp)
{
USBNetState *s = USB_NET(dev);
usb_desc_create_serial(dev);
usb_desc_init(dev);
s->rndis_state = RNDIS_UNINITIALIZED;
QTAILQ_INIT(&s->rndis_resp);
s->medium = 0; /* NDIS_MEDIUM_802_3 */
s->speed = 1000000; /* 100MBps, in 100Bps ... | DoS | 0 | static void usb_net_realize(USBDevice *dev, Error **errrp)
{
USBNetState *s = USB_NET(dev);
usb_desc_create_serial(dev);
usb_desc_init(dev);
s->rndis_state = RNDIS_UNINITIALIZED;
QTAILQ_INIT(&s->rndis_resp);
s->medium = 0; /* NDIS_MEDIUM_802_3 */
s->speed = 1000000; /* 100MBps, in 100Bps ... | @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,084 | static void usb_net_register_types(void)
{
type_register_static(&net_info);
usb_legacy_register(TYPE_USB_NET, "net", usb_net_init);
}
| DoS | 0 | static void usb_net_register_types(void)
{
type_register_static(&net_info);
usb_legacy_register(TYPE_USB_NET, "net", usb_net_init);
}
| @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,085 | static void usb_net_reset_in_buf(USBNetState *s)
{
s->in_ptr = s->in_len = 0;
qemu_flush_queued_packets(qemu_get_queue(s->nic));
}
| DoS | 0 | static void usb_net_reset_in_buf(USBNetState *s)
{
s->in_ptr = s->in_len = 0;
qemu_flush_queued_packets(qemu_get_queue(s->nic));
}
| @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,086 | static void usbnet_cleanup(NetClientState *nc)
{
USBNetState *s = qemu_get_nic_opaque(nc);
s->nic = NULL;
}
| DoS | 0 | static void usbnet_cleanup(NetClientState *nc)
{
USBNetState *s = qemu_get_nic_opaque(nc);
s->nic = NULL;
}
| @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,087 | static ssize_t usbnet_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
USBNetState *s = qemu_get_nic_opaque(nc);
uint8_t *in_buf = s->in_buf;
size_t total_size = size;
if (!s->dev.config) {
return -1;
}
if (is_rndis(s)) {
if (s->rndis_state != RNDIS_DATA_INITIALIZ... | DoS | 0 | static ssize_t usbnet_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
USBNetState *s = qemu_get_nic_opaque(nc);
uint8_t *in_buf = s->in_buf;
size_t total_size = size;
if (!s->dev.config) {
return -1;
}
if (is_rndis(s)) {
if (s->rndis_state != RNDIS_DATA_INITIALIZ... | @@ -654,7 +654,8 @@ typedef struct USBNetState {
static int is_rndis(USBNetState *s)
{
- return s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE;
+ return s->dev.config ?
+ s->dev.config->bConfigurationValue == DEV_RNDIS_CONFIG_VALUE : 0;
}
static int ndis_query(USBNetState *s, uint... | null | null | null |
10,088 | static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
int completion)
{
int dir;
size_t len = 0;
const char *str = NULL;
int pid;
int ret;
int i;
USBDevice *dev;
USBEndpoint *ep;
struct ohci_iso_td iso_td;
uint32_t addr;
uint16_t s... | DoS | 0 | static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
int completion)
{
int dir;
size_t len = 0;
const char *str = NULL;
int pid;
int ret;
int i;
USBDevice *dev;
USBEndpoint *ep;
struct ohci_iso_td iso_td;
uint32_t addr;
uint16_t s... | @@ -1347,16 +1347,6 @@ static void ohci_frame_boundary(void *opaque)
*/
static int ohci_bus_start(OHCIState *ohci)
{
- ohci->eof_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
- ohci_frame_boundary,
- ohci);
-
- if (ohci->eof_timer == NULL) {
- trace_usb_ohci_bus_eof_tim... | null | null | null |
10,089 | DEFUN (vpnv4_network,
vpnv4_network_cmd,
"network A.B.C.D/M rd ASN:nn_or_IP-address:nn tag WORD",
"Specify a network to announce via BGP\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"Specify Route Distinguisher\n"
"VPN Route Distinguisher\n"
"BGP tag\n"
"... | DoS Exec Code Overflow | 0 | DEFUN (vpnv4_network,
vpnv4_network_cmd,
"network A.B.C.D/M rd ASN:nn_or_IP-address:nn tag WORD",
"Specify a network to announce via BGP\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"Specify Route Distinguisher\n"
"VPN Route Distinguisher\n"
"BGP tag\n"
"... | @@ -101,6 +101,7 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
pnt = packet->nlri;
lim = pnt + packet->length;
+#define VPN_PREFIXLEN_MIN_BYTES (3 + 8) /* label + RD */
for (; pnt < lim; pnt += psize)
{
/* Clear prefix structure. */
@@ -108,17 +109,38 @@ bgp_nlri_parse_vpnv4 (str... | CWE-119 | null | null |
10,090 | DEFUN (no_vpnv4_network,
no_vpnv4_network_cmd,
"no network A.B.C.D/M rd ASN:nn_or_IP-address:nn tag WORD",
NO_STR
"Specify a network to announce via BGP\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"Specify Route Distinguisher\n"
"VPN Route Distinguisher\n"
... | DoS Exec Code Overflow | 0 | DEFUN (no_vpnv4_network,
no_vpnv4_network_cmd,
"no network A.B.C.D/M rd ASN:nn_or_IP-address:nn tag WORD",
NO_STR
"Specify a network to announce via BGP\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"Specify Route Distinguisher\n"
"VPN Route Distinguisher\n"
... | @@ -101,6 +101,7 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
pnt = packet->nlri;
lim = pnt + packet->length;
+#define VPN_PREFIXLEN_MIN_BYTES (3 + 8) /* label + RD */
for (; pnt < lim; pnt += psize)
{
/* Clear prefix structure. */
@@ -108,17 +109,38 @@ bgp_nlri_parse_vpnv4 (str... | CWE-119 | null | null |
10,091 | DEFUN (show_ip_bgp_vpnv4_all,
show_ip_bgp_vpnv4_all_cmd,
"show ip bgp vpnv4 all",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information about all VPNv4 NLRIs\n")
{
return bgp_show_mpls_vpn (vty, NULL, bgp_show_type_normal, NULL, 0);
}... | DoS Exec Code Overflow | 0 | DEFUN (show_ip_bgp_vpnv4_all,
show_ip_bgp_vpnv4_all_cmd,
"show ip bgp vpnv4 all",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information about all VPNv4 NLRIs\n")
{
return bgp_show_mpls_vpn (vty, NULL, bgp_show_type_normal, NULL, 0);
}... | @@ -101,6 +101,7 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
pnt = packet->nlri;
lim = pnt + packet->length;
+#define VPN_PREFIXLEN_MIN_BYTES (3 + 8) /* label + RD */
for (; pnt < lim; pnt += psize)
{
/* Clear prefix structure. */
@@ -108,17 +109,38 @@ bgp_nlri_parse_vpnv4 (str... | CWE-119 | null | null |
10,092 | DEFUN (show_ip_bgp_vpnv4_rd,
show_ip_bgp_vpnv4_rd_cmd,
"show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information for a route distinguisher\n"
"VPN Route Distinguisher\n")
{
int ret;
... | DoS Exec Code Overflow | 0 | DEFUN (show_ip_bgp_vpnv4_rd,
show_ip_bgp_vpnv4_rd_cmd,
"show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information for a route distinguisher\n"
"VPN Route Distinguisher\n")
{
int ret;
... | @@ -101,6 +101,7 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
pnt = packet->nlri;
lim = pnt + packet->length;
+#define VPN_PREFIXLEN_MIN_BYTES (3 + 8) /* label + RD */
for (; pnt < lim; pnt += psize)
{
/* Clear prefix structure. */
@@ -108,17 +109,38 @@ bgp_nlri_parse_vpnv4 (str... | CWE-119 | null | null |
10,093 | DEFUN (show_ip_bgp_vpnv4_all_tags,
show_ip_bgp_vpnv4_all_tags_cmd,
"show ip bgp vpnv4 all tags",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information about all VPNv4 NLRIs\n"
"Display BGP tags for prefixes\n")
{
return bgp_sho... | DoS Exec Code Overflow | 0 | DEFUN (show_ip_bgp_vpnv4_all_tags,
show_ip_bgp_vpnv4_all_tags_cmd,
"show ip bgp vpnv4 all tags",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information about all VPNv4 NLRIs\n"
"Display BGP tags for prefixes\n")
{
return bgp_sho... | @@ -101,6 +101,7 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
pnt = packet->nlri;
lim = pnt + packet->length;
+#define VPN_PREFIXLEN_MIN_BYTES (3 + 8) /* label + RD */
for (; pnt < lim; pnt += psize)
{
/* Clear prefix structure. */
@@ -108,17 +109,38 @@ bgp_nlri_parse_vpnv4 (str... | CWE-119 | null | null |
10,094 | DEFUN (show_ip_bgp_vpnv4_rd_tags,
show_ip_bgp_vpnv4_rd_tags_cmd,
"show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn tags",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information for a route distinguisher\n"
"VPN Route Distinguisher\n"
... | DoS Exec Code Overflow | 0 | DEFUN (show_ip_bgp_vpnv4_rd_tags,
show_ip_bgp_vpnv4_rd_tags_cmd,
"show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn tags",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information for a route distinguisher\n"
"VPN Route Distinguisher\n"
... | @@ -101,6 +101,7 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
pnt = packet->nlri;
lim = pnt + packet->length;
+#define VPN_PREFIXLEN_MIN_BYTES (3 + 8) /* label + RD */
for (; pnt < lim; pnt += psize)
{
/* Clear prefix structure. */
@@ -108,17 +109,38 @@ bgp_nlri_parse_vpnv4 (str... | CWE-119 | null | null |
10,095 | DEFUN (show_ip_bgp_vpnv4_all_neighbor_routes,
show_ip_bgp_vpnv4_all_neighbor_routes_cmd,
"show ip bgp vpnv4 all neighbors A.B.C.D routes",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information about all VPNv4 NLRIs\n"
"Detailed i... | DoS Exec Code Overflow | 0 | DEFUN (show_ip_bgp_vpnv4_all_neighbor_routes,
show_ip_bgp_vpnv4_all_neighbor_routes_cmd,
"show ip bgp vpnv4 all neighbors A.B.C.D routes",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information about all VPNv4 NLRIs\n"
"Detailed i... | @@ -101,6 +101,7 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
pnt = packet->nlri;
lim = pnt + packet->length;
+#define VPN_PREFIXLEN_MIN_BYTES (3 + 8) /* label + RD */
for (; pnt < lim; pnt += psize)
{
/* Clear prefix structure. */
@@ -108,17 +109,38 @@ bgp_nlri_parse_vpnv4 (str... | CWE-119 | null | null |
10,096 | DEFUN (show_ip_bgp_vpnv4_rd_neighbor_routes,
show_ip_bgp_vpnv4_rd_neighbor_routes_cmd,
"show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D routes",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information for a route distinguis... | DoS Exec Code Overflow | 0 | DEFUN (show_ip_bgp_vpnv4_rd_neighbor_routes,
show_ip_bgp_vpnv4_rd_neighbor_routes_cmd,
"show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D routes",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information for a route distinguis... | @@ -101,6 +101,7 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
pnt = packet->nlri;
lim = pnt + packet->length;
+#define VPN_PREFIXLEN_MIN_BYTES (3 + 8) /* label + RD */
for (; pnt < lim; pnt += psize)
{
/* Clear prefix structure. */
@@ -108,17 +109,38 @@ bgp_nlri_parse_vpnv4 (str... | CWE-119 | null | null |
10,097 | DEFUN (show_ip_bgp_vpnv4_all_neighbor_advertised_routes,
show_ip_bgp_vpnv4_all_neighbor_advertised_routes_cmd,
"show ip bgp vpnv4 all neighbors A.B.C.D advertised-routes",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information about all ... | DoS Exec Code Overflow | 0 | DEFUN (show_ip_bgp_vpnv4_all_neighbor_advertised_routes,
show_ip_bgp_vpnv4_all_neighbor_advertised_routes_cmd,
"show ip bgp vpnv4 all neighbors A.B.C.D advertised-routes",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display information about all ... | @@ -101,6 +101,7 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
pnt = packet->nlri;
lim = pnt + packet->length;
+#define VPN_PREFIXLEN_MIN_BYTES (3 + 8) /* label + RD */
for (; pnt < lim; pnt += psize)
{
/* Clear prefix structure. */
@@ -108,17 +109,38 @@ bgp_nlri_parse_vpnv4 (str... | CWE-119 | null | null |
10,098 | DEFUN (show_ip_bgp_vpnv4_rd_neighbor_advertised_routes,
show_ip_bgp_vpnv4_rd_neighbor_advertised_routes_cmd,
"show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D advertised-routes",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display i... | DoS Exec Code Overflow | 0 | DEFUN (show_ip_bgp_vpnv4_rd_neighbor_advertised_routes,
show_ip_bgp_vpnv4_rd_neighbor_advertised_routes_cmd,
"show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D advertised-routes",
SHOW_STR
IP_STR
BGP_STR
"Display VPNv4 NLRI specific information\n"
"Display i... | @@ -101,6 +101,7 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
pnt = packet->nlri;
lim = pnt + packet->length;
+#define VPN_PREFIXLEN_MIN_BYTES (3 + 8) /* label + RD */
for (; pnt < lim; pnt += psize)
{
/* Clear prefix structure. */
@@ -108,17 +109,38 @@ bgp_nlri_parse_vpnv4 (str... | CWE-119 | null | null |
10,099 | bgp_mplsvpn_init (void)
{
install_element (BGP_VPNV4_NODE, &vpnv4_network_cmd);
install_element (BGP_VPNV4_NODE, &no_vpnv4_network_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_tags_cm... | DoS Exec Code Overflow | 0 | bgp_mplsvpn_init (void)
{
install_element (BGP_VPNV4_NODE, &vpnv4_network_cmd);
install_element (BGP_VPNV4_NODE, &no_vpnv4_network_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_tags_cm... | @@ -101,6 +101,7 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
pnt = packet->nlri;
lim = pnt + packet->length;
+#define VPN_PREFIXLEN_MIN_BYTES (3 + 8) /* label + RD */
for (; pnt < lim; pnt += psize)
{
/* Clear prefix structure. */
@@ -108,17 +109,38 @@ bgp_nlri_parse_vpnv4 (str... | CWE-119 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.