idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
6,500
void Gfx::opXObject(Object args[], int numArgs) { char *name; Object obj1, obj2, obj3, refObj; #if OPI_SUPPORT Object opiDict; #endif name = args[0].getName(); if (!res->lookupXObject(name, &obj1)) { return; } if (!obj1.isStream()) { error(getPos(), "XObject '%s' is wrong type", name); obj1.f...
DoS
0
void Gfx::opXObject(Object args[], int numArgs) { char *name; Object obj1, obj2, obj3, refObj; #if OPI_SUPPORT Object opiDict; #endif name = args[0].getName(); if (!res->lookupXObject(name, &obj1)) { return; } if (!obj1.isStream()) { error(getPos(), "XObject '%s' is wrong type", name); obj1.f...
@@ -536,6 +536,7 @@ Gfx::Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict, Catalog *cata drawText = gFalse; maskHaveCSPattern = gFalse; mcStack = NULL; + parser = NULL; // start the resource stack res = new GfxResources(xref, resDict, NULL); @@ -590,6 +591,7 @@ Gfx::Gfx(XRef *xrefA, Output...
CWE-20
null
null
6,501
void Gfx::popMarkedContent() { MarkedContentStack *mc = mcStack; mcStack = mc->next; delete mc; }
DoS
0
void Gfx::popMarkedContent() { MarkedContentStack *mc = mcStack; mcStack = mc->next; delete mc; }
@@ -536,6 +536,7 @@ Gfx::Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict, Catalog *cata drawText = gFalse; maskHaveCSPattern = gFalse; mcStack = NULL; + parser = NULL; // start the resource stack res = new GfxResources(xref, resDict, NULL); @@ -590,6 +591,7 @@ Gfx::Gfx(XRef *xrefA, Output...
CWE-20
null
null
6,502
void Gfx::popResources() { GfxResources *resPtr; resPtr = res->getNext(); delete res; res = resPtr; }
DoS
0
void Gfx::popResources() { GfxResources *resPtr; resPtr = res->getNext(); delete res; res = resPtr; }
@@ -536,6 +536,7 @@ Gfx::Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict, Catalog *cata drawText = gFalse; maskHaveCSPattern = gFalse; mcStack = NULL; + parser = NULL; // start the resource stack res = new GfxResources(xref, resDict, NULL); @@ -590,6 +591,7 @@ Gfx::Gfx(XRef *xrefA, Output...
CWE-20
null
null
6,503
void Gfx::pushMarkedContent() { MarkedContentStack *mc = new MarkedContentStack(); mc->ocSuppressed = gFalse; mc->next = mcStack; mcStack = mc; }
DoS
0
void Gfx::pushMarkedContent() { MarkedContentStack *mc = new MarkedContentStack(); mc->ocSuppressed = gFalse; mc->next = mcStack; mcStack = mc; }
@@ -536,6 +536,7 @@ Gfx::Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict, Catalog *cata drawText = gFalse; maskHaveCSPattern = gFalse; mcStack = NULL; + parser = NULL; // start the resource stack res = new GfxResources(xref, resDict, NULL); @@ -590,6 +591,7 @@ Gfx::Gfx(XRef *xrefA, Output...
CWE-20
null
null
6,504
void Gfx::pushStateGuard() { stateGuards.push_back(stackHeight); }
DoS
0
void Gfx::pushStateGuard() { stateGuards.push_back(stackHeight); }
@@ -536,6 +536,7 @@ Gfx::Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict, Catalog *cata drawText = gFalse; maskHaveCSPattern = gFalse; mcStack = NULL; + parser = NULL; // start the resource stack res = new GfxResources(xref, resDict, NULL); @@ -590,6 +591,7 @@ Gfx::Gfx(XRef *xrefA, Output...
CWE-20
null
null
6,505
void Gfx::saveState() { out->saveState(state); state = state->save(); stackHeight++; }
DoS
0
void Gfx::saveState() { out->saveState(state); state = state->save(); stackHeight++; }
@@ -536,6 +536,7 @@ Gfx::Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict, Catalog *cata drawText = gFalse; maskHaveCSPattern = gFalse; mcStack = NULL; + parser = NULL; // start the resource stack res = new GfxResources(xref, resDict, NULL); @@ -590,6 +591,7 @@ Gfx::Gfx(XRef *xrefA, Output...
CWE-20
null
null
6,506
GfxResources::~GfxResources() { if (fonts) { delete fonts; } xObjDict.free(); colorSpaceDict.free(); patternDict.free(); shadingDict.free(); gStateDict.free(); propertiesDict.free(); }
DoS
0
GfxResources::~GfxResources() { if (fonts) { delete fonts; } xObjDict.free(); colorSpaceDict.free(); patternDict.free(); shadingDict.free(); gStateDict.free(); propertiesDict.free(); }
@@ -536,6 +536,7 @@ Gfx::Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict, Catalog *cata drawText = gFalse; maskHaveCSPattern = gFalse; mcStack = NULL; + parser = NULL; // start the resource stack res = new GfxResources(xref, resDict, NULL); @@ -590,6 +591,7 @@ Gfx::Gfx(XRef *xrefA, Output...
CWE-20
null
null
6,507
static int coroutine_fn v9fs_complete_rename(V9fsPDU *pdu, V9fsFidState *fidp, int32_t newdirfid, V9fsString *name) { char *end; int err = 0; V9fsPath new_path; V9fsFidState *tfidp; V9fsState *s = pdu->s; V...
DoS
0
static int coroutine_fn v9fs_complete_rename(V9fsPDU *pdu, V9fsFidState *fidp, int32_t newdirfid, V9fsString *name) { char *end; int err = 0; V9fsPath new_path; V9fsFidState *tfidp; V9fsState *s = pdu->s; V...
@@ -2090,7 +2090,7 @@ static void coroutine_fn v9fs_write(void *opaque) offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { - goto out; + goto out_qiov; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err);
CWE-399
null
null
6,508
int v9fs_device_realize_common(V9fsState *s, Error **errp) { V9fsVirtioState *v = container_of(s, V9fsVirtioState, state); int i, len; struct stat stat; FsDriverEntry *fse; V9fsPath path; int rc = 1; /* initialize pdu allocator */ QLIST_INIT(&s->free_list); QLIST_INIT(&s->active_lis...
DoS
0
int v9fs_device_realize_common(V9fsState *s, Error **errp) { V9fsVirtioState *v = container_of(s, V9fsVirtioState, state); int i, len; struct stat stat; FsDriverEntry *fse; V9fsPath path; int rc = 1; /* initialize pdu allocator */ QLIST_INIT(&s->free_list); QLIST_INIT(&s->active_lis...
@@ -2090,7 +2090,7 @@ static void coroutine_fn v9fs_write(void *opaque) offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { - goto out; + goto out_qiov; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err);
CWE-399
null
null
6,509
void v9fs_device_unrealize_common(V9fsState *s, Error **errp) { g_free(s->ctx.fs_root); g_free(s->tag); }
DoS
0
void v9fs_device_unrealize_common(V9fsState *s, Error **errp) { g_free(s->ctx.fs_root); g_free(s->tag); }
@@ -2090,7 +2090,7 @@ static void coroutine_fn v9fs_write(void *opaque) offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { - goto out; + goto out_qiov; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err);
CWE-399
null
null
6,510
static void coroutine_fn v9fs_open(void *opaque) { int flags; int32_t fid; int32_t mode; V9fsQID qid; int iounit = 0; ssize_t err = 0; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; if (s->proto_version == V9FS_PRO...
DoS
0
static void coroutine_fn v9fs_open(void *opaque) { int flags; int32_t fid; int32_t mode; V9fsQID qid; int iounit = 0; ssize_t err = 0; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; if (s->proto_version == V9FS_PRO...
@@ -2090,7 +2090,7 @@ static void coroutine_fn v9fs_write(void *opaque) offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { - goto out; + goto out_qiov; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err);
CWE-399
null
null
6,511
static void coroutine_fn v9fs_rename(void *opaque) { int32_t fid; ssize_t err = 0; size_t offset = 7; V9fsString name; int32_t newdirfid; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dds", &fid, &new...
DoS
0
static void coroutine_fn v9fs_rename(void *opaque) { int32_t fid; ssize_t err = 0; size_t offset = 7; V9fsString name; int32_t newdirfid; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dds", &fid, &new...
@@ -2090,7 +2090,7 @@ static void coroutine_fn v9fs_write(void *opaque) offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { - goto out; + goto out_qiov; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err);
CWE-399
null
null
6,512
static void coroutine_fn v9fs_walk(void *opaque) { int name_idx; V9fsQID *qids = NULL; int i, err = 0; V9fsPath dpath, path; uint16_t nwnames; struct stat stbuf; size_t offset = 7; int32_t fid, newfid; V9fsString *wnames = NULL; V9fsFidState *fidp; V9fsFidState *newfidp = NUL...
DoS
0
static void coroutine_fn v9fs_walk(void *opaque) { int name_idx; V9fsQID *qids = NULL; int i, err = 0; V9fsPath dpath, path; uint16_t nwnames; struct stat stbuf; size_t offset = 7; int32_t fid, newfid; V9fsString *wnames = NULL; V9fsFidState *fidp; V9fsFidState *newfidp = NUL...
@@ -2090,7 +2090,7 @@ static void coroutine_fn v9fs_write(void *opaque) offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { - goto out; + goto out_qiov; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err);
CWE-399
null
null
6,513
static int coroutine_fn v9fs_xattr_fid_clunk(V9fsPDU *pdu, V9fsFidState *fidp) { int retval = 0; if (fidp->fs.xattr.copied_len == -1) { /* getxattr/listxattr fid */ goto free_value; } /* * if this is fid for setxattr. clunk should * result in setxattr localcall */ if ...
DoS
0
static int coroutine_fn v9fs_xattr_fid_clunk(V9fsPDU *pdu, V9fsFidState *fidp) { int retval = 0; if (fidp->fs.xattr.copied_len == -1) { /* getxattr/listxattr fid */ goto free_value; } /* * if this is fid for setxattr. clunk should * result in setxattr localcall */ if ...
@@ -2090,7 +2090,7 @@ static void coroutine_fn v9fs_write(void *opaque) offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { - goto out; + goto out_qiov; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err);
CWE-399
null
null
6,514
static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp, uint64_t off, uint32_t max_count) { ssize_t err; size_t offset = 7; int read_count; int64_t xattr_len; V9fsVirtioState *v = container_of(s, V9fsVirtioState, state); VirtQueueElement *elem = v->e...
DoS
0
static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp, uint64_t off, uint32_t max_count) { ssize_t err; size_t offset = 7; int read_count; int64_t xattr_len; V9fsVirtioState *v = container_of(s, V9fsVirtioState, state); VirtQueueElement *elem = v->e...
@@ -2090,7 +2090,7 @@ static void coroutine_fn v9fs_write(void *opaque) offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { - goto out; + goto out_qiov; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err);
CWE-399
null
null
6,515
static void coroutine_fn v9fs_xattrcreate(void *opaque) { int flags; int32_t fid; int64_t size; ssize_t err = 0; V9fsString name; size_t offset = 7; V9fsFidState *file_fidp; V9fsFidState *xattr_fidp; V9fsPDU *pdu = opaque; v9fs_string_init(&name); err = pdu_unmarshal(pdu, of...
DoS
0
static void coroutine_fn v9fs_xattrcreate(void *opaque) { int flags; int32_t fid; int64_t size; ssize_t err = 0; V9fsString name; size_t offset = 7; V9fsFidState *file_fidp; V9fsFidState *xattr_fidp; V9fsPDU *pdu = opaque; v9fs_string_init(&name); err = pdu_unmarshal(pdu, of...
@@ -2090,7 +2090,7 @@ static void coroutine_fn v9fs_write(void *opaque) offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { - goto out; + goto out_qiov; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err);
CWE-399
null
null
6,516
static void coroutine_fn v9fs_xattrwalk(void *opaque) { int64_t size; V9fsString name; ssize_t err = 0; size_t offset = 7; int32_t fid, newfid; V9fsFidState *file_fidp; V9fsFidState *xattr_fidp = NULL; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); er...
DoS
0
static void coroutine_fn v9fs_xattrwalk(void *opaque) { int64_t size; V9fsString name; ssize_t err = 0; size_t offset = 7; int32_t fid, newfid; V9fsFidState *file_fidp; V9fsFidState *xattr_fidp = NULL; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); er...
@@ -2090,7 +2090,7 @@ static void coroutine_fn v9fs_write(void *opaque) offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { - goto out; + goto out_qiov; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err);
CWE-399
null
null
6,517
static void coroutine_fn virtfs_reset(V9fsPDU *pdu) { V9fsState *s = pdu->s; V9fsFidState *fidp = NULL; /* Free all fids */ while (s->fid_list) { fidp = s->fid_list; s->fid_list = fidp->next; if (fidp->ref) { fidp->clunked = 1; } else { free_fid(...
DoS
0
static void coroutine_fn virtfs_reset(V9fsPDU *pdu) { V9fsState *s = pdu->s; V9fsFidState *fidp = NULL; /* Free all fids */ while (s->fid_list) { fidp = s->fid_list; s->fid_list = fidp->next; if (fidp->ref) { fidp->clunked = 1; } else { free_fid(...
@@ -2090,7 +2090,7 @@ static void coroutine_fn v9fs_write(void *opaque) offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { - goto out; + goto out_qiov; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err);
CWE-399
null
null
6,518
static void coroutine_fn v9fs_write(void *opaque) { ssize_t err; int32_t fid; uint64_t off; uint32_t count; int32_t len = 0; int32_t total = 0; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; QEMUIOVector qiov_full; QEMUIOVector qiov; ...
DoS
0
static void coroutine_fn v9fs_write(void *opaque) { ssize_t err; int32_t fid; uint64_t off; uint32_t count; int32_t len = 0; int32_t total = 0; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; QEMUIOVector qiov_full; QEMUIOVector qiov; ...
@@ -2413,6 +2413,7 @@ static void coroutine_fn v9fs_link(void *opaque) if (!err) { err = offset; } + put_fid(pdu, oldfidp); out: put_fid(pdu, dfidp); out_nofid:
CWE-399
null
null
6,519
static void coroutine_fn v9fs_link(void *opaque) { V9fsPDU *pdu = opaque; int32_t dfid, oldfid; V9fsFidState *dfidp, *oldfidp; V9fsString name; size_t offset = 7; int err = 0; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dds", &dfid, &oldfid, &name); if (err < 0) { ...
Overflow +Info
0
static void coroutine_fn v9fs_link(void *opaque) { V9fsPDU *pdu = opaque; int32_t dfid, oldfid; V9fsFidState *dfidp, *oldfidp; V9fsString name; size_t offset = 7; int err = 0; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dds", &dfid, &oldfid, &name); if (err < 0) { ...
@@ -3282,7 +3282,7 @@ static void coroutine_fn v9fs_xattrcreate(void *opaque) xattr_fidp->fs.xattr.flags = flags; v9fs_string_init(&xattr_fidp->fs.xattr.name); v9fs_string_copy(&xattr_fidp->fs.xattr.name, &name); - xattr_fidp->fs.xattr.value = g_malloc(size); + xattr_fidp->fs.xattr.value = g_malloc...
CWE-119
null
null
6,520
static inline void recv_fifo_put(SerialState *s, uint8_t chr) { /* Receive overruns do not overwrite FIFO contents. */ if (!fifo8_is_full(&s->recv_fifo)) { fifo8_push(&s->recv_fifo, chr); } else { s->lsr |= UART_LSR_OE; } }
DoS
0
static inline void recv_fifo_put(SerialState *s, uint8_t chr) { /* Receive overruns do not overwrite FIFO contents. */ if (!fifo8_is_full(&s->recv_fifo)) { fifo8_push(&s->recv_fifo, chr); } else { s->lsr |= UART_LSR_OE; } }
@@ -153,8 +153,9 @@ static void serial_update_parameters(SerialState *s) int speed, parity, data_bits, stop_bits, frame_size; QEMUSerialSetParams ssp; - if (s->divider == 0) + if (s->divider == 0 || s->divider > s->baudbase) { return; + } /* Start bit. */ frame_size = 1;
CWE-369
null
null
6,521
static void serial_update_irq(SerialState *s) { uint8_t tmp_iir = UART_IIR_NO_INT; if ((s->ier & UART_IER_RLSI) && (s->lsr & UART_LSR_INT_ANY)) { tmp_iir = UART_IIR_RLSI; } else if ((s->ier & UART_IER_RDI) && s->timeout_ipending) { /* Note that(s->ier & UART_IER_RDI) can mask this interrupt...
DoS
0
static void serial_update_irq(SerialState *s) { uint8_t tmp_iir = UART_IIR_NO_INT; if ((s->ier & UART_IER_RLSI) && (s->lsr & UART_LSR_INT_ANY)) { tmp_iir = UART_IIR_RLSI; } else if ((s->ier & UART_IER_RDI) && s->timeout_ipending) { /* Note that(s->ier & UART_IER_RDI) can mask this interrupt...
@@ -153,8 +153,9 @@ static void serial_update_parameters(SerialState *s) int speed, parity, data_bits, stop_bits, frame_size; QEMUSerialSetParams ssp; - if (s->divider == 0) + if (s->divider == 0 || s->divider > s->baudbase) { return; + } /* Start bit. */ frame_size = 1;
CWE-369
null
null
6,522
static int fid_to_qid(V9fsPDU *pdu, V9fsFidState *fidp, V9fsQID *qidp) { struct stat stbuf; int err; err = v9fs_co_lstat(pdu, &fidp->path, &stbuf); if (err < 0) { return err; } stat_to_qid(&stbuf, qidp); return 0; }
DoS
0
static int fid_to_qid(V9fsPDU *pdu, V9fsFidState *fidp, V9fsQID *qidp) { struct stat stbuf; int err; err = v9fs_co_lstat(pdu, &fidp->path, &stbuf); if (err < 0) { return err; } stat_to_qid(&stbuf, qidp); return 0; }
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,523
static int free_fid(V9fsPDU *pdu, V9fsFidState *fidp) { int retval = 0; if (fidp->fid_type == P9_FID_FILE) { /* If we reclaimed the fd no need to close */ if (fidp->fs.fd != -1) { retval = v9fs_co_close(pdu, &fidp->fs); } } else if (fidp->fid_type == P9_FID_DIR) { ...
DoS
0
static int free_fid(V9fsPDU *pdu, V9fsFidState *fidp) { int retval = 0; if (fidp->fid_type == P9_FID_FILE) { /* If we reclaimed the fd no need to close */ if (fidp->fs.fd != -1) { retval = v9fs_co_close(pdu, &fidp->fs); } } else if (fidp->fid_type == P9_FID_DIR) { ...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,524
static V9fsFidState *get_fid(V9fsPDU *pdu, int32_t fid) { int err; V9fsFidState *f; V9fsState *s = pdu->s; for (f = s->fid_list; f; f = f->next) { BUG_ON(f->clunked); if (f->fid == fid) { /* * Update the fid ref upfront so that * we don't get reclai...
DoS
0
static V9fsFidState *get_fid(V9fsPDU *pdu, int32_t fid) { int err; V9fsFidState *f; V9fsState *s = pdu->s; for (f = s->fid_list; f; f = f->next) { BUG_ON(f->clunked); if (f->fid == fid) { /* * Update the fid ref upfront so that * we don't get reclai...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,525
static int32_t get_iounit(V9fsPDU *pdu, V9fsPath *path) { struct statfs stbuf; int32_t iounit = 0; V9fsState *s = pdu->s; /* * iounit should be multiples of f_bsize (host filesystem block size * and as well as less than (client msize - P9_IOHDRSZ)) */ if (!v9fs_co_statfs(pdu, path, &...
DoS
0
static int32_t get_iounit(V9fsPDU *pdu, V9fsPath *path) { struct statfs stbuf; int32_t iounit = 0; V9fsState *s = pdu->s; /* * iounit should be multiples of f_bsize (host filesystem block size * and as well as less than (client msize - P9_IOHDRSZ)) */ if (!v9fs_co_statfs(pdu, path, &...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,526
static void pdu_complete(V9fsPDU *pdu, ssize_t len) { int8_t id = pdu->id + 1; /* Response */ V9fsState *s = pdu->s; if (len < 0) { int err = -len; len = 7; if (s->proto_version != V9FS_PROTO_2000L) { V9fsString str; str.data = strerror(err); st...
DoS
0
static void pdu_complete(V9fsPDU *pdu, ssize_t len) { int8_t id = pdu->id + 1; /* Response */ V9fsState *s = pdu->s; if (len < 0) { int err = -len; len = 7; if (s->proto_version != V9FS_PROTO_2000L) { V9fsString str; str.data = strerror(err); st...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,527
void pdu_free(V9fsPDU *pdu) { if (pdu) { V9fsState *s = pdu->s; /* * Cancelled pdu are added back to the freelist * by flush request . */ if (!pdu->cancelled) { QLIST_REMOVE(pdu, next); QLIST_INSERT_HEAD(&s->free_list, pdu, next); } ...
DoS
0
void pdu_free(V9fsPDU *pdu) { if (pdu) { V9fsState *s = pdu->s; /* * Cancelled pdu are added back to the freelist * by flush request . */ if (!pdu->cancelled) { QLIST_REMOVE(pdu, next); QLIST_INSERT_HEAD(&s->free_list, pdu, next); } ...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,528
static int put_fid(V9fsPDU *pdu, V9fsFidState *fidp) { BUG_ON(!fidp->ref); fidp->ref--; /* * Don't free the fid if it is in reclaim list */ if (!fidp->ref && fidp->clunked) { if (fidp->fid == pdu->s->root_fid) { /* * if the clunked fid is root fid then we ...
DoS
0
static int put_fid(V9fsPDU *pdu, V9fsFidState *fidp) { BUG_ON(!fidp->ref); fidp->ref--; /* * Don't free the fid if it is in reclaim list */ if (!fidp->ref && fidp->clunked) { if (fidp->fid == pdu->s->root_fid) { /* * if the clunked fid is root fid then we ...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,529
static int stat_to_v9stat(V9fsPDU *pdu, V9fsPath *name, const struct stat *stbuf, V9fsStat *v9stat) { int err; const char *str; memset(v9stat, 0, sizeof(*v9stat)); stat_to_qid(stbuf, &v9stat->qid); v9stat->mode = stat_to_v9mode(stbuf); v9...
DoS
0
static int stat_to_v9stat(V9fsPDU *pdu, V9fsPath *name, const struct stat *stbuf, V9fsStat *v9stat) { int err; const char *str; memset(v9stat, 0, sizeof(*v9stat)); stat_to_qid(stbuf, &v9stat->qid); v9stat->mode = stat_to_v9mode(stbuf); v9...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,530
static void v9fs_attach(void *opaque) { V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; int32_t fid, afid, n_uname; V9fsString uname, aname; V9fsFidState *fidp; size_t offset = 7; V9fsQID qid; ssize_t err; v9fs_string_init(&uname); v9fs_string_init(&aname); err = pdu_unmarshal...
DoS
0
static void v9fs_attach(void *opaque) { V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; int32_t fid, afid, n_uname; V9fsString uname, aname; V9fsFidState *fidp; size_t offset = 7; V9fsQID qid; ssize_t err; v9fs_string_init(&uname); v9fs_string_init(&aname); err = pdu_unmarshal...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,531
static void v9fs_clunk(void *opaque) { int err; int32_t fid; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; err = pdu_unmarshal(pdu, offset, "d", &fid); if (err < 0) { goto out_nofid; } trace_v9fs_clunk(pdu->tag, pdu->id, fid); ...
DoS
0
static void v9fs_clunk(void *opaque) { int err; int32_t fid; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; err = pdu_unmarshal(pdu, offset, "d", &fid); if (err < 0) { goto out_nofid; } trace_v9fs_clunk(pdu->tag, pdu->id, fid); ...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,532
static int v9fs_complete_renameat(V9fsPDU *pdu, int32_t olddirfid, V9fsString *old_name, int32_t newdirfid, V9fsString *new_name) { int err = 0; V9fsState *s = pdu->s; V9fsFidState *newdirfidp = NULL, *olddirfidp = NULL; olddirfidp = g...
DoS
0
static int v9fs_complete_renameat(V9fsPDU *pdu, int32_t olddirfid, V9fsString *old_name, int32_t newdirfid, V9fsString *new_name) { int err = 0; V9fsState *s = pdu->s; V9fsFidState *newdirfidp = NULL, *olddirfidp = NULL; olddirfidp = g...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,533
static void v9fs_create(void *opaque) { int32_t fid; int err = 0; size_t offset = 7; V9fsFidState *fidp; V9fsQID qid; int32_t perm; int8_t mode; V9fsPath path; struct stat stbuf; V9fsString name; V9fsString extension; int iounit; V9fsPDU *pdu = opaque; v9fs_path_...
DoS
0
static void v9fs_create(void *opaque) { int32_t fid; int err = 0; size_t offset = 7; V9fsFidState *fidp; V9fsQID qid; int32_t perm; int8_t mode; V9fsPath path; struct stat stbuf; V9fsString name; V9fsString extension; int iounit; V9fsPDU *pdu = opaque; v9fs_path_...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,534
static int v9fs_do_readdir(V9fsPDU *pdu, V9fsFidState *fidp, int32_t max_count) { size_t size; V9fsQID qid; V9fsString name; int len, err = 0; int32_t count = 0; off_t saved_dir_pos; struct dirent *dent; /* save the directory position */ saved_dir_pos = v9...
DoS
0
static int v9fs_do_readdir(V9fsPDU *pdu, V9fsFidState *fidp, int32_t max_count) { size_t size; V9fsQID qid; V9fsString name; int len, err = 0; int32_t count = 0; off_t saved_dir_pos; struct dirent *dent; /* save the directory position */ saved_dir_pos = v9...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,535
static int v9fs_do_readdir_with_stat(V9fsPDU *pdu, V9fsFidState *fidp, uint32_t max_count) { V9fsPath path; V9fsStat v9stat; int len, err = 0; int32_t count = 0; struct stat stbuf; off_t saved_dir_pos; struct dirent *dent; /* save the directory posit...
DoS
0
static int v9fs_do_readdir_with_stat(V9fsPDU *pdu, V9fsFidState *fidp, uint32_t max_count) { V9fsPath path; V9fsStat v9stat; int len, err = 0; int32_t count = 0; struct stat stbuf; off_t saved_dir_pos; struct dirent *dent; /* save the directory posit...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,536
static void v9fs_fix_fid_paths(V9fsPDU *pdu, V9fsPath *olddir, V9fsString *old_name, V9fsPath *newdir, V9fsString *new_name) { V9fsFidState *tfidp; V9fsPath oldpath, newpath; V9fsState *s = pdu->s; v9fs_path_init(&oldpath); v9fs_path_in...
DoS
0
static void v9fs_fix_fid_paths(V9fsPDU *pdu, V9fsPath *olddir, V9fsString *old_name, V9fsPath *newdir, V9fsString *new_name) { V9fsFidState *tfidp; V9fsPath oldpath, newpath; V9fsState *s = pdu->s; v9fs_path_init(&oldpath); v9fs_path_in...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,537
static void v9fs_fs_ro(void *opaque) { V9fsPDU *pdu = opaque; pdu_complete(pdu, -EROFS); }
DoS
0
static void v9fs_fs_ro(void *opaque) { V9fsPDU *pdu = opaque; pdu_complete(pdu, -EROFS); }
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,538
static void v9fs_getattr(void *opaque) { int32_t fid; size_t offset = 7; ssize_t retval = 0; struct stat stbuf; V9fsFidState *fidp; uint64_t request_mask; V9fsStatDotl v9stat_dotl; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; retval = pdu_unmarshal(pdu, offset, "dq", &fid, &req...
DoS
0
static void v9fs_getattr(void *opaque) { int32_t fid; size_t offset = 7; ssize_t retval = 0; struct stat stbuf; V9fsFidState *fidp; uint64_t request_mask; V9fsStatDotl v9stat_dotl; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; retval = pdu_unmarshal(pdu, offset, "dq", &fid, &req...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,539
static void v9fs_getlock(void *opaque) { size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsGetlock glock; int32_t fid, err = 0; V9fsPDU *pdu = opaque; v9fs_string_init(&glock.client_id); err = pdu_unmarshal(pdu, offset, "dbqqds", &fid, &glock.type, &g...
DoS
0
static void v9fs_getlock(void *opaque) { size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsGetlock glock; int32_t fid, err = 0; V9fsPDU *pdu = opaque; v9fs_string_init(&glock.client_id); err = pdu_unmarshal(pdu, offset, "dbqqds", &fid, &glock.type, &g...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,540
static void v9fs_lcreate(void *opaque) { int32_t dfid, flags, mode; gid_t gid; ssize_t err = 0; ssize_t offset = 7; V9fsString name; V9fsFidState *fidp; struct stat stbuf; V9fsQID qid; int32_t iounit; V9fsPDU *pdu = opaque; v9fs_string_init(&name); err = pdu_unmarshal(pd...
DoS
0
static void v9fs_lcreate(void *opaque) { int32_t dfid, flags, mode; gid_t gid; ssize_t err = 0; ssize_t offset = 7; V9fsString name; V9fsFidState *fidp; struct stat stbuf; V9fsQID qid; int32_t iounit; V9fsPDU *pdu = opaque; v9fs_string_init(&name); err = pdu_unmarshal(pd...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,541
static void v9fs_link(void *opaque) { V9fsPDU *pdu = opaque; int32_t dfid, oldfid; V9fsFidState *dfidp, *oldfidp; V9fsString name; size_t offset = 7; int err = 0; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dds", &dfid, &oldfid, &name); if (err < 0) { goto out...
DoS
0
static void v9fs_link(void *opaque) { V9fsPDU *pdu = opaque; int32_t dfid, oldfid; V9fsFidState *dfidp, *oldfidp; V9fsString name; size_t offset = 7; int err = 0; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dds", &dfid, &oldfid, &name); if (err < 0) { goto out...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,542
static void v9fs_lock(void *opaque) { int8_t status; V9fsFlock flock; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; int32_t fid, err = 0; V9fsPDU *pdu = opaque; status = P9_LOCK_ERROR; v9fs_string_init(&flock.client_id); err = pdu_unmarshal(pdu, offset, "dbdqqds", &f...
DoS
0
static void v9fs_lock(void *opaque) { int8_t status; V9fsFlock flock; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; int32_t fid, err = 0; V9fsPDU *pdu = opaque; status = P9_LOCK_ERROR; v9fs_string_init(&flock.client_id); err = pdu_unmarshal(pdu, offset, "dbdqqds", &f...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,543
static int v9fs_mark_fids_unreclaim(V9fsPDU *pdu, V9fsPath *path) { int err; V9fsState *s = pdu->s; V9fsFidState *fidp, head_fid; head_fid.next = s->fid_list; for (fidp = s->fid_list; fidp; fidp = fidp->next) { if (fidp->path.size != path->size) { continue; } if ...
DoS
0
static int v9fs_mark_fids_unreclaim(V9fsPDU *pdu, V9fsPath *path) { int err; V9fsState *s = pdu->s; V9fsFidState *fidp, head_fid; head_fid.next = s->fid_list; for (fidp = s->fid_list; fidp; fidp = fidp->next) { if (fidp->path.size != path->size) { continue; } if ...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,544
static void v9fs_mknod(void *opaque) { int mode; gid_t gid; int32_t fid; V9fsQID qid; int err = 0; int major, minor; size_t offset = 7; V9fsString name; struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; v9fs_string_init(&name); err = pdu_unmarshal(pdu, o...
DoS
0
static void v9fs_mknod(void *opaque) { int mode; gid_t gid; int32_t fid; V9fsQID qid; int err = 0; int major, minor; size_t offset = 7; V9fsString name; struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; v9fs_string_init(&name); err = pdu_unmarshal(pdu, o...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,545
static void v9fs_op_not_supp(void *opaque) { V9fsPDU *pdu = opaque; pdu_complete(pdu, -EOPNOTSUPP); }
DoS
0
static void v9fs_op_not_supp(void *opaque) { V9fsPDU *pdu = opaque; pdu_complete(pdu, -EOPNOTSUPP); }
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,546
static void v9fs_open(void *opaque) { int flags; int32_t fid; int32_t mode; V9fsQID qid; int iounit = 0; ssize_t err = 0; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; if (s->proto_version == V9FS_PROTO_2000L) { ...
DoS
0
static void v9fs_open(void *opaque) { int flags; int32_t fid; int32_t mode; V9fsQID qid; int iounit = 0; ssize_t err = 0; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; if (s->proto_version == V9FS_PROTO_2000L) { ...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,547
static void v9fs_readdir(void *opaque) { int32_t fid; V9fsFidState *fidp; ssize_t retval = 0; size_t offset = 7; uint64_t initial_offset; int32_t count; uint32_t max_count; V9fsPDU *pdu = opaque; retval = pdu_unmarshal(pdu, offset, "dqd", &fid, &initial_of...
DoS
0
static void v9fs_readdir(void *opaque) { int32_t fid; V9fsFidState *fidp; ssize_t retval = 0; size_t offset = 7; uint64_t initial_offset; int32_t count; uint32_t max_count; V9fsPDU *pdu = opaque; retval = pdu_unmarshal(pdu, offset, "dqd", &fid, &initial_of...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,548
static void v9fs_readlink(void *opaque) { V9fsPDU *pdu = opaque; size_t offset = 7; V9fsString target; int32_t fid; int err = 0; V9fsFidState *fidp; err = pdu_unmarshal(pdu, offset, "d", &fid); if (err < 0) { goto out_nofid; } trace_v9fs_readlink(pdu->tag, pdu->id, fid);...
DoS
0
static void v9fs_readlink(void *opaque) { V9fsPDU *pdu = opaque; size_t offset = 7; V9fsString target; int32_t fid; int err = 0; V9fsFidState *fidp; err = pdu_unmarshal(pdu, offset, "d", &fid); if (err < 0) { goto out_nofid; } trace_v9fs_readlink(pdu->tag, pdu->id, fid);...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,549
void v9fs_reclaim_fd(V9fsPDU *pdu) { int reclaim_count = 0; V9fsState *s = pdu->s; V9fsFidState *f, *reclaim_list = NULL; for (f = s->fid_list; f; f = f->next) { /* * Unlink fids cannot be reclaimed. Check * for them and skip them. Also skip fids * currently being ope...
DoS
0
void v9fs_reclaim_fd(V9fsPDU *pdu) { int reclaim_count = 0; V9fsState *s = pdu->s; V9fsFidState *f, *reclaim_list = NULL; for (f = s->fid_list; f; f = f->next) { /* * Unlink fids cannot be reclaimed. Check * for them and skip them. Also skip fids * currently being ope...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,550
static void v9fs_remove(void *opaque) { int32_t fid; int err = 0; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; err = pdu_unmarshal(pdu, offset, "d", &fid); if (err < 0) { goto out_nofid; } trace_v9fs_remove(pdu->tag, pdu->id, fid); fidp = get_fid(pdu, f...
DoS
0
static void v9fs_remove(void *opaque) { int32_t fid; int err = 0; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; err = pdu_unmarshal(pdu, offset, "d", &fid); if (err < 0) { goto out_nofid; } trace_v9fs_remove(pdu->tag, pdu->id, fid); fidp = get_fid(pdu, f...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,551
static void v9fs_rename(void *opaque) { int32_t fid; ssize_t err = 0; size_t offset = 7; V9fsString name; int32_t newdirfid; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dds", &fid, &newdirfid, &name...
DoS
0
static void v9fs_rename(void *opaque) { int32_t fid; ssize_t err = 0; size_t offset = 7; V9fsString name; int32_t newdirfid; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dds", &fid, &newdirfid, &name...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,552
static void v9fs_renameat(void *opaque) { ssize_t err = 0; size_t offset = 7; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; int32_t olddirfid, newdirfid; V9fsString old_name, new_name; v9fs_string_init(&old_name); v9fs_string_init(&new_name); err = pdu_unmarshal(pdu, offset, "dsds",...
DoS
0
static void v9fs_renameat(void *opaque) { ssize_t err = 0; size_t offset = 7; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; int32_t olddirfid, newdirfid; V9fsString old_name, new_name; v9fs_string_init(&old_name); v9fs_string_init(&new_name); err = pdu_unmarshal(pdu, offset, "dsds",...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,553
static int v9fs_reopen_fid(V9fsPDU *pdu, V9fsFidState *f) { int err = 1; if (f->fid_type == P9_FID_FILE) { if (f->fs.fd == -1) { do { err = v9fs_co_open(pdu, f, f->open_flags); } while (err == -EINTR && !pdu->cancelled); } } else if (f->fid_type == P9_...
DoS
0
static int v9fs_reopen_fid(V9fsPDU *pdu, V9fsFidState *f) { int err = 1; if (f->fid_type == P9_FID_FILE) { if (f->fs.fd == -1) { do { err = v9fs_co_open(pdu, f, f->open_flags); } while (err == -EINTR && !pdu->cancelled); } } else if (f->fid_type == P9_...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,554
static void v9fs_setattr(void *opaque) { int err = 0; int32_t fid; V9fsFidState *fidp; size_t offset = 7; V9fsIattr v9iattr; V9fsPDU *pdu = opaque; err = pdu_unmarshal(pdu, offset, "dI", &fid, &v9iattr); if (err < 0) { goto out_nofid; } fidp = get_fid(pdu, fid); if ...
DoS
0
static void v9fs_setattr(void *opaque) { int err = 0; int32_t fid; V9fsFidState *fidp; size_t offset = 7; V9fsIattr v9iattr; V9fsPDU *pdu = opaque; err = pdu_unmarshal(pdu, offset, "dI", &fid, &v9iattr); if (err < 0) { goto out_nofid; } fidp = get_fid(pdu, fid); if ...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,555
static void v9fs_stat(void *opaque) { int32_t fid; V9fsStat v9stat; ssize_t err = 0; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; err = pdu_unmarshal(pdu, offset, "d", &fid); if (err < 0) { goto out_nofid; } trace_v9fs_stat(pdu->ta...
DoS
0
static void v9fs_stat(void *opaque) { int32_t fid; V9fsStat v9stat; ssize_t err = 0; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; err = pdu_unmarshal(pdu, offset, "d", &fid); if (err < 0) { goto out_nofid; } trace_v9fs_stat(pdu->ta...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,556
static void v9fs_statfs(void *opaque) { int32_t fid; ssize_t retval = 0; size_t offset = 7; V9fsFidState *fidp; struct statfs stbuf; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; retval = pdu_unmarshal(pdu, offset, "d", &fid); if (retval < 0) { goto out_nofid; } fidp...
DoS
0
static void v9fs_statfs(void *opaque) { int32_t fid; ssize_t retval = 0; size_t offset = 7; V9fsFidState *fidp; struct statfs stbuf; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; retval = pdu_unmarshal(pdu, offset, "d", &fid); if (retval < 0) { goto out_nofid; } fidp...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,557
static void v9fs_symlink(void *opaque) { V9fsPDU *pdu = opaque; V9fsString name; V9fsString symname; V9fsFidState *dfidp; V9fsQID qid; struct stat stbuf; int32_t dfid; int err = 0; gid_t gid; size_t offset = 7; v9fs_string_init(&name); v9fs_string_init(&symname); err...
DoS
0
static void v9fs_symlink(void *opaque) { V9fsPDU *pdu = opaque; V9fsString name; V9fsString symname; V9fsFidState *dfidp; V9fsQID qid; struct stat stbuf; int32_t dfid; int err = 0; gid_t gid; size_t offset = 7; v9fs_string_init(&name); v9fs_string_init(&symname); err...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,558
static void v9fs_unlinkat(void *opaque) { int err = 0; V9fsString name; int32_t dfid, flags; size_t offset = 7; V9fsPath path; V9fsFidState *dfidp; V9fsPDU *pdu = opaque; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dsd", &dfid, &name, &flags); if (err < 0) { ...
DoS
0
static void v9fs_unlinkat(void *opaque) { int err = 0; V9fsString name; int32_t dfid, flags; size_t offset = 7; V9fsPath path; V9fsFidState *dfidp; V9fsPDU *pdu = opaque; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dsd", &dfid, &name, &flags); if (err < 0) { ...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,559
static void v9fs_walk(void *opaque) { int name_idx; V9fsQID *qids = NULL; int i, err = 0; V9fsPath dpath, path; uint16_t nwnames; struct stat stbuf; size_t offset = 7; int32_t fid, newfid; V9fsString *wnames = NULL; V9fsFidState *fidp; V9fsFidState *newfidp = NULL; V9fsPD...
DoS
0
static void v9fs_walk(void *opaque) { int name_idx; V9fsQID *qids = NULL; int i, err = 0; V9fsPath dpath, path; uint16_t nwnames; struct stat stbuf; size_t offset = 7; int32_t fid, newfid; V9fsString *wnames = NULL; V9fsFidState *fidp; V9fsFidState *newfidp = NULL; V9fsPD...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,560
static void v9fs_write(void *opaque) { ssize_t err; int32_t fid; uint64_t off; uint32_t count; int32_t len = 0; int32_t total = 0; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; QEMUIOVector qiov_full; QEMUIOVector qiov; err = pd...
DoS
0
static void v9fs_write(void *opaque) { ssize_t err; int32_t fid; uint64_t off; uint32_t count; int32_t len = 0; int32_t total = 0; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; QEMUIOVector qiov_full; QEMUIOVector qiov; err = pd...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,561
static void v9fs_wstat(void *opaque) { int32_t fid; int err = 0; int16_t unused; V9fsStat v9stat; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; v9fs_stat_init(&v9stat); err = pdu_unmarshal(pdu, offset, "dwS", &fid, &unused, &v9stat); if (er...
DoS
0
static void v9fs_wstat(void *opaque) { int32_t fid; int err = 0; int16_t unused; V9fsStat v9stat; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; v9fs_stat_init(&v9stat); err = pdu_unmarshal(pdu, offset, "dwS", &fid, &unused, &v9stat); if (er...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,562
static int v9fs_xattr_fid_clunk(V9fsPDU *pdu, V9fsFidState *fidp) { int retval = 0; if (fidp->fs.xattr.copied_len == -1) { /* getxattr/listxattr fid */ goto free_value; } /* * if this is fid for setxattr. clunk should * result in setxattr localcall */ if (fidp->fs.xat...
DoS
0
static int v9fs_xattr_fid_clunk(V9fsPDU *pdu, V9fsFidState *fidp) { int retval = 0; if (fidp->fs.xattr.copied_len == -1) { /* getxattr/listxattr fid */ goto free_value; } /* * if this is fid for setxattr. clunk should * result in setxattr localcall */ if (fidp->fs.xat...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,563
static void v9fs_xattrcreate(void *opaque) { int flags; int32_t fid; int64_t size; ssize_t err = 0; V9fsString name; size_t offset = 7; V9fsFidState *file_fidp; V9fsFidState *xattr_fidp; V9fsPDU *pdu = opaque; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dsqd",...
DoS
0
static void v9fs_xattrcreate(void *opaque) { int flags; int32_t fid; int64_t size; ssize_t err = 0; V9fsString name; size_t offset = 7; V9fsFidState *file_fidp; V9fsFidState *xattr_fidp; V9fsPDU *pdu = opaque; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dsqd",...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,564
static void v9fs_xattrwalk(void *opaque) { int64_t size; V9fsString name; ssize_t err = 0; size_t offset = 7; int32_t fid, newfid; V9fsFidState *file_fidp; V9fsFidState *xattr_fidp = NULL; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); err = pdu_unmar...
DoS
0
static void v9fs_xattrwalk(void *opaque) { int64_t size; V9fsString name; ssize_t err = 0; size_t offset = 7; int32_t fid, newfid; V9fsFidState *file_fidp; V9fsFidState *xattr_fidp = NULL; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); err = pdu_unmar...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,565
static void virtfs_reset(V9fsPDU *pdu) { V9fsState *s = pdu->s; V9fsFidState *fidp = NULL; /* Free all fids */ while (s->fid_list) { fidp = s->fid_list; s->fid_list = fidp->next; if (fidp->ref) { fidp->clunked = 1; } else { free_fid(pdu, fidp); ...
DoS
0
static void virtfs_reset(V9fsPDU *pdu) { V9fsState *s = pdu->s; V9fsFidState *fidp = NULL; /* Free all fids */ while (s->fid_list) { fidp = s->fid_list; s->fid_list = fidp->next; if (fidp->ref) { fidp->clunked = 1; } else { free_fid(pdu, fidp); ...
@@ -1826,14 +1826,15 @@ static void v9fs_read(void *opaque) if (len < 0) { /* IO error return the error */ err = len; - goto out; + goto out_free_iovec; } } while (count < max_count && len > 0); err = pdu_marshal...
CWE-399
null
null
6,566
void usb_ehci_init(EHCIState *s, DeviceState *dev) { /* 2.2 host controller interface version */ s->caps[0x00] = (uint8_t)(s->opregbase - s->capsbase); s->caps[0x01] = 0x00; s->caps[0x02] = 0x00; s->caps[0x03] = 0x01; /* HC version */ s->caps[0x04] = s->portnr; /* Number of downstream p...
DoS
0
void usb_ehci_init(EHCIState *s, DeviceState *dev) { /* 2.2 host controller interface version */ s->caps[0x00] = (uint8_t)(s->opregbase - s->capsbase); s->caps[0x01] = 0x00; s->caps[0x02] = 0x00; s->caps[0x03] = 0x01; /* HC version */ s->caps[0x04] = s->portnr; /* Number of downstream p...
@@ -1426,6 +1426,7 @@ static int ehci_process_itd(EHCIState *ehci, if (off + len > 4096) { /* transfer crosses page border */ if (pg == 6) { + qemu_sglist_destroy(&ehci->isgl); return -1; /* avoid page pg + 1 */ } ...
CWE-399
null
null
6,567
XvImageFormatValues * XvMCListSubpictureTypes ( Display * dpy, XvPortID port, int surface_type_id, int *count_return ) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcListSubpictureTypesReply rep; xvmcListSubpictureTypesReq *req; XvImageFormatValues *ret = NULL; *count_return = 0; ...
Overflow
0
XvImageFormatValues * XvMCListSubpictureTypes ( Display * dpy, XvPortID port, int surface_type_id, int *count_return ) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcListSubpictureTypesReply rep; xvmcListSubpictureTypesReq *req; XvImageFormatValues *ret = NULL; *count_return = 0; ...
@@ -576,9 +576,9 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port, if (*name && *busID && tmpBuf) { _XRead(dpy, tmpBuf, realSize); strncpy(*name,tmpBuf,rep.nameLen); - (*name)[rep.nameLen - 1] = '\0'; + (*name)[rep.nameLen == 0 ? 0 : rep.nameLen - 1] = '\0'; strncpy(*busID,tmpBuf+rep.name...
CWE-119
null
null
6,568
XvMCSurfaceInfo * XvMCListSurfaceTypes(Display *dpy, XvPortID port, int *num) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcListSurfaceTypesReply rep; xvmcListSurfaceTypesReq *req; XvMCSurfaceInfo *surface_info = NULL; *num = 0; XvMCCheckExtension (dpy, info, NULL); LockDisplay (...
Overflow
0
XvMCSurfaceInfo * XvMCListSurfaceTypes(Display *dpy, XvPortID port, int *num) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcListSurfaceTypesReply rep; xvmcListSurfaceTypesReq *req; XvMCSurfaceInfo *surface_info = NULL; *num = 0; XvMCCheckExtension (dpy, info, NULL); LockDisplay (...
@@ -576,9 +576,9 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port, if (*name && *busID && tmpBuf) { _XRead(dpy, tmpBuf, realSize); strncpy(*name,tmpBuf,rep.nameLen); - (*name)[rep.nameLen - 1] = '\0'; + (*name)[rep.nameLen == 0 ? 0 : rep.nameLen - 1] = '\0'; strncpy(*busID,tmpBuf+rep.name...
CWE-119
null
null
6,569
Bool XvMCQueryExtension (Display *dpy, int *event_basep, int *error_basep) { XExtDisplayInfo *info = xvmc_find_display(dpy); if (XextHasExtension(info)) { *event_basep = info->codes->first_event; *error_basep = info->codes->first_error; return True; } else { return False; ...
Overflow
0
Bool XvMCQueryExtension (Display *dpy, int *event_basep, int *error_basep) { XExtDisplayInfo *info = xvmc_find_display(dpy); if (XextHasExtension(info)) { *event_basep = info->codes->first_event; *error_basep = info->codes->first_error; return True; } else { return False; ...
@@ -576,9 +576,9 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port, if (*name && *busID && tmpBuf) { _XRead(dpy, tmpBuf, realSize); strncpy(*name,tmpBuf,rep.nameLen); - (*name)[rep.nameLen - 1] = '\0'; + (*name)[rep.nameLen == 0 ? 0 : rep.nameLen - 1] = '\0'; strncpy(*busID,tmpBuf+rep.name...
CWE-119
null
null
6,570
Status XvMCQueryVersion (Display *dpy, int *major, int *minor) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcQueryVersionReply rep; xvmcQueryVersionReq *req; XvMCCheckExtension (dpy, info, BadImplementation); LockDisplay (dpy); XvMCGetReq (QueryVersion, req); if (!_XReply (dpy, (x...
Overflow
0
Status XvMCQueryVersion (Display *dpy, int *major, int *minor) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcQueryVersionReply rep; xvmcQueryVersionReq *req; XvMCCheckExtension (dpy, info, BadImplementation); LockDisplay (dpy); XvMCGetReq (QueryVersion, req); if (!_XReply (dpy, (x...
@@ -576,9 +576,9 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port, if (*name && *busID && tmpBuf) { _XRead(dpy, tmpBuf, realSize); strncpy(*name,tmpBuf,rep.nameLen); - (*name)[rep.nameLen - 1] = '\0'; + (*name)[rep.nameLen == 0 ? 0 : rep.nameLen - 1] = '\0'; strncpy(*busID,tmpBuf+rep.name...
CWE-119
null
null
6,571
Status _xvmc_create_context ( Display *dpy, XvMCContext *context, int *priv_count, CARD32 **priv_data ) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcCreateContextReply rep; xvmcCreateContextReq *req; *priv_count = 0; *priv_data = NULL; XvMCCheckExtension (dpy, info, B...
Overflow
0
Status _xvmc_create_context ( Display *dpy, XvMCContext *context, int *priv_count, CARD32 **priv_data ) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcCreateContextReply rep; xvmcCreateContextReq *req; *priv_count = 0; *priv_data = NULL; XvMCCheckExtension (dpy, info, B...
@@ -576,9 +576,9 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port, if (*name && *busID && tmpBuf) { _XRead(dpy, tmpBuf, realSize); strncpy(*name,tmpBuf,rep.nameLen); - (*name)[rep.nameLen - 1] = '\0'; + (*name)[rep.nameLen == 0 ? 0 : rep.nameLen - 1] = '\0'; strncpy(*busID,tmpBuf+rep.name...
CWE-119
null
null
6,572
Status _xvmc_destroy_context ( Display *dpy, XvMCContext *context ) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcDestroyContextReq *req; XvMCCheckExtension (dpy, info, BadImplementation); LockDisplay (dpy); XvMCGetReq (DestroyContext, req); req->context_id = context->context_...
Overflow
0
Status _xvmc_destroy_context ( Display *dpy, XvMCContext *context ) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcDestroyContextReq *req; XvMCCheckExtension (dpy, info, BadImplementation); LockDisplay (dpy); XvMCGetReq (DestroyContext, req); req->context_id = context->context_...
@@ -576,9 +576,9 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port, if (*name && *busID && tmpBuf) { _XRead(dpy, tmpBuf, realSize); strncpy(*name,tmpBuf,rep.nameLen); - (*name)[rep.nameLen - 1] = '\0'; + (*name)[rep.nameLen == 0 ? 0 : rep.nameLen - 1] = '\0'; strncpy(*busID,tmpBuf+rep.name...
CWE-119
null
null
6,573
Status _xvmc_destroy_subpicture( Display *dpy, XvMCSubpicture *subpicture ) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcDestroySubpictureReq *req; XvMCCheckExtension (dpy, info, BadImplementation); LockDisplay (dpy); XvMCGetReq (DestroySubpicture, req); req->subpicture_id = ...
Overflow
0
Status _xvmc_destroy_subpicture( Display *dpy, XvMCSubpicture *subpicture ) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcDestroySubpictureReq *req; XvMCCheckExtension (dpy, info, BadImplementation); LockDisplay (dpy); XvMCGetReq (DestroySubpicture, req); req->subpicture_id = ...
@@ -576,9 +576,9 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port, if (*name && *busID && tmpBuf) { _XRead(dpy, tmpBuf, realSize); strncpy(*name,tmpBuf,rep.nameLen); - (*name)[rep.nameLen - 1] = '\0'; + (*name)[rep.nameLen == 0 ? 0 : rep.nameLen - 1] = '\0'; strncpy(*busID,tmpBuf+rep.name...
CWE-119
null
null
6,574
Status _xvmc_destroy_surface ( Display *dpy, XvMCSurface *surface ) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcDestroySurfaceReq *req; XvMCCheckExtension (dpy, info, BadImplementation); LockDisplay (dpy); XvMCGetReq (DestroySurface, req); req->surface_id = surface->surface_...
Overflow
0
Status _xvmc_destroy_surface ( Display *dpy, XvMCSurface *surface ) { XExtDisplayInfo *info = xvmc_find_display(dpy); xvmcDestroySurfaceReq *req; XvMCCheckExtension (dpy, info, BadImplementation); LockDisplay (dpy); XvMCGetReq (DestroySurface, req); req->surface_id = surface->surface_...
@@ -576,9 +576,9 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port, if (*name && *busID && tmpBuf) { _XRead(dpy, tmpBuf, realSize); strncpy(*name,tmpBuf,rep.nameLen); - (*name)[rep.nameLen - 1] = '\0'; + (*name)[rep.nameLen == 0 ? 0 : rep.nameLen - 1] = '\0'; strncpy(*busID,tmpBuf+rep.name...
CWE-119
null
null
6,575
SendRange( Display *dpy, XRecordRange **range_item, int nranges) { int rlen = SIZEOF(xRecordRange); while(nranges--) { xRecordRange xrange; xrange.coreRequestsFirst = (*range_item)->core_requests.first; xrange.coreRequestsLast = (*range_item)->core_requests.last; ...
DoS
0
SendRange( Display *dpy, XRecordRange **range_item, int nranges) { int rlen = SIZEOF(xRecordRange); while(nranges--) { xRecordRange xrange; xrange.coreRequestsFirst = (*range_item)->core_requests.first; xrange.coreRequestsLast = (*range_item)->core_requests.last; ...
@@ -749,15 +749,23 @@ parse_reply_call_callback( switch (rep->category) { case XRecordFromServer: if (rep->elementHeader&XRecordFromServerTime) { + if (current_index + 4 > rep->length << 2) + return Error; EXTRACT_CARD32(rep->clientSwapped, reply->buf+current_index, data->server...
CWE-20
null
null
6,576
XRecordAllocRange(void) { return (XRecordRange*)Xcalloc(1, sizeof(XRecordRange)); }
DoS
0
XRecordAllocRange(void) { return (XRecordRange*)Xcalloc(1, sizeof(XRecordRange)); }
@@ -749,15 +749,23 @@ parse_reply_call_callback( switch (rep->category) { case XRecordFromServer: if (rep->elementHeader&XRecordFromServerTime) { + if (current_index + 4 > rep->length << 2) + return Error; EXTRACT_CARD32(rep->clientSwapped, reply->buf+current_index, data->server...
CWE-20
null
null
6,577
XRecordCreateContext(Display *dpy, int datum_flags, XRecordClientSpec *clients, int nclients, XRecordRange **ranges, int nranges) { XExtDisplayInfo *info = find_display (dpy); register xRecordCreateContextReq *req; int clen = 4 * nclients; XRecordCheckExtension (dpy, info, 0); Loc...
DoS
0
XRecordCreateContext(Display *dpy, int datum_flags, XRecordClientSpec *clients, int nclients, XRecordRange **ranges, int nranges) { XExtDisplayInfo *info = find_display (dpy); register xRecordCreateContextReq *req; int clen = 4 * nclients; XRecordCheckExtension (dpy, info, 0); Loc...
@@ -749,15 +749,23 @@ parse_reply_call_callback( switch (rep->category) { case XRecordFromServer: if (rep->elementHeader&XRecordFromServerTime) { + if (current_index + 4 > rep->length << 2) + return Error; EXTRACT_CARD32(rep->clientSwapped, reply->buf+current_index, data->server...
CWE-20
null
null
6,578
XRecordFreeData(XRecordInterceptData *data) { /* we can do this cast because that is what we really allocated */ struct intercept_queue *iq = (struct intercept_queue *)data; struct reply_buffer *rbp = NULL; struct mem_cache_str *cache = iq->cache; /* * figure out what reply_buffer this points ...
DoS
0
XRecordFreeData(XRecordInterceptData *data) { /* we can do this cast because that is what we really allocated */ struct intercept_queue *iq = (struct intercept_queue *)data; struct reply_buffer *rbp = NULL; struct mem_cache_str *cache = iq->cache; /* * figure out what reply_buffer this points ...
@@ -749,15 +749,23 @@ parse_reply_call_callback( switch (rep->category) { case XRecordFromServer: if (rep->elementHeader&XRecordFromServerTime) { + if (current_index + 4 > rep->length << 2) + return Error; EXTRACT_CARD32(rep->clientSwapped, reply->buf+current_index, data->server...
CWE-20
null
null
6,579
XRecordFreeState(XRecordState *state) { int i; for(i=0; i<state->nclients; i++) { if (state->client_info[i]->ranges) { if (state->client_info[i]->ranges[0]) Xfree(state->client_info[i]->ranges[0]); Xfree(state->client_info[i]->ranges); } } if (state->client_info) { if (state->client_info...
DoS
0
XRecordFreeState(XRecordState *state) { int i; for(i=0; i<state->nclients; i++) { if (state->client_info[i]->ranges) { if (state->client_info[i]->ranges[0]) Xfree(state->client_info[i]->ranges[0]); Xfree(state->client_info[i]->ranges); } } if (state->client_info) { if (state->client_info...
@@ -749,15 +749,23 @@ parse_reply_call_callback( switch (rep->category) { case XRecordFromServer: if (rep->elementHeader&XRecordFromServerTime) { + if (current_index + 4 > rep->length << 2) + return Error; EXTRACT_CARD32(rep->clientSwapped, reply->buf+current_index, data->server...
CWE-20
null
null
6,580
XRecordGetContext(Display *dpy, XRecordContext context, XRecordState **state_return) { XExtDisplayInfo *info = find_display (dpy); register xRecordGetContextReq *req; xRecordGetContextReply rep; unsigned int count, i, rn; xRecordRange xrange; xRecordClientInfo xclient_inf; XR...
DoS
0
XRecordGetContext(Display *dpy, XRecordContext context, XRecordState **state_return) { XExtDisplayInfo *info = find_display (dpy); register xRecordGetContextReq *req; xRecordGetContextReply rep; unsigned int count, i, rn; xRecordRange xrange; xRecordClientInfo xclient_inf; XR...
@@ -749,15 +749,23 @@ parse_reply_call_callback( switch (rep->category) { case XRecordFromServer: if (rep->elementHeader&XRecordFromServerTime) { + if (current_index + 4 > rep->length << 2) + return Error; EXTRACT_CARD32(rep->clientSwapped, reply->buf+current_index, data->server...
CWE-20
null
null
6,581
XRecordIdBaseMask(Display *dpy) { return 0x1fffffff & ~dpy->resource_mask; }
DoS
0
XRecordIdBaseMask(Display *dpy) { return 0x1fffffff & ~dpy->resource_mask; }
@@ -749,15 +749,23 @@ parse_reply_call_callback( switch (rep->category) { case XRecordFromServer: if (rep->elementHeader&XRecordFromServerTime) { + if (current_index + 4 > rep->length << 2) + return Error; EXTRACT_CARD32(rep->clientSwapped, reply->buf+current_index, data->server...
CWE-20
null
null
6,582
XRecordQueryVersion(Display *dpy, int *cmajor_return, int *cminor_return) { XExtDisplayInfo *info = find_display (dpy); register xRecordQueryVersionReq *req; xRecordQueryVersionReply rep; XRecordCheckExtension (dpy, info, False); LockDisplay(dpy); GetReq(RecordQueryVersion, req); req-...
DoS
0
XRecordQueryVersion(Display *dpy, int *cmajor_return, int *cminor_return) { XExtDisplayInfo *info = find_display (dpy); register xRecordQueryVersionReq *req; xRecordQueryVersionReply rep; XRecordCheckExtension (dpy, info, False); LockDisplay(dpy); GetReq(RecordQueryVersion, req); req-...
@@ -749,15 +749,23 @@ parse_reply_call_callback( switch (rep->category) { case XRecordFromServer: if (rep->elementHeader&XRecordFromServerTime) { + if (current_index + 4 > rep->length << 2) + return Error; EXTRACT_CARD32(rep->clientSwapped, reply->buf+current_index, data->server...
CWE-20
null
null
6,583
XRecordUnregisterClients(Display *dpy, XRecordContext context, XRecordClientSpec *clients, int nclients) { XExtDisplayInfo *info = find_display (dpy); register xRecordUnregisterClientsReq *req; int clen = 4 * nclients; XRecordCheckExtension (dpy, info, 0); LockDisplay(dpy); GetReq(Record...
DoS
0
XRecordUnregisterClients(Display *dpy, XRecordContext context, XRecordClientSpec *clients, int nclients) { XExtDisplayInfo *info = find_display (dpy); register xRecordUnregisterClientsReq *req; int clen = 4 * nclients; XRecordCheckExtension (dpy, info, 0); LockDisplay(dpy); GetReq(Record...
@@ -749,15 +749,23 @@ parse_reply_call_callback( switch (rep->category) { case XRecordFromServer: if (rep->elementHeader&XRecordFromServerTime) { + if (current_index + 4 > rep->length << 2) + return Error; EXTRACT_CARD32(rep->clientSwapped, reply->buf+current_index, data->server...
CWE-20
null
null
6,584
static XRecordInterceptData *alloc_inter_data(XExtDisplayInfo *info) { struct mem_cache_str *cache = (struct mem_cache_str *)info->data; struct intercept_queue *iq; /* if there is one on the free list, pop it */ if (cache->inter_data) { iq = cache->inter_data; cache->inter_data = iq->next; return &i...
DoS
0
static XRecordInterceptData *alloc_inter_data(XExtDisplayInfo *info) { struct mem_cache_str *cache = (struct mem_cache_str *)info->data; struct intercept_queue *iq; /* if there is one on the free list, pop it */ if (cache->inter_data) { iq = cache->inter_data; cache->inter_data = iq->next; return &i...
@@ -749,15 +749,23 @@ parse_reply_call_callback( switch (rep->category) { case XRecordFromServer: if (rep->elementHeader&XRecordFromServerTime) { + if (current_index + 4 > rep->length << 2) + return Error; EXTRACT_CARD32(rep->clientSwapped, reply->buf+current_index, data->server...
CWE-20
null
null
6,585
static XPointer alloc_mem_cache(void) { struct mem_cache_str *cache; /* note that an error will go unnoticed */ cache = (struct mem_cache_str *) Xmalloc(sizeof(struct mem_cache_str)); if (cache) { cache->display_closed = False; cache->inter_data = NULL; cache->inter_data_count = 0; cache->reply_buf...
DoS
0
static XPointer alloc_mem_cache(void) { struct mem_cache_str *cache; /* note that an error will go unnoticed */ cache = (struct mem_cache_str *) Xmalloc(sizeof(struct mem_cache_str)); if (cache) { cache->display_closed = False; cache->inter_data = NULL; cache->inter_data_count = 0; cache->reply_buf...
@@ -749,15 +749,23 @@ parse_reply_call_callback( switch (rep->category) { case XRecordFromServer: if (rep->elementHeader&XRecordFromServerTime) { + if (current_index + 4 > rep->length << 2) + return Error; EXTRACT_CARD32(rep->clientSwapped, reply->buf+current_index, data->server...
CWE-20
null
null
6,586
static struct reply_buffer *alloc_reply_buffer( XExtDisplayInfo *info, int nbytes) { struct mem_cache_str *cache = (struct mem_cache_str *)info->data; struct reply_buffer *rbp; struct reply_buffer *saved_rb = NULL; /* * First look for an allocated buffer that is not in use. * If we hav...
DoS
0
static struct reply_buffer *alloc_reply_buffer( XExtDisplayInfo *info, int nbytes) { struct mem_cache_str *cache = (struct mem_cache_str *)info->data; struct reply_buffer *rbp; struct reply_buffer *saved_rb = NULL; /* * First look for an allocated buffer that is not in use. * If we hav...
@@ -749,15 +749,23 @@ parse_reply_call_callback( switch (rep->category) { case XRecordFromServer: if (rep->elementHeader&XRecordFromServerTime) { + if (current_index + 4 > rep->length << 2) + return Error; EXTRACT_CARD32(rep->clientSwapped, reply->buf+current_index, data->server...
CWE-20
null
null
6,587
static int close_display( Display *dpy, XExtCodes *codes) /* not used */ { XExtDisplayInfo *info = find_display (dpy); LockDisplay(dpy); if (info && info->data) { struct mem_cache_str *cache = (struct mem_cache_str *)info->data; struct intercept_queue *iq, *iq_next; struct reply_buffer *rbp, **...
DoS
0
static int close_display( Display *dpy, XExtCodes *codes) /* not used */ { XExtDisplayInfo *info = find_display (dpy); LockDisplay(dpy); if (info && info->data) { struct mem_cache_str *cache = (struct mem_cache_str *)info->data; struct intercept_queue *iq, *iq_next; struct reply_buffer *rbp, **...
@@ -749,15 +749,23 @@ parse_reply_call_callback( switch (rep->category) { case XRecordFromServer: if (rep->elementHeader&XRecordFromServerTime) { + if (current_index + 4 > rep->length << 2) + return Error; EXTRACT_CARD32(rep->clientSwapped, reply->buf+current_index, data->server...
CWE-20
null
null
6,588
XRenderCloseDisplay (Display *dpy, XExtCodes *codes) { XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); if (info && info->info) XFree (info->info); return XRenderExtRemoveDisplay (&XRenderExtensionInfo, dpy); }
Overflow
0
XRenderCloseDisplay (Display *dpy, XExtCodes *codes) { XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); if (info && info->info) XFree (info->info); return XRenderExtRemoveDisplay (&XRenderExtensionInfo, dpy); }
@@ -533,12 +533,30 @@ XRenderQueryFormats (Display *dpy) screen->fallback = _XRenderFindFormat (xri, xScreen->fallback); screen->subpixel = SubPixelUnknown; xDepth = (xPictDepth *) (xScreen + 1); + if (screen->ndepths > rep.numDepths) { + Xfree (xri); + Xfree (xData); + _XEatDataWords (dpy, rep.length...
CWE-787
null
null
6,589
XRenderDepthCheckErrorHandler (Display *dpy, XErrorEvent *evt) { if (evt->request_code == X_CreatePixmap && evt->error_code == BadValue) { DepthCheckPtr d; _XLockMutex(_Xglobal_lock); for (d = depthChecks; d; d = d->next) if (d->dpy == dpy) { if ((long) (evt->serial - d->serial) >= 0) d->mi...
Overflow
0
XRenderDepthCheckErrorHandler (Display *dpy, XErrorEvent *evt) { if (evt->request_code == X_CreatePixmap && evt->error_code == BadValue) { DepthCheckPtr d; _XLockMutex(_Xglobal_lock); for (d = depthChecks; d; d = d->next) if (d->dpy == dpy) { if ((long) (evt->serial - d->serial) >= 0) d->mi...
@@ -533,12 +533,30 @@ XRenderQueryFormats (Display *dpy) screen->fallback = _XRenderFindFormat (xri, xScreen->fallback); screen->subpixel = SubPixelUnknown; xDepth = (xPictDepth *) (xScreen + 1); + if (screen->ndepths > rep.numDepths) { + Xfree (xri); + Xfree (xData); + _XEatDataWords (dpy, rep.length...
CWE-787
null
null
6,590
XRenderExtAddDisplay (XRenderExtInfo *extinfo, Display *dpy, char *ext_name) { XRenderExtDisplayInfo *dpyinfo; dpyinfo = (XRenderExtDisplayInfo *) Xmalloc (sizeof (XRenderExtDisplayInfo)); if (!dpyinfo) return NULL; dpyinfo->display = dpy; ...
Overflow
0
XRenderExtAddDisplay (XRenderExtInfo *extinfo, Display *dpy, char *ext_name) { XRenderExtDisplayInfo *dpyinfo; dpyinfo = (XRenderExtDisplayInfo *) Xmalloc (sizeof (XRenderExtDisplayInfo)); if (!dpyinfo) return NULL; dpyinfo->display = dpy; ...
@@ -533,12 +533,30 @@ XRenderQueryFormats (Display *dpy) screen->fallback = _XRenderFindFormat (xri, xScreen->fallback); screen->subpixel = SubPixelUnknown; xDepth = (xPictDepth *) (xScreen + 1); + if (screen->ndepths > rep.numDepths) { + Xfree (xri); + Xfree (xData); + _XEatDataWords (dpy, rep.length...
CWE-787
null
null
6,591
XRenderExtFindDisplay (XRenderExtInfo *extinfo, Display *dpy) { XRenderExtDisplayInfo *dpyinfo; /* * see if this was the most recently accessed display */ if ((dpyinfo = extinfo->cur) && dpyinfo->display == dpy) return dpyinfo; /* * look for display...
Overflow
0
XRenderExtFindDisplay (XRenderExtInfo *extinfo, Display *dpy) { XRenderExtDisplayInfo *dpyinfo; /* * see if this was the most recently accessed display */ if ((dpyinfo = extinfo->cur) && dpyinfo->display == dpy) return dpyinfo; /* * look for display...
@@ -533,12 +533,30 @@ XRenderQueryFormats (Display *dpy) screen->fallback = _XRenderFindFormat (xri, xScreen->fallback); screen->subpixel = SubPixelUnknown; xDepth = (xPictDepth *) (xScreen + 1); + if (screen->ndepths > rep.numDepths) { + Xfree (xri); + Xfree (xData); + _XEatDataWords (dpy, rep.length...
CWE-787
null
null
6,592
XRenderExtRemoveDisplay (XRenderExtInfo *extinfo, Display *dpy) { XRenderExtDisplayInfo *dpyinfo, *prev; /* * locate this display and its back link so that it can be removed */ _XLockMutex(_Xglobal_lock); prev = NULL; for (dpyinfo = extinfo->head; dpyinfo; dpyinfo = dpyinfo->next) { if (...
Overflow
0
XRenderExtRemoveDisplay (XRenderExtInfo *extinfo, Display *dpy) { XRenderExtDisplayInfo *dpyinfo, *prev; /* * locate this display and its back link so that it can be removed */ _XLockMutex(_Xglobal_lock); prev = NULL; for (dpyinfo = extinfo->head; dpyinfo; dpyinfo = dpyinfo->next) { if (...
@@ -533,12 +533,30 @@ XRenderQueryFormats (Display *dpy) screen->fallback = _XRenderFindFormat (xri, xScreen->fallback); screen->subpixel = SubPixelUnknown; xDepth = (xPictDepth *) (xScreen + 1); + if (screen->ndepths > rep.numDepths) { + Xfree (xri); + Xfree (xData); + _XEatDataWords (dpy, rep.length...
CWE-787
null
null
6,593
XRenderFindDisplay (Display *dpy) { XRenderExtDisplayInfo *dpyinfo; dpyinfo = XRenderExtFindDisplay (&XRenderExtensionInfo, dpy); if (!dpyinfo) dpyinfo = XRenderExtAddDisplay (&XRenderExtensionInfo, dpy, XRenderExtensionName); return dpyinfo; }
Overflow
0
XRenderFindDisplay (Display *dpy) { XRenderExtDisplayInfo *dpyinfo; dpyinfo = XRenderExtFindDisplay (&XRenderExtensionInfo, dpy); if (!dpyinfo) dpyinfo = XRenderExtAddDisplay (&XRenderExtensionInfo, dpy, XRenderExtensionName); return dpyinfo; }
@@ -533,12 +533,30 @@ XRenderQueryFormats (Display *dpy) screen->fallback = _XRenderFindFormat (xri, xScreen->fallback); screen->subpixel = SubPixelUnknown; xDepth = (xPictDepth *) (xScreen + 1); + if (screen->ndepths > rep.numDepths) { + Xfree (xri); + Xfree (xData); + _XEatDataWords (dpy, rep.length...
CWE-787
null
null
6,594
XRenderHasDepths (Display *dpy) { int s; for (s = 0; s < ScreenCount (dpy); s++) { CARD32 depths = 0; CARD32 missing; Screen *scr = ScreenOfDisplay (dpy, s); int d; for (d = 0; d < scr->ndepths; d++) depths |= DEPTH_MASK(scr->depths[d].depth); missing = ~depths & REQUIRED_DE...
Overflow
0
XRenderHasDepths (Display *dpy) { int s; for (s = 0; s < ScreenCount (dpy); s++) { CARD32 depths = 0; CARD32 missing; Screen *scr = ScreenOfDisplay (dpy, s); int d; for (d = 0; d < scr->ndepths; d++) depths |= DEPTH_MASK(scr->depths[d].depth); missing = ~depths & REQUIRED_DE...
@@ -533,12 +533,30 @@ XRenderQueryFormats (Display *dpy) screen->fallback = _XRenderFindFormat (xri, xScreen->fallback); screen->subpixel = SubPixelUnknown; xDepth = (xPictDepth *) (xScreen + 1); + if (screen->ndepths > rep.numDepths) { + Xfree (xri); + Xfree (xData); + _XEatDataWords (dpy, rep.length...
CWE-787
null
null
6,595
Bool XRenderQueryExtension (Display *dpy, int *event_basep, int *error_basep) { XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); if (RenderHasExtension(info)) { *event_basep = info->codes->first_event; *error_basep = info->codes->first_error; return True; } else { return False; } }
Overflow
0
Bool XRenderQueryExtension (Display *dpy, int *event_basep, int *error_basep) { XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); if (RenderHasExtension(info)) { *event_basep = info->codes->first_event; *error_basep = info->codes->first_error; return True; } else { return False; } }
@@ -533,12 +533,30 @@ XRenderQueryFormats (Display *dpy) screen->fallback = _XRenderFindFormat (xri, xScreen->fallback); screen->subpixel = SubPixelUnknown; xDepth = (xPictDepth *) (xScreen + 1); + if (screen->ndepths > rep.numDepths) { + Xfree (xri); + Xfree (xData); + _XEatDataWords (dpy, rep.length...
CWE-787
null
null
6,596
SizeID XRRConfigCurrentConfiguration (XRRScreenConfiguration *config, Rotation *rotation) { *rotation = (Rotation) config->current_rotation; return (SizeID) config->current_size; }
null
0
SizeID XRRConfigCurrentConfiguration (XRRScreenConfiguration *config, Rotation *rotation) { *rotation = (Rotation) config->current_rotation; return (SizeID) config->current_size; }
@@ -29,6 +29,7 @@ #include <config.h> #endif +#include <limits.h> #include <stdio.h> #include <X11/Xlib.h> /* we need to be able to manipulate the Display structure on events */ @@ -272,23 +273,30 @@ static XRRScreenConfiguration *_XRRGetScreenInfo (Display *dpy, rep.rate = 0; rep.nrateEnts = 0; } + ...
CWE-787
null
null
6,597
short XRRConfigCurrentRate (XRRScreenConfiguration *config) { return config->current_rate; }
null
0
short XRRConfigCurrentRate (XRRScreenConfiguration *config) { return config->current_rate; }
@@ -29,6 +29,7 @@ #include <config.h> #endif +#include <limits.h> #include <stdio.h> #include <X11/Xlib.h> /* we need to be able to manipulate the Display structure on events */ @@ -272,23 +273,30 @@ static XRRScreenConfiguration *_XRRGetScreenInfo (Display *dpy, rep.rate = 0; rep.nrateEnts = 0; } + ...
CWE-787
null
null
6,598
short *XRRConfigRates (XRRScreenConfiguration *config, int sizeID, int *nrates) { short *r = config->rates; int nents = config->nrates; /* Skip over the intervening rate lists */ while (sizeID > 0 && nents > 0) { int i = (*r + 1); r += i; nents -= i; sizeID--; } if (!nents) { ...
null
0
short *XRRConfigRates (XRRScreenConfiguration *config, int sizeID, int *nrates) { short *r = config->rates; int nents = config->nrates; /* Skip over the intervening rate lists */ while (sizeID > 0 && nents > 0) { int i = (*r + 1); r += i; nents -= i; sizeID--; } if (!nents) { ...
@@ -29,6 +29,7 @@ #include <config.h> #endif +#include <limits.h> #include <stdio.h> #include <X11/Xlib.h> /* we need to be able to manipulate the Display structure on events */ @@ -272,23 +273,30 @@ static XRRScreenConfiguration *_XRRGetScreenInfo (Display *dpy, rep.rate = 0; rep.nrateEnts = 0; } + ...
CWE-787
null
null
6,599
Rotation XRRConfigRotations(XRRScreenConfiguration *config, Rotation *current_rotation) { *current_rotation = config->current_rotation; return config->rotations; }
null
0
Rotation XRRConfigRotations(XRRScreenConfiguration *config, Rotation *current_rotation) { *current_rotation = config->current_rotation; return config->rotations; }
@@ -29,6 +29,7 @@ #include <config.h> #endif +#include <limits.h> #include <stdio.h> #include <X11/Xlib.h> /* we need to be able to manipulate the Display structure on events */ @@ -272,23 +273,30 @@ static XRRScreenConfiguration *_XRRGetScreenInfo (Display *dpy, rep.rate = 0; rep.nrateEnts = 0; } + ...
CWE-787
null
null