id stringlengths 13 16 | source stringlengths 14 241k | label stringclasses 33
values |
|---|---|---|
CVE-2018-1000050 | static int start_packet(vorb *f)
{
while (f->next_seg == -1) {
if (!start_page(f)) return FALSE;
if (f->page_flag & PAGEFLAG_continued_packet)
return error(f, VORBIS_continued_packet_flag_invalid);
}
f->last_seg = FALSE;
f->valid_bits = 0;
f->packet_bytes = 0;
f->bytes_in_seg = 0;
return TRUE;
}
| Non-vul |
CVE-2017-6903 | int S_AL_GetVoiceAmplitude( int entityNum ) {
return 0;
}
| Non-vul |
CVE-2016-10218 | pdf14_mark_fill_rectangle_ko_simple(gx_device * dev, int x, int y, int w, int h,
gx_color_index color,
const gx_device_color *pdc, bool devn)
{
pdf14_device *pdev = (pdf14_device *)dev;
pdf14_buf *buf = pdev->ctx->stack;
gs_blend_mode_t blend_mode = pdev->blend_mode;
int i, j, k;
byte *bline, *bg_ptr, *line, *dst_ptr;
byte src[PDF14_MAX_PLANES];
byte dst[PDF14_MAX_PLANES] = { 0 };
int rowstride = buf->rowstride;
int planestride = buf->planestride;
int num_chan = buf->n_chan;
int num_comp = num_chan - 1;
int shape_off = num_chan * planestride;
bool has_shape = buf->has_shape;
bool has_alpha_g = buf->has_alpha_g;
int alpha_g_off = shape_off + (has_shape ? planestride : 0);
int tag_off = shape_off + (has_alpha_g ? planestride : 0) +
(has_shape ? planestride : 0);
bool has_tags = buf->has_tags;
bool additive = pdev->ctx->additive;
gs_graphics_type_tag_t curr_tag = dev->graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS;
gx_color_index mask = ((gx_color_index)1 << 8) - 1;
int shift = 8;
byte shape = 0; /* Quiet compiler. */
byte src_alpha;
if (buf->data == NULL)
return 0;
#if 0
if (sizeof(color) <= sizeof(ulong))
if_debug6m('v', dev->memory,
"[v]pdf14_mark_fill_rectangle_ko_simple, (%d, %d), %d x %d color = %lx, nc %d,\n",
x, y, w, h, (ulong)color, num_chan);
else
if_debug7m('v', dev->memory,
"[v]pdf14_mark_fill_rectangle_ko_simple, (%d, %d), %d x %d color = %8lx%08lx, nc %d,\n",
x, y, w, h,
(ulong)(color >> 8*(sizeof(color) - sizeof(ulong))), (ulong)color,
num_chan);
#endif
/*
* Unpack the gx_color_index values. Complement the components for subtractive
* color spaces.
*/
if (devn) {
if (additive) {
for (j = 0; j < num_comp; j++) {
src[j] = ((pdc->colors.devn.values[j]) >> shift & mask);
}
} else {
for (j = 0; j < num_comp; j++) {
src[j] = 255 - ((pdc->colors.devn.values[j]) >> shift & mask);
}
}
} else
pdev->pdf14_procs->unpack_color(num_comp, color, pdev, src);
src_alpha = src[num_comp] = (byte)floor (255 * pdev->alpha + 0.5);
if (has_shape) {
shape = (byte)floor (255 * pdev->shape + 0.5);
} else {
shape_off = 0;
}
if (has_tags) {
curr_tag = (color >> (num_comp*8)) & 0xff;
} else {
tag_off = 0;
}
if (!has_alpha_g)
alpha_g_off = 0;
src_alpha = 255 - src_alpha;
shape = 255 - shape;
/* Fit the mark into the bounds of the buffer */
if (x < buf->rect.p.x) {
w += x - buf->rect.p.x;
x = buf->rect.p.x;
}
if (y < buf->rect.p.y) {
h += y - buf->rect.p.y;
y = buf->rect.p.y;
}
if (x + w > buf->rect.q.x) w = buf->rect.q.x - x;
if (y + h > buf->rect.q.y) h = buf->rect.q.y - y;
/* Update the dirty rectangle with the mark. */
if (x < buf->dirty.p.x) buf->dirty.p.x = x;
if (y < buf->dirty.p.y) buf->dirty.p.y = y;
if (x + w > buf->dirty.q.x) buf->dirty.q.x = x + w;
if (y + h > buf->dirty.q.y) buf->dirty.q.y = y + h;
/* composite with backdrop only */
bline = buf->backdrop + (x - buf->rect.p.x) + (y - buf->rect.p.y) * rowstride;
line = buf->data + (x - buf->rect.p.x) + (y - buf->rect.p.y) * rowstride;
for (j = 0; j < h; ++j) {
bg_ptr = bline;
dst_ptr = line;
for (i = 0; i < w; ++i) {
/* Complement the components for subtractive color spaces */
if (additive) {
for (k = 0; k < num_chan; ++k)
dst[k] = bg_ptr[k * planestride];
} else {
for (k = 0; k < num_comp; ++k)
dst[k] = 255 - bg_ptr[k * planestride];
}
dst[num_comp] = bg_ptr[num_comp * planestride]; /* alpha doesn't invert */
if (buf->isolated) {
art_pdf_knockoutisolated_group_8(dst, src, num_comp);
} else {
art_pdf_composite_knockout_8(dst, src, num_comp,
blend_mode, pdev->blend_procs, pdev);
}
/* Complement the results for subtractive color spaces */
if (additive) {
for (k = 0; k < num_chan; ++k)
dst_ptr[k * planestride] = dst[k];
} else {
for (k = 0; k < num_comp; ++k)
dst_ptr[k * planestride] = 255 - dst[k];
dst_ptr[num_comp * planestride] = dst[num_comp];
}
if (tag_off) {
dst_ptr[tag_off] = curr_tag;
}
if (alpha_g_off) {
int tmp = (255 - dst_ptr[alpha_g_off]) * src_alpha + 0x80;
dst_ptr[alpha_g_off] = 255 - ((tmp + (tmp >> 8)) >> 8);
}
if (shape_off) {
int tmp = (255 - dst_ptr[shape_off]) * shape + 0x80;
dst_ptr[shape_off] = 255 - ((tmp + (tmp >> 8)) >> 8);
}
++dst_ptr;
++bg_ptr;
}
bline += rowstride;
line += rowstride;
}
#if 0
/* #if RAW_DUMP */
/* Dump the current buffer to see what we have. */
dump_raw_buffer(pdev->ctx->stack->rect.q.y-pdev->ctx->stack->rect.p.y,
pdev->ctx->stack->rect.q.x-pdev->ctx->stack->rect.p.x,
pdev->ctx->stack->n_planes,
pdev->ctx->stack->planestride, pdev->ctx->stack->rowstride,
"Draw_Rect_KO",pdev->ctx->stack->data);
global_index++;
#endif
return 0;
}
| Non-vul |
CVE-2015-7884 | static int vivid_fb_blank(int blank_mode, struct fb_info *info)
{
struct vivid_dev *dev = (struct vivid_dev *)info->par;
dprintk(dev, 1, "Set blanking mode : %d\n", blank_mode);
switch (blank_mode) {
case FB_BLANK_UNBLANK:
break;
case FB_BLANK_NORMAL:
case FB_BLANK_HSYNC_SUSPEND:
case FB_BLANK_VSYNC_SUSPEND:
case FB_BLANK_POWERDOWN:
break;
}
return 0;
}
| Non-vul |
CVE-2016-0842 | WORD32 ih264d_delete_lt_node(dpb_manager_t *ps_dpb_mgr,
UWORD32 u4_lt_idx,
UWORD8 u1_fld_pic_flag,
struct dpb_info_t *ps_lt_node_to_insert,
WORD32 *pi4_status)
{
*pi4_status = 0;
if(ps_dpb_mgr->u1_num_lt_ref_bufs > 0)
{
WORD32 i;
struct dpb_info_t *ps_next_dpb;
/* ps_unmark_node points to the node to be removed */
/* from long term list. */
struct dpb_info_t *ps_unmark_node;
ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
if(ps_next_dpb->u1_lt_idx == u4_lt_idx)
{
ps_unmark_node = ps_next_dpb;
}
else
{
for(i = 1; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
{
if(ps_next_dpb->ps_prev_long->u1_lt_idx == u4_lt_idx)
break;
ps_next_dpb = ps_next_dpb->ps_prev_long;
}
if(i == ps_dpb_mgr->u1_num_lt_ref_bufs)
*pi4_status = 1;
else
ps_unmark_node = ps_next_dpb->ps_prev_long;
}
if(*pi4_status == 0)
{
if(u1_fld_pic_flag)
{
if(ps_lt_node_to_insert != ps_unmark_node)
{
UWORD8 u1_deleted = 0;
/* for the ps_unmark_node mark the corresponding field */
/* field as unused for reference */
if(ps_unmark_node->s_top_field.u1_long_term_frame_idx
== u4_lt_idx)
{
ps_unmark_node->s_top_field.u1_reference_info =
UNUSED_FOR_REF;
ps_unmark_node->s_top_field.u1_long_term_frame_idx =
MAX_REF_BUFS + 1;
u1_deleted = 1;
}
if(ps_unmark_node->s_bot_field.u1_long_term_frame_idx
== u4_lt_idx)
{
ps_unmark_node->s_bot_field.u1_reference_info =
UNUSED_FOR_REF;
ps_unmark_node->s_bot_field.u1_long_term_frame_idx =
MAX_REF_BUFS + 1;
u1_deleted = 1;
}
if(!u1_deleted)
{
UWORD32 i4_error_code;
i4_error_code = ERROR_DBP_MANAGER_T;
return i4_error_code;
}
}
ps_unmark_node->u1_used_as_ref =
ps_unmark_node->s_top_field.u1_reference_info
| ps_unmark_node->s_bot_field.u1_reference_info;
}
else
ps_unmark_node->u1_used_as_ref = UNUSED_FOR_REF;
if(UNUSED_FOR_REF == ps_unmark_node->u1_used_as_ref)
{
if(ps_unmark_node == ps_dpb_mgr->ps_dpb_ht_head)
ps_dpb_mgr->ps_dpb_ht_head = ps_next_dpb->ps_prev_long;
ps_unmark_node->u1_lt_idx = MAX_REF_BUFS + 1;
ps_unmark_node->s_top_field.u1_reference_info =
UNUSED_FOR_REF;
ps_unmark_node->s_bot_field.u1_reference_info =
UNUSED_FOR_REF;
ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
ps_unmark_node->u1_buf_id);
ps_next_dpb->ps_prev_long = ps_unmark_node->ps_prev_long; //update link
ps_unmark_node->ps_prev_long = NULL;
ps_dpb_mgr->u1_num_lt_ref_bufs--; //decrement LT buf count
}
}
}
return OK;
}
| Non-vul |
CVE-2016-1237 | static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_getaclargs *argp)
{
p = nfs2svc_decode_fh(p, &argp->fh);
if (!p)
return 0;
argp->mask = ntohl(*p); p++;
return xdr_argsize_check(rqstp, p);
}
| Non-vul |
CVE-2013-6643 | bool FormAssociatedElement::hasBadInput() const
{
return false;
}
| Non-vul |
CVE-2017-12993 | juniper_parse_header(netdissect_options *ndo,
const u_char *p, const struct pcap_pkthdr *h, struct juniper_l2info_t *l2info)
{
const struct juniper_cookie_table_t *lp = juniper_cookie_table;
u_int idx, jnx_ext_len, jnx_header_len = 0;
uint8_t tlv_type,tlv_len;
uint32_t control_word;
int tlv_value;
const u_char *tptr;
l2info->header_len = 0;
l2info->cookie_len = 0;
l2info->proto = 0;
l2info->length = h->len;
l2info->caplen = h->caplen;
ND_TCHECK2(p[0], 4);
l2info->flags = p[3];
l2info->direction = p[3]&JUNIPER_BPF_PKT_IN;
if (EXTRACT_24BITS(p) != JUNIPER_MGC_NUMBER) { /* magic number found ? */
ND_PRINT((ndo, "no magic-number found!"));
return 0;
}
if (ndo->ndo_eflag) /* print direction */
ND_PRINT((ndo, "%3s ", tok2str(juniper_direction_values, "---", l2info->direction)));
/* magic number + flags */
jnx_header_len = 4;
if (ndo->ndo_vflag > 1)
ND_PRINT((ndo, "\n\tJuniper PCAP Flags [%s]",
bittok2str(jnx_flag_values, "none", l2info->flags)));
/* extensions present ? - calculate how much bytes to skip */
if ((l2info->flags & JUNIPER_BPF_EXT ) == JUNIPER_BPF_EXT ) {
tptr = p+jnx_header_len;
/* ok to read extension length ? */
ND_TCHECK2(tptr[0], 2);
jnx_ext_len = EXTRACT_16BITS(tptr);
jnx_header_len += 2;
tptr +=2;
/* nail up the total length -
* just in case something goes wrong
* with TLV parsing */
jnx_header_len += jnx_ext_len;
if (ndo->ndo_vflag > 1)
ND_PRINT((ndo, ", PCAP Extension(s) total length %u", jnx_ext_len));
ND_TCHECK2(tptr[0], jnx_ext_len);
while (jnx_ext_len > JUNIPER_EXT_TLV_OVERHEAD) {
tlv_type = *(tptr++);
tlv_len = *(tptr++);
tlv_value = 0;
/* sanity checks */
if (tlv_type == 0 || tlv_len == 0)
break;
if (tlv_len+JUNIPER_EXT_TLV_OVERHEAD > jnx_ext_len)
goto trunc;
if (ndo->ndo_vflag > 1)
ND_PRINT((ndo, "\n\t %s Extension TLV #%u, length %u, value ",
tok2str(jnx_ext_tlv_values,"Unknown",tlv_type),
tlv_type,
tlv_len));
tlv_value = juniper_read_tlv_value(tptr, tlv_type, tlv_len);
switch (tlv_type) {
case JUNIPER_EXT_TLV_IFD_NAME:
/* FIXME */
break;
case JUNIPER_EXT_TLV_IFD_MEDIATYPE:
case JUNIPER_EXT_TLV_TTP_IFD_MEDIATYPE:
if (tlv_value != -1) {
if (ndo->ndo_vflag > 1)
ND_PRINT((ndo, "%s (%u)",
tok2str(juniper_ifmt_values, "Unknown", tlv_value),
tlv_value));
}
break;
case JUNIPER_EXT_TLV_IFL_ENCAPS:
case JUNIPER_EXT_TLV_TTP_IFL_ENCAPS:
if (tlv_value != -1) {
if (ndo->ndo_vflag > 1)
ND_PRINT((ndo, "%s (%u)",
tok2str(juniper_ifle_values, "Unknown", tlv_value),
tlv_value));
}
break;
case JUNIPER_EXT_TLV_IFL_IDX: /* fall through */
case JUNIPER_EXT_TLV_IFL_UNIT:
case JUNIPER_EXT_TLV_IFD_IDX:
default:
if (tlv_value != -1) {
if (ndo->ndo_vflag > 1)
ND_PRINT((ndo, "%u", tlv_value));
}
break;
}
tptr+=tlv_len;
jnx_ext_len -= tlv_len+JUNIPER_EXT_TLV_OVERHEAD;
}
if (ndo->ndo_vflag > 1)
ND_PRINT((ndo, "\n\t-----original packet-----\n\t"));
}
if ((l2info->flags & JUNIPER_BPF_NO_L2 ) == JUNIPER_BPF_NO_L2 ) {
if (ndo->ndo_eflag)
ND_PRINT((ndo, "no-L2-hdr, "));
/* there is no link-layer present -
* perform the v4/v6 heuristics
* to figure out what it is
*/
ND_TCHECK2(p[jnx_header_len + 4], 1);
if (ip_heuristic_guess(ndo, p + jnx_header_len + 4,
l2info->length - (jnx_header_len + 4)) == 0)
ND_PRINT((ndo, "no IP-hdr found!"));
l2info->header_len=jnx_header_len+4;
return 0; /* stop parsing the output further */
}
l2info->header_len = jnx_header_len;
p+=l2info->header_len;
l2info->length -= l2info->header_len;
l2info->caplen -= l2info->header_len;
/* search through the cookie table and copy values matching for our PIC type */
while (lp->s != NULL) {
if (lp->pictype == l2info->pictype) {
l2info->cookie_len += lp->cookie_len;
switch (p[0]) {
case LS_COOKIE_ID:
l2info->cookie_type = LS_COOKIE_ID;
l2info->cookie_len += 2;
break;
case AS_COOKIE_ID:
l2info->cookie_type = AS_COOKIE_ID;
l2info->cookie_len = 8;
break;
default:
l2info->bundle = l2info->cookie[0];
break;
}
#ifdef DLT_JUNIPER_MFR
/* MFR child links don't carry cookies */
if (l2info->pictype == DLT_JUNIPER_MFR &&
(p[0] & MFR_BE_MASK) == MFR_BE_MASK) {
l2info->cookie_len = 0;
}
#endif
l2info->header_len += l2info->cookie_len;
l2info->length -= l2info->cookie_len;
l2info->caplen -= l2info->cookie_len;
if (ndo->ndo_eflag)
ND_PRINT((ndo, "%s-PIC, cookie-len %u",
lp->s,
l2info->cookie_len));
if (l2info->cookie_len > 0) {
ND_TCHECK2(p[0], l2info->cookie_len);
if (ndo->ndo_eflag)
ND_PRINT((ndo, ", cookie 0x"));
for (idx = 0; idx < l2info->cookie_len; idx++) {
l2info->cookie[idx] = p[idx]; /* copy cookie data */
if (ndo->ndo_eflag) ND_PRINT((ndo, "%02x", p[idx]));
}
}
if (ndo->ndo_eflag) ND_PRINT((ndo, ": ")); /* print demarc b/w L2/L3*/
l2info->proto = EXTRACT_16BITS(p+l2info->cookie_len);
break;
}
++lp;
}
p+=l2info->cookie_len;
/* DLT_ specific parsing */
switch(l2info->pictype) {
#ifdef DLT_JUNIPER_MLPPP
case DLT_JUNIPER_MLPPP:
switch (l2info->cookie_type) {
case LS_COOKIE_ID:
l2info->bundle = l2info->cookie[1];
break;
case AS_COOKIE_ID:
l2info->bundle = (EXTRACT_16BITS(&l2info->cookie[6])>>3)&0xfff;
l2info->proto = (l2info->cookie[5])&JUNIPER_LSQ_L3_PROTO_MASK;
break;
default:
l2info->bundle = l2info->cookie[0];
break;
}
break;
#endif
#ifdef DLT_JUNIPER_MLFR
case DLT_JUNIPER_MLFR:
switch (l2info->cookie_type) {
case LS_COOKIE_ID:
l2info->bundle = l2info->cookie[1];
l2info->proto = EXTRACT_16BITS(p);
l2info->header_len += 2;
l2info->length -= 2;
l2info->caplen -= 2;
break;
case AS_COOKIE_ID:
l2info->bundle = (EXTRACT_16BITS(&l2info->cookie[6])>>3)&0xfff;
l2info->proto = (l2info->cookie[5])&JUNIPER_LSQ_L3_PROTO_MASK;
break;
default:
l2info->bundle = l2info->cookie[0];
l2info->header_len += 2;
l2info->length -= 2;
l2info->caplen -= 2;
break;
}
break;
#endif
#ifdef DLT_JUNIPER_MFR
case DLT_JUNIPER_MFR:
switch (l2info->cookie_type) {
case LS_COOKIE_ID:
l2info->bundle = l2info->cookie[1];
l2info->proto = EXTRACT_16BITS(p);
l2info->header_len += 2;
l2info->length -= 2;
l2info->caplen -= 2;
break;
case AS_COOKIE_ID:
l2info->bundle = (EXTRACT_16BITS(&l2info->cookie[6])>>3)&0xfff;
l2info->proto = (l2info->cookie[5])&JUNIPER_LSQ_L3_PROTO_MASK;
break;
default:
l2info->bundle = l2info->cookie[0];
break;
}
break;
#endif
#ifdef DLT_JUNIPER_ATM2
case DLT_JUNIPER_ATM2:
ND_TCHECK2(p[0], 4);
/* ATM cell relay control word present ? */
if (l2info->cookie[7] & ATM2_PKT_TYPE_MASK) {
control_word = EXTRACT_32BITS(p);
/* some control word heuristics */
switch(control_word) {
case 0: /* zero control word */
case 0x08000000: /* < JUNOS 7.4 control-word */
case 0x08380000: /* cntl word plus cell length (56) >= JUNOS 7.4*/
l2info->header_len += 4;
break;
default:
break;
}
if (ndo->ndo_eflag)
ND_PRINT((ndo, "control-word 0x%08x ", control_word));
}
break;
#endif
#ifdef DLT_JUNIPER_GGSN
case DLT_JUNIPER_GGSN:
break;
#endif
#ifdef DLT_JUNIPER_ATM1
case DLT_JUNIPER_ATM1:
break;
#endif
#ifdef DLT_JUNIPER_PPP
case DLT_JUNIPER_PPP:
break;
#endif
#ifdef DLT_JUNIPER_CHDLC
case DLT_JUNIPER_CHDLC:
break;
#endif
#ifdef DLT_JUNIPER_ETHER
case DLT_JUNIPER_ETHER:
break;
#endif
#ifdef DLT_JUNIPER_FRELAY
case DLT_JUNIPER_FRELAY:
break;
#endif
default:
ND_PRINT((ndo, "Unknown Juniper DLT_ type %u: ", l2info->pictype));
break;
}
if (ndo->ndo_eflag > 1)
ND_PRINT((ndo, "hlen %u, proto 0x%04x, ", l2info->header_len, l2info->proto));
return 1; /* everything went ok so far. continue parsing */
trunc:
ND_PRINT((ndo, "[|juniper_hdr], length %u", h->len));
return 0;
}
| CWE-125 |
CVE-2017-5061 | LayerTreeHost::ReleaseCompositorFrameSink() {
DCHECK(!visible_);
DidLoseCompositorFrameSink();
proxy_->ReleaseCompositorFrameSink();
return std::move(current_compositor_frame_sink_);
}
| Non-vul |
CVE-2016-2419 | void readVector(Parcel &reply, Vector<uint8_t> &vector) const {
uint32_t size = reply.readInt32();
vector.insertAt((size_t)0, size);
reply.read(vector.editArray(), size);
}
| Non-vul |
CVE-2014-5045 | void path_get(const struct path *path)
{
mntget(path->mnt);
dget(path->dentry);
}
| Non-vul |
CVE-2018-6085 | std::string BackendImpl::HistogramName(const char* name, int experiment) const {
if (!experiment)
return base::StringPrintf("DiskCache.%d.%s", cache_type_, name);
return base::StringPrintf("DiskCache.%d.%s_%d", cache_type_,
name, experiment);
}
| Non-vul |
CVE-2012-2895 | base::Time DownloadItemImpl::GetStartTime() const { return start_time_; }
| Non-vul |
CVE-2013-6381 | static int qeth_clear_channels(struct qeth_card *card)
{
int rc1 = 0, rc2 = 0, rc3 = 0;
QETH_CARD_TEXT(card, 3, "clearchs");
rc1 = qeth_clear_channel(&card->read);
rc2 = qeth_clear_channel(&card->write);
rc3 = qeth_clear_channel(&card->data);
if (rc1)
return rc1;
if (rc2)
return rc2;
return rc3;
}
| Non-vul |
CVE-2019-17178 | static unsigned readChunk_bKGD(LodePNGInfo* info, const unsigned char* data, size_t chunkLength)
{
if(info->color.colortype == LCT_PALETTE)
{
/*error: this chunk must be 1 byte for indexed color image*/
if(chunkLength != 1) return 43;
info->background_defined = 1;
info->background_r = info->background_g = info->background_b = data[0];
}
else if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA)
{
/*error: this chunk must be 2 bytes for greyscale image*/
if(chunkLength != 2) return 44;
info->background_defined = 1;
info->background_r = info->background_g = info->background_b = 256u * data[0] + data[1];
}
else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA)
{
/*error: this chunk must be 6 bytes for greyscale image*/
if(chunkLength != 6) return 45;
info->background_defined = 1;
info->background_r = 256u * data[0] + data[1];
info->background_g = 256u * data[2] + data[3];
info->background_b = 256u * data[4] + data[5];
}
return 0; /* OK */
}
| Non-vul |
CVE-2017-9059 | static void release_openowner(struct nfs4_openowner *oo)
{
struct nfs4_ol_stateid *stp;
struct nfs4_client *clp = oo->oo_owner.so_client;
struct list_head reaplist;
INIT_LIST_HEAD(&reaplist);
spin_lock(&clp->cl_lock);
unhash_openowner_locked(oo);
while (!list_empty(&oo->oo_owner.so_stateids)) {
stp = list_first_entry(&oo->oo_owner.so_stateids,
struct nfs4_ol_stateid, st_perstateowner);
if (unhash_open_stateid(stp, &reaplist))
put_ol_stateid_locked(stp, &reaplist);
}
spin_unlock(&clp->cl_lock);
free_ol_stateid_reaplist(&reaplist);
release_last_closed_stateid(oo);
nfs4_put_stateowner(&oo->oo_owner);
}
| Non-vul |
CVE-2017-8067 | static ssize_t debugfs_read(struct file *filp, char __user *ubuf,
size_t count, loff_t *offp)
{
struct port *port;
char *buf;
ssize_t ret, out_offset, out_count;
out_count = 1024;
buf = kmalloc(out_count, GFP_KERNEL);
if (!buf)
return -ENOMEM;
port = filp->private_data;
out_offset = 0;
out_offset += snprintf(buf + out_offset, out_count,
"name: %s\n", port->name ? port->name : "");
out_offset += snprintf(buf + out_offset, out_count - out_offset,
"guest_connected: %d\n", port->guest_connected);
out_offset += snprintf(buf + out_offset, out_count - out_offset,
"host_connected: %d\n", port->host_connected);
out_offset += snprintf(buf + out_offset, out_count - out_offset,
"outvq_full: %d\n", port->outvq_full);
out_offset += snprintf(buf + out_offset, out_count - out_offset,
"bytes_sent: %lu\n", port->stats.bytes_sent);
out_offset += snprintf(buf + out_offset, out_count - out_offset,
"bytes_received: %lu\n",
port->stats.bytes_received);
out_offset += snprintf(buf + out_offset, out_count - out_offset,
"bytes_discarded: %lu\n",
port->stats.bytes_discarded);
out_offset += snprintf(buf + out_offset, out_count - out_offset,
"is_console: %s\n",
is_console_port(port) ? "yes" : "no");
out_offset += snprintf(buf + out_offset, out_count - out_offset,
"console_vtermno: %u\n", port->cons.vtermno);
ret = simple_read_from_buffer(ubuf, count, offp, buf, out_offset);
kfree(buf);
return ret;
}
| Non-vul |
CVE-2016-2177 | int tls1_set_server_sigalgs(SSL *s)
{
int al;
size_t i;
/* Clear any shared sigtnature algorithms */
if (s->cert->shared_sigalgs) {
OPENSSL_free(s->cert->shared_sigalgs);
s->cert->shared_sigalgs = NULL;
s->cert->shared_sigalgslen = 0;
}
/* Clear certificate digests and validity flags */
for (i = 0; i < SSL_PKEY_NUM; i++) {
s->cert->pkeys[i].digest = NULL;
s->cert->pkeys[i].valid_flags = 0;
}
/* If sigalgs received process it. */
if (s->cert->peer_sigalgs) {
if (!tls1_process_sigalgs(s)) {
SSLerr(SSL_F_TLS1_SET_SERVER_SIGALGS, ERR_R_MALLOC_FAILURE);
al = SSL_AD_INTERNAL_ERROR;
goto err;
}
/* Fatal error is no shared signature algorithms */
if (!s->cert->shared_sigalgs) {
SSLerr(SSL_F_TLS1_SET_SERVER_SIGALGS,
SSL_R_NO_SHARED_SIGATURE_ALGORITHMS);
al = SSL_AD_ILLEGAL_PARAMETER;
goto err;
}
} else
ssl_cert_set_default_md(s->cert);
return 1;
err:
ssl3_send_alert(s, SSL3_AL_FATAL, al);
return 0;
}
| Non-vul |
CVE-2012-1179 | static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
gfp_t gfp_mask, enum charge_type ctype)
{
struct mem_cgroup *memcg = NULL;
unsigned int nr_pages = 1;
struct page_cgroup *pc;
bool oom = true;
int ret;
if (PageTransHuge(page)) {
nr_pages <<= compound_order(page);
VM_BUG_ON(!PageTransHuge(page));
/*
* Never OOM-kill a process for a huge page. The
* fault handler will fall back to regular pages.
*/
oom = false;
}
pc = lookup_page_cgroup(page);
ret = __mem_cgroup_try_charge(mm, gfp_mask, nr_pages, &memcg, oom);
if (ret == -ENOMEM)
return ret;
__mem_cgroup_commit_charge(memcg, page, nr_pages, pc, ctype, false);
return 0;
}
| Non-vul |
CVE-2012-1179 | static void check_sync_rss_stat(struct task_struct *task)
{
}
| Non-vul |
CVE-2017-9211 | static void crypto_skcipher_free_instance(struct crypto_instance *inst)
{
struct skcipher_instance *skcipher =
container_of(inst, struct skcipher_instance, s.base);
skcipher->free(skcipher);
}
| Non-vul |
CVE-2017-12187 | ProcRenderDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data < RenderNumberRequests)
return (*ProcRenderVector[stuff->data]) (client);
else
return BadRequest;
}
| Non-vul |
CVE-2018-1000039 | pdf_cmap_wmode(fz_context *ctx, pdf_cmap *cmap)
{
return cmap->wmode;
}
| Non-vul |
CVE-2016-4303 | iperf_get_test_get_server_output(struct iperf_test *ipt)
{
return ipt->get_server_output;
}
| Non-vul |
CVE-2019-13307 | MagickExport MagickBooleanType GetImageMean(const Image *image,double *mean,
double *standard_deviation,ExceptionInfo *exception)
{
MagickBooleanType
status;
status=GetImageChannelMean(image,CompositeChannels,mean,standard_deviation,
exception);
return(status);
}
| Non-vul |
CVE-2011-1300 | void CrosLibrary::TestApi::SetTouchpadLibrary(
TouchpadLibrary* library, bool own) {
library_->touchpad_lib_.SetImpl(library, own);
}
| CWE-189 |
CVE-2014-1713 | static void voidMethodLongArgTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
TestObjectPythonV8Internal::voidMethodLongArgTestInterfaceEmptyArgMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| Non-vul |
CVE-2015-1351 | size_t zend_shared_alloc_get_free_memory(void)
{
return ZSMMG(shared_free);
}
| Non-vul |
CVE-2011-2789 | void ResourceTracker::InstanceCrashed(PP_Instance instance) {
CleanupInstanceData(instance, false);
}
| Non-vul |
CVE-2011-2840 | virtual void BookmarkAllTabs() {}
| Non-vul |
CVE-2014-2669 | lseg_interpt_internal(LSEG *l1, LSEG *l2)
{
Point *result;
LINE tmp1,
tmp2;
/*
* Find the intersection of the appropriate lines, if any.
*/
line_construct_pts(&tmp1, &l1->p[0], &l1->p[1]);
line_construct_pts(&tmp2, &l2->p[0], &l2->p[1]);
result = line_interpt_internal(&tmp1, &tmp2);
if (!PointerIsValid(result))
return NULL;
/*
* If the line intersection point isn't within l1 (or equivalently l2),
* there is no valid segment intersection point at all.
*/
if (!on_ps_internal(result, l1) ||
!on_ps_internal(result, l2))
{
pfree(result);
return NULL;
}
/*
* If there is an intersection, then check explicitly for matching
* endpoints since there may be rounding effects with annoying lsb
* residue. - tgl 1997-07-09
*/
if ((FPeq(l1->p[0].x, l2->p[0].x) && FPeq(l1->p[0].y, l2->p[0].y)) ||
(FPeq(l1->p[0].x, l2->p[1].x) && FPeq(l1->p[0].y, l2->p[1].y)))
{
result->x = l1->p[0].x;
result->y = l1->p[0].y;
}
else if ((FPeq(l1->p[1].x, l2->p[0].x) && FPeq(l1->p[1].y, l2->p[0].y)) ||
(FPeq(l1->p[1].x, l2->p[1].x) && FPeq(l1->p[1].y, l2->p[1].y)))
{
result->x = l1->p[1].x;
result->y = l1->p[1].y;
}
return result;
}
| Non-vul |
CVE-2018-18338 | UnacceleratedStaticBitmapImage::MakeAccelerated(
base::WeakPtr<WebGraphicsContext3DProviderWrapper> context_wrapper) {
if (!context_wrapper)
return nullptr; // Can happen if the context is lost.
GrContext* grcontext = context_wrapper->ContextProvider()->GetGrContext();
if (!grcontext)
return nullptr; // Can happen if the context is lost.
sk_sp<SkImage> sk_image = paint_image_.GetSkImage();
sk_sp<SkImage> gpu_skimage =
sk_image->makeTextureImage(grcontext, sk_image->colorSpace());
if (!gpu_skimage)
return nullptr;
return AcceleratedStaticBitmapImage::CreateFromSkImage(
std::move(gpu_skimage), std::move(context_wrapper));
}
| CWE-119 |
CVE-2013-1772 | static void boot_delay_msec(void)
{
unsigned long long k;
unsigned long timeout;
if (boot_delay == 0 || system_state != SYSTEM_BOOTING)
return;
k = (unsigned long long)loops_per_msec * boot_delay;
timeout = jiffies + msecs_to_jiffies(boot_delay);
while (k) {
k--;
cpu_relax();
/*
* use (volatile) jiffies to prevent
* compiler reduction; loop termination via jiffies
* is secondary and may or may not happen.
*/
if (time_after(jiffies, timeout))
break;
touch_nmi_watchdog();
}
}
| Non-vul |
CVE-2014-3690 | static int handle_nmi_window(struct kvm_vcpu *vcpu)
{
u32 cpu_based_vm_exec_control;
/* clear pending NMI */
cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
cpu_based_vm_exec_control &= ~CPU_BASED_VIRTUAL_NMI_PENDING;
vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
++vcpu->stat.nmi_window_exits;
kvm_make_request(KVM_REQ_EVENT, vcpu);
return 1;
}
| Non-vul |
CVE-2011-2707 | void user_disable_single_step(struct task_struct *child)
{
child->ptrace &= ~PT_SINGLESTEP;
}
| Non-vul |
CVE-2016-7539 | static PixelPacket *QueueAuthenticPixelsCache(Image *image,const ssize_t x,
const ssize_t y,const size_t columns,const size_t rows,
ExceptionInfo *exception)
{
CacheInfo
*magick_restrict cache_info;
const int
id = GetOpenMPThreadId();
assert(image != (const Image *) NULL);
assert(image->signature == MagickSignature);
assert(image->cache != (Cache) NULL);
cache_info=(CacheInfo *) image->cache;
assert(cache_info->signature == MagickSignature);
assert(id < (int) cache_info->number_threads);
return(QueueAuthenticPixelCacheNexus(image,x,y,columns,rows,MagickFalse,
cache_info->nexus_info[id],exception));
}
| Non-vul |
CVE-2016-0826 | status_t Camera2Client::removeFrameListener(int32_t minId, int32_t maxId,
wp<camera2::FrameProcessor::FilteredListener> listener) {
return mFrameProcessor->removeListener(minId, maxId, listener);
}
| Non-vul |
CVE-2018-1000039 | pdf_new_run_processor(fz_context *ctx, fz_device *dev, const fz_matrix *ctm, const char *usage, pdf_gstate *gstate, int nested, fz_default_colorspaces *default_cs)
{
pdf_run_processor *proc = pdf_new_processor(ctx, sizeof *proc);
{
proc->super.usage = usage;
proc->super.drop_processor = pdf_drop_run_processor;
/* general graphics state */
proc->super.op_w = pdf_run_w;
proc->super.op_j = pdf_run_j;
proc->super.op_J = pdf_run_J;
proc->super.op_M = pdf_run_M;
proc->super.op_d = pdf_run_d;
proc->super.op_ri = pdf_run_ri;
proc->super.op_i = pdf_run_i;
proc->super.op_gs_begin = pdf_run_gs_begin;
proc->super.op_gs_end = pdf_run_gs_end;
/* transparency graphics state */
proc->super.op_gs_BM = pdf_run_gs_BM;
proc->super.op_gs_CA = pdf_run_gs_CA;
proc->super.op_gs_ca = pdf_run_gs_ca;
proc->super.op_gs_SMask = pdf_run_gs_SMask;
/* special graphics state */
proc->super.op_q = pdf_run_q;
proc->super.op_Q = pdf_run_Q;
proc->super.op_cm = pdf_run_cm;
/* path construction */
proc->super.op_m = pdf_run_m;
proc->super.op_l = pdf_run_l;
proc->super.op_c = pdf_run_c;
proc->super.op_v = pdf_run_v;
proc->super.op_y = pdf_run_y;
proc->super.op_h = pdf_run_h;
proc->super.op_re = pdf_run_re;
/* path painting */
proc->super.op_S = pdf_run_S;
proc->super.op_s = pdf_run_s;
proc->super.op_F = pdf_run_F;
proc->super.op_f = pdf_run_f;
proc->super.op_fstar = pdf_run_fstar;
proc->super.op_B = pdf_run_B;
proc->super.op_Bstar = pdf_run_Bstar;
proc->super.op_b = pdf_run_b;
proc->super.op_bstar = pdf_run_bstar;
proc->super.op_n = pdf_run_n;
/* clipping paths */
proc->super.op_W = pdf_run_W;
proc->super.op_Wstar = pdf_run_Wstar;
/* text objects */
proc->super.op_BT = pdf_run_BT;
proc->super.op_ET = pdf_run_ET;
/* text state */
proc->super.op_Tc = pdf_run_Tc;
proc->super.op_Tw = pdf_run_Tw;
proc->super.op_Tz = pdf_run_Tz;
proc->super.op_TL = pdf_run_TL;
proc->super.op_Tf = pdf_run_Tf;
proc->super.op_Tr = pdf_run_Tr;
proc->super.op_Ts = pdf_run_Ts;
/* text positioning */
proc->super.op_Td = pdf_run_Td;
proc->super.op_TD = pdf_run_TD;
proc->super.op_Tm = pdf_run_Tm;
proc->super.op_Tstar = pdf_run_Tstar;
/* text showing */
proc->super.op_TJ = pdf_run_TJ;
proc->super.op_Tj = pdf_run_Tj;
proc->super.op_squote = pdf_run_squote;
proc->super.op_dquote = pdf_run_dquote;
/* type 3 fonts */
proc->super.op_d0 = pdf_run_d0;
proc->super.op_d1 = pdf_run_d1;
/* color */
proc->super.op_CS = pdf_run_CS;
proc->super.op_cs = pdf_run_cs;
proc->super.op_SC_color = pdf_run_SC_color;
proc->super.op_sc_color = pdf_run_sc_color;
proc->super.op_SC_pattern = pdf_run_SC_pattern;
proc->super.op_sc_pattern = pdf_run_sc_pattern;
proc->super.op_SC_shade = pdf_run_SC_shade;
proc->super.op_sc_shade = pdf_run_sc_shade;
proc->super.op_G = pdf_run_G;
proc->super.op_g = pdf_run_g;
proc->super.op_RG = pdf_run_RG;
proc->super.op_rg = pdf_run_rg;
proc->super.op_K = pdf_run_K;
proc->super.op_k = pdf_run_k;
/* shadings, images, xobjects */
proc->super.op_sh = pdf_run_sh;
if (dev->fill_image || dev->fill_image_mask || dev->clip_image_mask)
{
proc->super.op_BI = pdf_run_BI;
proc->super.op_Do_image = pdf_run_Do_image;
}
proc->super.op_Do_form = pdf_run_Do_form;
/* marked content */
proc->super.op_MP = pdf_run_MP;
proc->super.op_DP = pdf_run_DP;
proc->super.op_BMC = pdf_run_BMC;
proc->super.op_BDC = pdf_run_BDC;
proc->super.op_EMC = pdf_run_EMC;
/* compatibility */
proc->super.op_BX = pdf_run_BX;
proc->super.op_EX = pdf_run_EX;
/* extgstate */
proc->super.op_gs_OP = pdf_run_gs_OP;
proc->super.op_gs_op = pdf_run_gs_op;
proc->super.op_gs_OPM = pdf_run_gs_OPM;
proc->super.op_gs_UseBlackPtComp = pdf_run_gs_UseBlackPtComp;
proc->super.op_END = pdf_run_END;
}
proc->dev = dev;
proc->default_cs = fz_keep_default_colorspaces(ctx, default_cs);
proc->nested_depth = nested;
proc->path = NULL;
proc->clip = 0;
proc->clip_even_odd = 0;
proc->tos.text = NULL;
proc->tos.tlm = fz_identity;
proc->tos.tm = fz_identity;
proc->tos.text_mode = 0;
fz_try(ctx)
{
proc->path = fz_new_path(ctx);
proc->gcap = 64;
proc->gstate = fz_malloc_array(ctx, proc->gcap, sizeof(pdf_gstate));
pdf_init_gstate(ctx, &proc->gstate[0], ctm);
if (gstate)
{
pdf_copy_gstate(ctx, &proc->gstate[0], gstate);
proc->gstate[0].clip_depth = 0;
proc->gstate[0].ctm = *ctm;
}
proc->gtop = 0;
proc->gbot = 0;
proc->gparent = 0;
}
fz_catch(ctx)
{
fz_drop_path(ctx, proc->path);
fz_free(ctx, proc);
fz_rethrow(ctx);
}
/* We need to save an extra level to allow for level 0 to be the parent gstate level. */
pdf_gsave(ctx, proc);
return (pdf_processor*)proc;
}
| Non-vul |
CVE-2016-9601 | jbig2_dump_huffman_state(Jbig2HuffmanState *hs)
{
fprintf(stderr, "huffman state %08x %08x offset %d.%d\n", hs->this_word, hs->next_word, hs->offset, hs->offset_bits);
}
| Non-vul |
CVE-2015-1528 | status_t Parcel::appendFrom(const Parcel *parcel, size_t offset, size_t len)
{
const sp<ProcessState> proc(ProcessState::self());
status_t err;
const uint8_t *data = parcel->mData;
const binder_size_t *objects = parcel->mObjects;
size_t size = parcel->mObjectsSize;
int startPos = mDataPos;
int firstIndex = -1, lastIndex = -2;
if (len == 0) {
return NO_ERROR;
}
if ((offset > parcel->mDataSize)
|| (len > parcel->mDataSize)
|| (offset + len > parcel->mDataSize)) {
return BAD_VALUE;
}
for (int i = 0; i < (int) size; i++) {
size_t off = objects[i];
if ((off >= offset) && (off < offset + len)) {
if (firstIndex == -1) {
firstIndex = i;
}
lastIndex = i;
}
}
int numObjects = lastIndex - firstIndex + 1;
if ((mDataSize+len) > mDataCapacity) {
err = growData(len);
if (err != NO_ERROR) {
return err;
}
}
memcpy(mData + mDataPos, data + offset, len);
mDataPos += len;
mDataSize += len;
err = NO_ERROR;
if (numObjects > 0) {
if (mObjectsCapacity < mObjectsSize + numObjects) {
int newSize = ((mObjectsSize + numObjects)*3)/2;
binder_size_t *objects =
(binder_size_t*)realloc(mObjects, newSize*sizeof(binder_size_t));
if (objects == (binder_size_t*)0) {
return NO_MEMORY;
}
mObjects = objects;
mObjectsCapacity = newSize;
}
int idx = mObjectsSize;
for (int i = firstIndex; i <= lastIndex; i++) {
size_t off = objects[i] - offset + startPos;
mObjects[idx++] = off;
mObjectsSize++;
flat_binder_object* flat
= reinterpret_cast<flat_binder_object*>(mData + off);
acquire_object(proc, *flat, this);
if (flat->type == BINDER_TYPE_FD) {
flat->handle = dup(flat->handle);
flat->cookie = 1;
mHasFds = mFdsKnown = true;
if (!mAllowFds) {
err = FDS_NOT_ALLOWED;
}
}
}
}
return err;
}
| Non-vul |
CVE-2016-7144 | static aClient *decode_puid(char *puid)
{
aClient *cptr;
char *it, *it2;
int cookie = 0;
if ((it = strrchr(puid, '!')) == NULL)
return NULL;
*it++ = '\0';
if ((it2 = strrchr(it, '.')) != NULL)
{
*it2++ = '\0';
cookie = atoi(it2);
}
if (stricmp(me.name, puid))
return NULL;
list_for_each_entry(cptr, &unknown_list, lclient_node)
if (cptr->local->sasl_cookie == cookie)
return cptr;
return NULL;
}
| Non-vul |
CVE-2012-0037 | raptor_turtle_writer_contains_newline(const unsigned char *s)
{
size_t i = 0;
for( ; i < strlen((char*)s); i++)
if(s[i] == '\n')
return 1;
return 0;
}
| Non-vul |
CVE-2017-12664 | MagickExport MagickBooleanType RemapImage(const QuantizeInfo *quantize_info,
Image *image,const Image *remap_image)
{
CubeInfo
*cube_info;
MagickBooleanType
status;
/*
Initialize color cube.
*/
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(remap_image != (Image *) NULL);
assert(remap_image->signature == MagickSignature);
cube_info=GetCubeInfo(quantize_info,MaxTreeDepth,
quantize_info->number_colors);
if (cube_info == (CubeInfo *) NULL)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
status=ClassifyImageColors(cube_info,remap_image,&image->exception);
if (status != MagickFalse)
{
/*
Classify image colors from the reference image.
*/
cube_info->quantize_info->number_colors=cube_info->colors;
status=AssignImageColors(image,cube_info);
}
DestroyCubeInfo(cube_info);
return(status);
}
| Non-vul |
CVE-2013-1790 | int FlateStream::lookChar() {
int c;
if (pred) {
return pred->lookChar();
}
while (remain == 0) {
if (endOfBlock && eof)
return EOF;
readSome();
}
c = buf[index];
return c;
}
| Non-vul |
CVE-2017-18187 | static int ssl_parse_max_fragment_length_ext( mbedtls_ssl_context *ssl,
const unsigned char *buf,
size_t len )
{
if( len != 1 || buf[0] >= MBEDTLS_SSL_MAX_FRAG_LEN_INVALID )
{
MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad client hello message" ) );
mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER );
return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO );
}
ssl->session_negotiate->mfl_code = buf[0];
return( 0 );
}
| Non-vul |
CVE-2014-2739 | static int __init cma_init(void)
{
int ret;
cma_wq = create_singlethread_workqueue("rdma_cm");
if (!cma_wq)
return -ENOMEM;
ib_sa_register_client(&sa_client);
rdma_addr_register_client(&addr_client);
register_netdevice_notifier(&cma_nb);
ret = ib_register_client(&cma_client);
if (ret)
goto err;
if (ibnl_add_client(RDMA_NL_RDMA_CM, RDMA_NL_RDMA_CM_NUM_OPS, cma_cb_table))
printk(KERN_WARNING "RDMA CMA: failed to add netlink callback\n");
return 0;
err:
unregister_netdevice_notifier(&cma_nb);
rdma_addr_unregister_client(&addr_client);
ib_sa_unregister_client(&sa_client);
destroy_workqueue(cma_wq);
return ret;
}
| Non-vul |
CVE-2018-11469 | enum act_parse_ret parse_http_action_reject(const char **args, int *orig_arg, struct proxy *px,
struct act_rule *rule, char **err)
{
rule->action = ACT_CUSTOM;
rule->action_ptr = http_action_reject;
return ACT_RET_PRS_OK;
}
| Non-vul |
CVE-2013-7421 | static int __sha512_neon_update(struct shash_desc *desc, const u8 *data,
unsigned int len, unsigned int partial)
{
struct sha512_state *sctx = shash_desc_ctx(desc);
unsigned int done = 0;
sctx->count[0] += len;
if (sctx->count[0] < len)
sctx->count[1]++;
if (partial) {
done = SHA512_BLOCK_SIZE - partial;
memcpy(sctx->buf + partial, data, done);
sha512_transform_neon(sctx->state, sctx->buf, sha512_k, 1);
}
if (len - done >= SHA512_BLOCK_SIZE) {
const unsigned int rounds = (len - done) / SHA512_BLOCK_SIZE;
sha512_transform_neon(sctx->state, data + done, sha512_k,
rounds);
done += rounds * SHA512_BLOCK_SIZE;
}
memcpy(sctx->buf, data + done, len - done);
return 0;
}
| Non-vul |
CVE-2016-10172 | static int seek_eof_information (WavpackContext *wpc, int64_t *final_index, int get_wrapper)
{
int64_t restore_pos, last_pos = -1;
WavpackStreamReader64 *reader = wpc->reader;
int alt_types = wpc->open_flags & OPEN_ALT_TYPES;
uint32_t blocks = 0, audio_blocks = 0;
void *id = wpc->wv_in;
WavpackHeader wphdr;
restore_pos = reader->get_pos (id); // we restore file position when done
if (reader->get_length (id) > 1048576LL)
reader->set_pos_rel (id, -1048576, SEEK_END);
else
reader->set_pos_abs (id, 0);
while (1) {
uint32_t bcount = read_next_header (reader, id, &wphdr);
int64_t current_pos = reader->get_pos (id);
if (current_pos == last_pos) {
reader->set_pos_abs (id, restore_pos);
return FALSE;
}
last_pos = current_pos;
if (bcount == (uint32_t) -1) {
if (!blocks) {
if (current_pos > 2000000LL)
reader->set_pos_rel (id, -2000000, SEEK_CUR);
else
reader->set_pos_abs (id, 0);
continue;
}
reader->set_pos_abs (id, restore_pos);
return TRUE;
}
blocks++;
if (wphdr.block_samples) {
if (final_index)
*final_index = GET_BLOCK_INDEX (wphdr) + wphdr.block_samples;
audio_blocks++;
}
else if (!audio_blocks) {
if (current_pos > 1048576LL)
reader->set_pos_rel (id, -1048576, SEEK_CUR);
else
reader->set_pos_abs (id, 0);
continue;
}
bcount = wphdr.ckSize - sizeof (WavpackHeader) + 8;
while (bcount >= 2) {
unsigned char meta_id, c1, c2;
uint32_t meta_bc, meta_size;
if (reader->read_bytes (id, &meta_id, 1) != 1 ||
reader->read_bytes (id, &c1, 1) != 1) {
reader->set_pos_abs (id, restore_pos);
return FALSE;
}
meta_bc = c1 << 1;
bcount -= 2;
if (meta_id & ID_LARGE) {
if (bcount < 2 || reader->read_bytes (id, &c1, 1) != 1 ||
reader->read_bytes (id, &c2, 1) != 1) {
reader->set_pos_abs (id, restore_pos);
return FALSE;
}
meta_bc += ((uint32_t) c1 << 9) + ((uint32_t) c2 << 17);
bcount -= 2;
}
meta_size = (meta_id & ID_ODD_SIZE) ? meta_bc - 1 : meta_bc;
meta_id &= ID_UNIQUE;
if (get_wrapper && (meta_id == ID_RIFF_TRAILER || (alt_types && meta_id == ID_ALT_TRAILER)) && meta_bc) {
wpc->wrapper_data = realloc (wpc->wrapper_data, wpc->wrapper_bytes + meta_bc);
if (!wpc->wrapper_data) {
reader->set_pos_abs (id, restore_pos);
return FALSE;
}
if (reader->read_bytes (id, wpc->wrapper_data + wpc->wrapper_bytes, meta_bc) == meta_bc)
wpc->wrapper_bytes += meta_size;
else {
reader->set_pos_abs (id, restore_pos);
return FALSE;
}
}
else if (meta_id == ID_MD5_CHECKSUM || (alt_types && meta_id == ID_ALT_MD5_CHECKSUM)) {
if (meta_bc == 16 && bcount >= 16) {
if (reader->read_bytes (id, wpc->config.md5_checksum, 16) == 16)
wpc->config.md5_read = TRUE;
else {
reader->set_pos_abs (id, restore_pos);
return FALSE;
}
}
else
reader->set_pos_rel (id, meta_bc, SEEK_CUR);
}
else
reader->set_pos_rel (id, meta_bc, SEEK_CUR);
bcount -= meta_bc;
}
}
}
| Non-vul |
CVE-2011-3209 | static int mmtimer_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
int ret = 0;
switch (cmd) {
case MMTIMER_GETOFFSET: /* offset of the counter */
/*
* SN RTC registers are on their own 64k page
*/
if(PAGE_SIZE <= (1 << 16))
ret = (((long)RTC_COUNTER_ADDR) & (PAGE_SIZE-1)) / 8;
else
ret = -ENOSYS;
break;
case MMTIMER_GETRES: /* resolution of the clock in 10^-15 s */
if(copy_to_user((unsigned long __user *)arg,
&mmtimer_femtoperiod, sizeof(unsigned long)))
return -EFAULT;
break;
case MMTIMER_GETFREQ: /* frequency in Hz */
if(copy_to_user((unsigned long __user *)arg,
&sn_rtc_cycles_per_second,
sizeof(unsigned long)))
return -EFAULT;
ret = 0;
break;
case MMTIMER_GETBITS: /* number of bits in the clock */
ret = RTC_BITS;
break;
case MMTIMER_MMAPAVAIL: /* can we mmap the clock into userspace? */
ret = (PAGE_SIZE <= (1 << 16)) ? 1 : 0;
break;
case MMTIMER_GETCOUNTER:
if(copy_to_user((unsigned long __user *)arg,
RTC_COUNTER_ADDR, sizeof(unsigned long)))
return -EFAULT;
break;
default:
ret = -ENOSYS;
break;
}
return ret;
}
| Non-vul |
CVE-2018-13006 | GF_Err trep_Read(GF_Box *s, GF_BitStream *bs)
{
GF_TrackExtensionPropertiesBox *ptr = (GF_TrackExtensionPropertiesBox *)s;
ptr->trackID = gf_bs_read_u32(bs);
ISOM_DECREASE_SIZE(ptr, 4);
return gf_isom_box_array_read(s, bs, gf_isom_box_add_default);
}
| Non-vul |
CVE-2015-0228 | static int lua_ap_set_context_info(lua_State *L)
{
request_rec *r;
const char *prefix;
const char *document_root;
luaL_checktype(L, 1, LUA_TUSERDATA);
r = ap_lua_check_request_rec(L, 1);
luaL_checktype(L, 2, LUA_TSTRING);
prefix = lua_tostring(L, 2);
luaL_checktype(L, 3, LUA_TSTRING);
document_root = lua_tostring(L, 3);
ap_set_context_info(r, prefix, document_root);
return 0;
}
| Non-vul |
CVE-2016-10133 | short js_toint16(js_State *J, int idx)
{
return jsV_numbertoint16(jsV_tonumber(J, stackidx(J, idx)));
}
| Non-vul |
CVE-2016-3861 | status_t Parcel::readString16Vector(
std::unique_ptr<std::vector<std::unique_ptr<String16>>>* val) const {
return readNullableTypedVector(val, &Parcel::readString16);
}
| Non-vul |
CVE-2018-16641 | static int32 TIFFReadPixels(TIFF *tiff,const tsample_t sample,const ssize_t row,
tdata_t scanline)
{
int32
status;
status=TIFFReadScanline(tiff,scanline,(uint32) row,sample);
return(status);
}
| Non-vul |
CVE-2018-13093 | xfs_inode_ag_iterator(
struct xfs_mount *mp,
int (*execute)(struct xfs_inode *ip, int flags,
void *args),
int flags,
void *args)
{
return xfs_inode_ag_iterator_flags(mp, execute, flags, args, 0);
}
| Non-vul |
CVE-2015-8839 | static void ext4_journal_commit_callback(journal_t *journal, transaction_t *txn)
{
struct super_block *sb = journal->j_private;
struct ext4_sb_info *sbi = EXT4_SB(sb);
int error = is_journal_aborted(journal);
struct ext4_journal_cb_entry *jce;
BUG_ON(txn->t_state == T_FINISHED);
spin_lock(&sbi->s_md_lock);
while (!list_empty(&txn->t_private_list)) {
jce = list_entry(txn->t_private_list.next,
struct ext4_journal_cb_entry, jce_list);
list_del_init(&jce->jce_list);
spin_unlock(&sbi->s_md_lock);
jce->jce_func(sb, jce, error);
spin_lock(&sbi->s_md_lock);
}
spin_unlock(&sbi->s_md_lock);
}
| Non-vul |
CVE-2012-5110 | void HTMLSelectElement::listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow)
{
if (!multiple())
optionSelectedByUser(listToOptionIndex(listIndex), fireOnChangeNow, false);
else {
updateSelectedState(listIndex, allowMultiplySelections, shift);
setNeedsValidityCheck();
if (fireOnChangeNow)
listBoxOnChange();
}
}
| Non-vul |
CVE-2013-4205 | ssize_t proc_projid_map_write(struct file *file, const char __user *buf, size_t size, loff_t *ppos)
{
struct seq_file *seq = file->private_data;
struct user_namespace *ns = seq->private;
struct user_namespace *seq_ns = seq_user_ns(seq);
if (!ns->parent)
return -EPERM;
if ((seq_ns != ns) && (seq_ns != ns->parent))
return -EPERM;
/* Anyone can set any valid project id no capability needed */
return map_write(file, buf, size, ppos, -1,
&ns->projid_map, &ns->parent->projid_map);
}
| Non-vul |
CVE-2018-20169 | struct usb_interface *usb_find_interface(struct usb_driver *drv, int minor)
{
struct find_interface_arg argb;
struct device *dev;
argb.minor = minor;
argb.drv = &drv->drvwrap.driver;
dev = bus_find_device(&usb_bus_type, NULL, &argb, __find_interface);
/* Drop reference count from bus_find_device */
put_device(dev);
return dev ? to_usb_interface(dev) : NULL;
}
| Non-vul |
CVE-2018-6198 | goURL0(char *prompt, int relative)
{
char *url, *referer;
ParsedURL p_url, *current;
Buffer *cur_buf = Currentbuf;
const int *no_referer_ptr;
url = searchKeyData();
if (url == NULL) {
Hist *hist = copyHist(URLHist);
Anchor *a;
current = baseURL(Currentbuf);
if (current) {
char *c_url = parsedURL2Str(current)->ptr;
if (DefaultURLString == DEFAULT_URL_CURRENT)
url = url_decode2(c_url, NULL);
else
pushHist(hist, c_url);
}
a = retrieveCurrentAnchor(Currentbuf);
if (a) {
char *a_url;
parseURL2(a->url, &p_url, current);
a_url = parsedURL2Str(&p_url)->ptr;
if (DefaultURLString == DEFAULT_URL_LINK)
url = url_decode2(a_url, Currentbuf);
else
pushHist(hist, a_url);
}
url = inputLineHist(prompt, url, IN_URL, hist);
if (url != NULL)
SKIP_BLANKS(url);
}
if (relative) {
no_referer_ptr = query_SCONF_NO_REFERER_FROM(&Currentbuf->currentURL);
current = baseURL(Currentbuf);
if ((no_referer_ptr && *no_referer_ptr) ||
current == NULL ||
current->scheme == SCM_LOCAL || current->scheme == SCM_LOCAL_CGI)
referer = NO_REFERER;
else
referer = parsedURL2Str(&Currentbuf->currentURL)->ptr;
url = url_encode(url, current, Currentbuf->document_charset);
}
else {
current = NULL;
referer = NULL;
url = url_encode(url, NULL, 0);
}
if (url == NULL || *url == '\0') {
displayBuffer(Currentbuf, B_FORCE_REDRAW);
return;
}
if (*url == '#') {
gotoLabel(url + 1);
return;
}
parseURL2(url, &p_url, current);
pushHashHist(URLHist, parsedURL2Str(&p_url)->ptr);
cmd_loadURL(url, current, referer, NULL);
if (Currentbuf != cur_buf) /* success */
pushHashHist(URLHist, parsedURL2Str(&Currentbuf->currentURL)->ptr);
}
| Non-vul |
CVE-2011-4112 | static int check_filter(struct tap_filter *filter, const struct sk_buff *skb)
{
if (!filter->count)
return 1;
return run_filter(filter, skb);
}
| Non-vul |
CVE-2019-17178 | static void Adam7_deinterlace(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, unsigned bpp)
{
unsigned passw[7], passh[7];
size_t filter_passstart[8], padded_passstart[8], passstart[8];
unsigned i;
Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp);
if(bpp >= 8)
{
for(i = 0; i < 7; i++)
{
unsigned x, y, b;
size_t bytewidth = bpp / 8;
for(y = 0; y < passh[i]; y++)
for(x = 0; x < passw[i]; x++)
{
size_t pixelinstart = passstart[i] + (y * passw[i] + x) * bytewidth;
size_t pixeloutstart = ((ADAM7_IY[i] + y * ADAM7_DY[i]) * w + ADAM7_IX[i] + x * ADAM7_DX[i]) * bytewidth;
for(b = 0; b < bytewidth; b++)
{
out[pixeloutstart + b] = in[pixelinstart + b];
}
}
}
}
else /*bpp < 8: Adam7 with pixels < 8 bit is a bit trickier: with bit pointers*/
{
for(i = 0; i < 7; i++)
{
unsigned x, y, b;
unsigned ilinebits = bpp * passw[i];
unsigned olinebits = bpp * w;
size_t obp, ibp; /*bit pointers (for out and in buffer)*/
for(y = 0; y < passh[i]; y++)
for(x = 0; x < passw[i]; x++)
{
ibp = (8 * passstart[i]) + (y * ilinebits + x * bpp);
obp = (ADAM7_IY[i] + y * ADAM7_DY[i]) * olinebits + (ADAM7_IX[i] + x * ADAM7_DX[i]) * bpp;
for(b = 0; b < bpp; b++)
{
unsigned char bit = readBitFromReversedStream(&ibp, in);
/*note that this function assumes the out buffer is completely 0, use setBitOfReversedStream otherwise*/
setBitOfReversedStream0(&obp, out, bit);
}
}
}
}
}
| Non-vul |
CVE-2013-2878 | void SearchBuffer::prependContext(const UChar*, size_t)
{
ASSERT_NOT_REACHED();
}
| Non-vul |
CVE-2014-3198 | pp::Var Instance::CallScriptableMethod(const pp::Var& method,
const std::vector<pp::Var>& args,
pp::Var* exception) {
std::string method_str = method.AsString();
if (method_str == kJSGrayscale) {
if (args.size() == 1 && args[0].is_bool()) {
engine_->SetGrayscale(args[0].AsBool());
paint_manager_.InvalidateRect(pp::Rect(pp::Point(), plugin_size_));
#ifdef ENABLE_THUMBNAILS
if (thumbnails_.visible())
thumbnails_.Show(true, true);
#endif
return pp::Var(true);
}
return pp::Var(false);
}
if (method_str == kJSOnLoad) {
if (args.size() == 1 && args[0].is_string()) {
on_load_callback_ = args[0];
return pp::Var(true);
}
return pp::Var(false);
}
if (method_str == kJSOnScroll) {
if (args.size() == 1 && args[0].is_string()) {
on_scroll_callback_ = args[0];
return pp::Var(true);
}
return pp::Var(false);
}
if (method_str == kJSOnPluginSizeChanged) {
if (args.size() == 1 && args[0].is_string()) {
on_plugin_size_changed_callback_ = args[0];
return pp::Var(true);
}
return pp::Var(false);
}
if (method_str == kJSReload) {
document_load_state_ = LOAD_STATE_LOADING;
if (!full_)
LoadUrl(url_);
preview_engine_.reset();
print_preview_page_count_ = 0;
engine_.reset(PDFEngine::Create(this));
engine_->New(url_.c_str());
#ifdef ENABLE_THUMBNAILS
thumbnails_.ResetEngine(engine_.get());
#endif
return pp::Var();
}
if (method_str == kJSResetPrintPreviewUrl) {
if (args.size() == 1 && args[0].is_string()) {
url_ = args[0].AsString();
preview_pages_info_ = std::queue<PreviewPageInfo>();
preview_document_load_state_ = LOAD_STATE_COMPLETE;
}
return pp::Var();
}
if (method_str == kJSZoomFitToHeight) {
SetZoom(ZOOM_FIT_TO_PAGE, 0);
return pp::Var();
}
if (method_str == kJSZoomFitToWidth) {
SetZoom(ZOOM_FIT_TO_WIDTH, 0);
return pp::Var();
}
if (method_str == kJSZoomIn) {
SetZoom(ZOOM_SCALE, CalculateZoom(kZoomInButtonId));
return pp::Var();
}
if (method_str == kJSZoomOut) {
SetZoom(ZOOM_SCALE, CalculateZoom(kZoomOutButtonId));
return pp::Var();
}
if (method_str == kJSSetZoomLevel) {
if (args.size() == 1 && args[0].is_number())
SetZoom(ZOOM_SCALE, args[0].AsDouble());
return pp::Var();
}
if (method_str == kJSGetZoomLevel) {
return pp::Var(zoom_);
}
if (method_str == kJSGetHeight) {
return pp::Var(plugin_size_.height());
}
if (method_str == kJSGetWidth) {
return pp::Var(plugin_size_.width());
}
if (method_str == kJSGetHorizontalScrollbarThickness) {
return pp::Var(
h_scrollbar_.get() ? GetScrollbarReservedThickness() : 0);
}
if (method_str == kJSGetVerticalScrollbarThickness) {
return pp::Var(
v_scrollbar_.get() ? GetScrollbarReservedThickness() : 0);
}
if (method_str == kJSDocumentLoadComplete) {
return pp::Var((document_load_state_ != LOAD_STATE_LOADING));
}
if (method_str == kJSPageYOffset) {
return pp::Var(static_cast<int32_t>(
v_scrollbar_.get() ? v_scrollbar_->GetValue() : 0));
}
if (method_str == kJSSetPageYOffset) {
if (args.size() == 1 && args[0].is_number() && v_scrollbar_.get())
ScrollToY(GetScaled(args[0].AsInt()));
return pp::Var();
}
if (method_str == kJSPageXOffset) {
return pp::Var(static_cast<int32_t>(
h_scrollbar_.get() ? h_scrollbar_->GetValue() : 0));
}
if (method_str == kJSSetPageXOffset) {
if (args.size() == 1 && args[0].is_number() && h_scrollbar_.get())
ScrollToX(GetScaled(args[0].AsInt()));
return pp::Var();
}
if (method_str == kJSRemovePrintButton) {
CreateToolbar(kPrintPreviewToolbarButtons,
arraysize(kPrintPreviewToolbarButtons));
UpdateToolbarPosition(false);
Invalidate(pp::Rect(plugin_size_));
return pp::Var();
}
if (method_str == kJSGoToPage) {
if (args.size() == 1 && args[0].is_string()) {
ScrollToPage(atoi(args[0].AsString().c_str()));
}
return pp::Var();
}
if (method_str == kJSAccessibility) {
if (args.size() == 0) {
base::DictionaryValue node;
node.SetInteger(kAccessibleNumberOfPages, engine_->GetNumberOfPages());
node.SetBoolean(kAccessibleLoaded,
document_load_state_ != LOAD_STATE_LOADING);
bool has_permissions =
engine_->HasPermission(PDFEngine::PERMISSION_COPY) ||
engine_->HasPermission(PDFEngine::PERMISSION_COPY_ACCESSIBLE);
node.SetBoolean(kAccessibleCopyable, has_permissions);
std::string json;
base::JSONWriter::Write(&node, &json);
return pp::Var(json);
} else if (args[0].is_number()) {
return pp::Var(engine_->GetPageAsJSON(args[0].AsInt()));
}
}
if (method_str == kJSPrintPreviewPageCount) {
if (args.size() == 1 && args[0].is_number())
SetPrintPreviewMode(args[0].AsInt());
return pp::Var();
}
if (method_str == kJSLoadPreviewPage) {
if (args.size() == 2 && args[0].is_string() && args[1].is_number())
ProcessPreviewPageInfo(args[0].AsString(), args[1].AsInt());
return pp::Var();
}
if (method_str == kJSGetPageLocationNormalized) {
const size_t kMaxLength = 30;
char location_info[kMaxLength];
int page_idx = engine_->GetMostVisiblePage();
if (page_idx < 0)
return pp::Var(std::string());
pp::Rect rect = engine_->GetPageContentsRect(page_idx);
int v_scrollbar_reserved_thickness =
v_scrollbar_.get() ? GetScaled(GetScrollbarReservedThickness()) : 0;
rect.set_x(rect.x() + ((plugin_size_.width() -
v_scrollbar_reserved_thickness - available_area_.width()) / 2));
base::snprintf(location_info,
kMaxLength,
"%0.4f;%0.4f;%0.4f;%0.4f;",
rect.x() / static_cast<float>(plugin_size_.width()),
rect.y() / static_cast<float>(plugin_size_.height()),
rect.width() / static_cast<float>(plugin_size_.width()),
rect.height()/ static_cast<float>(plugin_size_.height()));
return pp::Var(std::string(location_info));
}
if (method_str == kJSSetPageNumbers) {
if (args.size() != 1 || !args[0].is_string())
return pp::Var();
const int num_pages_signed = engine_->GetNumberOfPages();
if (num_pages_signed <= 0)
return pp::Var();
scoped_ptr<base::ListValue> page_ranges(static_cast<base::ListValue*>(
base::JSONReader::Read(args[0].AsString(), false)));
const size_t num_pages = static_cast<size_t>(num_pages_signed);
if (!page_ranges.get() || page_ranges->GetSize() != num_pages)
return pp::Var();
std::vector<int> print_preview_page_numbers;
for (size_t index = 0; index < num_pages; ++index) {
int page_number = 0; // |page_number| is 1-based.
if (!page_ranges->GetInteger(index, &page_number) || page_number < 1)
return pp::Var();
print_preview_page_numbers.push_back(page_number);
}
print_preview_page_numbers_ = print_preview_page_numbers;
page_indicator_.set_current_page(GetPageNumberToDisplay());
return pp::Var();
}
if (method_str == kJSSendKeyEvent) {
if (args.size() == 1 && args[0].is_number()) {
pp::KeyboardInputEvent event(
this, // instance
PP_INPUTEVENT_TYPE_KEYDOWN, // HandleInputEvent only care about this.
0, // timestamp, not used for kbd events.
0, // no modifiers.
args[0].AsInt(), // keycode.
pp::Var()); // no char text needed.
HandleInputEvent(event);
}
}
return pp::Var();
}
| Non-vul |
CVE-2013-2884 | inline void Element::synchronizeAttribute(const AtomicString& localName) const
{
if (!elementData())
return;
if (elementData()->m_styleAttributeIsDirty && equalPossiblyIgnoringCase(localName, styleAttr.localName(), shouldIgnoreAttributeCase(this))) {
ASSERT(isStyledElement());
static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal();
return;
}
if (elementData()->m_animatedSVGAttributesAreDirty) {
ASSERT(isSVGElement());
static_cast<const SVGElement*>(this)->synchronizeAnimatedSVGAttribute(QualifiedName(nullAtom, localName, nullAtom));
}
}
| Non-vul |
CVE-2015-1536 | int register_android_graphics_Bitmap(JNIEnv* env)
{
return android::AndroidRuntime::registerNativeMethods(env, kClassPathName,
gBitmapMethods, SK_ARRAY_COUNT(gBitmapMethods));
}
| Non-vul |
CVE-2015-1335 | void lxc_cgroup_process_info_free_and_remove(struct cgroup_process_info *info)
{
struct cgroup_process_info *next;
char **pp;
if (!info)
return;
next = info->next;
{
struct cgroup_mount_point *mp = info->designated_mount_point;
if (!mp)
mp = lxc_cgroup_find_mount_point(info->hierarchy, info->cgroup_path, true);
if (mp)
/* ignore return value here, perhaps we created the
* '/lxc' cgroup in this container but another container
* is still running (for example)
*/
(void)remove_cgroup(mp, info->cgroup_path, true);
}
for (pp = info->created_paths; pp && *pp; pp++);
for ((void)(pp && --pp); info->created_paths && pp >= info->created_paths; --pp) {
free(*pp);
}
free(info->created_paths);
lxc_cgroup_put_meta(info->meta_ref);
free(info->cgroup_path);
free(info->cgroup_path_sub);
free(info);
lxc_cgroup_process_info_free_and_remove(next);
}
| Non-vul |
CVE-2017-18238 | bool TradQT_Manager::ParseCachedBoxes ( const MOOV_Manager & moovMgr )
{
MOOV_Manager::BoxInfo udtaInfo;
MOOV_Manager::BoxRef udtaRef = moovMgr.GetBox ( "moov/udta", &udtaInfo );
if ( udtaRef == 0 ) return false;
for ( XMP_Uns32 i = 0; i < udtaInfo.childCount; ++i ) {
MOOV_Manager::BoxInfo currInfo;
MOOV_Manager::BoxRef currRef = moovMgr.GetNthChild ( udtaRef, i, &currInfo );
if ( currRef == 0 ) break; // Sanity check, should not happen.
if ( (currInfo.boxType >> 24) != 0xA9 ) continue;
if ( currInfo.contentSize < 2+2+1 ) continue; // Want enough for a non-empty value.
InfoMapPos newInfo = this->parsedBoxes.insert ( this->parsedBoxes.end(),
InfoMap::value_type ( currInfo.boxType, ParsedBoxInfo ( currInfo.boxType ) ) );
std::vector<ValueInfo> * newValues = &newInfo->second.values;
XMP_Uns8 * boxPtr = (XMP_Uns8*) currInfo.content;
XMP_Uns8 * boxEnd = boxPtr + currInfo.contentSize;
XMP_Uns16 miniLen, macLang;
for ( ; boxPtr < boxEnd-4; boxPtr += miniLen ) {
miniLen = 4 + GetUns16BE ( boxPtr ); // ! Include header in local miniLen.
macLang = GetUns16BE ( boxPtr+2);
if ( (miniLen <= 4) || (miniLen > (boxEnd - boxPtr)) ) continue; // Ignore bad or empty values.
XMP_StringPtr valuePtr = (char*)(boxPtr+4);
size_t valueLen = miniLen - 4;
newValues->push_back ( ValueInfo() );
ValueInfo * newValue = &newValues->back();
newValue->macLang = macLang;
if ( IsMacLangKnown ( macLang ) ) newValue->xmpLang = GetXMPLang ( macLang );
newValue->macValue.assign ( valuePtr, valueLen );
}
}
return (! this->parsedBoxes.empty());
} // TradQT_Manager::ParseCachedBoxes
| CWE-835 |
CVE-2015-1465 | void ipv4_sk_redirect(struct sk_buff *skb, struct sock *sk)
{
const struct iphdr *iph = (const struct iphdr *) skb->data;
struct flowi4 fl4;
struct rtable *rt;
__build_flow_key(&fl4, sk, iph, 0, 0, 0, 0, 0);
rt = __ip_route_output_key(sock_net(sk), &fl4);
if (!IS_ERR(rt)) {
__ip_do_redirect(rt, skb, &fl4, false);
ip_rt_put(rt);
}
}
| Non-vul |
CVE-2016-5354 | dissect_usb_vid_probe(proto_tree *parent_tree, tvbuff_t *tvb, int offset)
{
proto_tree *tree;
static const int *hint_bits[] = {
&hf_usb_vid_probe_hint_D[0],
&hf_usb_vid_probe_hint_D[1],
&hf_usb_vid_probe_hint_D[2],
&hf_usb_vid_probe_hint_D[3],
&hf_usb_vid_probe_hint_D[4],
NULL
};
DISSECTOR_ASSERT(array_length(hint_bits) == (1+array_length(hf_usb_vid_probe_hint_D)));
tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_video_probe, NULL, "Probe/Commit Info");
proto_tree_add_bitmask(tree, tvb, offset, hf_usb_vid_probe_hint,
ett_probe_hint, hint_bits, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_usb_vid_format_index, tvb, offset+2, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_usb_vid_frame_index, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_usb_vid_frame_interval, tvb, offset+4, 4, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_usb_vid_probe_key_frame_rate, tvb, offset+8, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_usb_vid_probe_p_frame_rate, tvb, offset+10, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_usb_vid_probe_comp_quality, tvb, offset+12, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_usb_vid_probe_comp_window, tvb, offset+14, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_usb_vid_probe_delay, tvb, offset+16, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_usb_vid_probe_max_frame_sz, tvb, offset+18, 4, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_usb_vid_probe_max_payload_sz, tvb, offset+22, 4, ENC_LITTLE_ENDIAN);
offset += 26;
/* UVC 1.1 fields */
if (tvb_reported_length_remaining(tvb, offset) > 0)
{
static const int *framing_bits[] = {
&hf_usb_vid_probe_framing_D[0],
&hf_usb_vid_probe_framing_D[1],
NULL
};
DISSECTOR_ASSERT(array_length(framing_bits) == (1+array_length(hf_usb_vid_probe_framing_D)));
proto_tree_add_item(tree, hf_usb_vid_probe_clock_freq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset += 4;
proto_tree_add_bitmask(tree, tvb, offset, hf_usb_vid_probe_framing,
ett_probe_framing, framing_bits, ENC_NA);
offset++;
proto_tree_add_item(tree, hf_usb_vid_probe_preferred_ver, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_usb_vid_probe_min_ver, tvb, offset+1, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_usb_vid_probe_max_ver, tvb, offset+2, 1, ENC_LITTLE_ENDIAN);
offset += 3;
}
return offset;
}
| Non-vul |
CVE-2017-9059 | nfsd4_decode_lockt(struct nfsd4_compoundargs *argp, struct nfsd4_lockt *lockt)
{
DECODE_HEAD;
READ_BUF(32);
lockt->lt_type = be32_to_cpup(p++);
if((lockt->lt_type < NFS4_READ_LT) || (lockt->lt_type > NFS4_WRITEW_LT))
goto xdr_error;
p = xdr_decode_hyper(p, &lockt->lt_offset);
p = xdr_decode_hyper(p, &lockt->lt_length);
COPYMEM(&lockt->lt_clientid, 8);
lockt->lt_owner.len = be32_to_cpup(p++);
READ_BUF(lockt->lt_owner.len);
READMEM(lockt->lt_owner.data, lockt->lt_owner.len);
DECODE_TAIL;
}
| Non-vul |
CVE-2017-9059 | nfsd4_encode_getfh(struct nfsd4_compoundres *resp, __be32 nfserr, struct svc_fh **fhpp)
{
struct xdr_stream *xdr = &resp->xdr;
struct svc_fh *fhp = *fhpp;
unsigned int len;
__be32 *p;
if (!nfserr) {
len = fhp->fh_handle.fh_size;
p = xdr_reserve_space(xdr, len + 4);
if (!p)
return nfserr_resource;
p = xdr_encode_opaque(p, &fhp->fh_handle.fh_base, len);
}
return nfserr;
}
| Non-vul |
CVE-2013-2634 | static int dcbnl_build_peer_app(struct net_device *netdev, struct sk_buff* skb,
int app_nested_type, int app_info_type,
int app_entry_type)
{
struct dcb_peer_app_info info;
struct dcb_app *table = NULL;
const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
u16 app_count;
int err;
/**
* retrieve the peer app configuration form the driver. If the driver
* handlers fail exit without doing anything
*/
err = ops->peer_getappinfo(netdev, &info, &app_count);
if (!err && app_count) {
table = kmalloc(sizeof(struct dcb_app) * app_count, GFP_KERNEL);
if (!table)
return -ENOMEM;
err = ops->peer_getapptable(netdev, table);
}
if (!err) {
u16 i;
struct nlattr *app;
/**
* build the message, from here on the only possible failure
* is due to the skb size
*/
err = -EMSGSIZE;
app = nla_nest_start(skb, app_nested_type);
if (!app)
goto nla_put_failure;
if (app_info_type &&
nla_put(skb, app_info_type, sizeof(info), &info))
goto nla_put_failure;
for (i = 0; i < app_count; i++) {
if (nla_put(skb, app_entry_type, sizeof(struct dcb_app),
&table[i]))
goto nla_put_failure;
}
nla_nest_end(skb, app);
}
err = 0;
nla_put_failure:
kfree(table);
return err;
}
| Non-vul |
CVE-2015-5302 | static void toggle_eb_comment(void)
{
/* The page doesn't exist with report-only option */
if (pages[PAGENO_EDIT_COMMENT].page_widget == NULL)
return;
bool good =
gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(g_tv_comment)) >= 10
|| gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(g_cb_no_comment));
/* Allow next page only when the comment has at least 10 chars */
gtk_widget_set_sensitive(g_btn_next, good);
/* And show the eventbox with label */
if (good)
gtk_widget_hide(GTK_WIDGET(g_eb_comment));
else
gtk_widget_show(GTK_WIDGET(g_eb_comment));
}
| Non-vul |
CVE-2017-9059 | unhash_session(struct nfsd4_session *ses)
{
struct nfs4_client *clp = ses->se_client;
struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id);
lockdep_assert_held(&nn->client_lock);
list_del(&ses->se_hash);
spin_lock(&ses->se_client->cl_lock);
list_del(&ses->se_perclnt);
spin_unlock(&ses->se_client->cl_lock);
}
| Non-vul |
CVE-2015-3412 | static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC)
{
if (intern) {
if (intern->ptr) {
xmlFreeTextWriter(intern->ptr);
intern->ptr = NULL;
}
if (intern->output) {
xmlBufferFree(intern->output);
intern->output = NULL;
}
efree(intern);
}
}
| Non-vul |
CVE-2019-13106 | static int spl_fit_image_get_os(const void *fit, int noffset, uint8_t *os)
{
#if CONFIG_IS_ENABLED(FIT_IMAGE_TINY) && !defined(CONFIG_SPL_OS_BOOT)
return -ENOTSUPP;
#else
return fit_image_get_os(fit, noffset, os);
#endif
}
| Non-vul |
CVE-2013-2921 | void DelegatedFrameHost::SendReturnedDelegatedResources(
uint32 output_surface_id) {
RenderWidgetHostImpl* host = client_->GetHost();
cc::CompositorFrameAck ack;
if (!surface_returned_resources_.empty()) {
ack.resources.swap(surface_returned_resources_);
} else {
DCHECK(resource_collection_);
resource_collection_->TakeUnusedResourcesForChildCompositor(&ack.resources);
}
DCHECK(!ack.resources.empty());
RenderWidgetHostImpl::SendReclaimCompositorResources(
host->GetRoutingID(),
output_surface_id,
host->GetProcess()->GetID(),
ack);
}
| Non-vul |
CVE-2017-9211 | static int skcipher_decrypt_ablkcipher(struct skcipher_request *req)
{
struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
struct crypto_tfm *tfm = crypto_skcipher_tfm(skcipher);
struct ablkcipher_alg *alg = &tfm->__crt_alg->cra_ablkcipher;
return skcipher_crypt_ablkcipher(req, alg->decrypt);
}
| Non-vul |
CVE-2011-3084 | bool RenderViewTest::ExecuteJavaScriptAndReturnIntValue(
const string16& script,
int* int_result) {
v8::Handle<v8::Value> result =
GetMainFrame()->executeScriptAndReturnValue(WebScriptSource(script));
if (result.IsEmpty() || !result->IsInt32())
return false;
if (int_result)
*int_result = result->Int32Value();
return true;
}
| Non-vul |
CVE-2012-5156 | void DaemonProcess::CreateDesktopSession(int terminal_id) {
DCHECK(caller_task_runner()->BelongsToCurrentThread());
if (IsTerminalIdKnown(terminal_id)) {
LOG(ERROR) << "An invalid terminal ID. terminal_id=" << terminal_id;
RestartNetworkProcess();
DeleteAllDesktopSessions();
return;
}
VLOG(1) << "Daemon: opened desktop session " << terminal_id;
desktop_sessions_.push_back(
DoCreateDesktopSession(terminal_id).release());
next_terminal_id_ = std::max(next_terminal_id_, terminal_id + 1);
}
| Non-vul |
CVE-2016-2324 | static void loosen_unused_packed_objects(struct rev_info *revs)
{
struct packed_git *p;
uint32_t i;
const unsigned char *sha1;
for (p = packed_git; p; p = p->next) {
if (!p->pack_local || p->pack_keep)
continue;
if (open_pack_index(p))
die("cannot open pack index");
for (i = 0; i < p->num_objects; i++) {
sha1 = nth_packed_object_sha1(p, i);
if (!packlist_find(&to_pack, sha1, NULL) &&
!has_sha1_pack_kept_or_nonlocal(sha1) &&
!loosened_object_can_be_discarded(sha1, p->mtime))
if (force_object_loose(sha1, p->mtime))
die("unable to force loose object");
}
}
}
| Non-vul |
CVE-2016-7969 | ass_render_event(ASS_Renderer *render_priv, ASS_Event *event,
EventImages *event_images)
{
DBBox bbox;
int MarginL, MarginR, MarginV;
int valign;
double device_x = 0;
double device_y = 0;
TextInfo *text_info = &render_priv->text_info;
if (event->Style >= render_priv->track->n_styles) {
ass_msg(render_priv->library, MSGL_WARN, "No style found");
return 1;
}
if (!event->Text) {
ass_msg(render_priv->library, MSGL_WARN, "Empty event");
return 1;
}
free_render_context(render_priv);
init_render_context(render_priv, event);
if (parse_events(render_priv, event))
return 1;
if (text_info->length == 0) {
free_render_context(render_priv);
return 1;
}
ass_shaper_set_base_direction(render_priv->shaper,
resolve_base_direction(render_priv->state.font_encoding));
ass_shaper_find_runs(render_priv->shaper, render_priv, text_info->glyphs,
text_info->length);
if (ass_shaper_shape(render_priv->shaper, text_info) < 0) {
ass_msg(render_priv->library, MSGL_ERR, "Failed to shape text");
free_render_context(render_priv);
return 1;
}
retrieve_glyphs(render_priv);
preliminary_layout(render_priv);
process_karaoke_effects(render_priv);
valign = render_priv->state.alignment & 12;
MarginL =
(event->MarginL) ? event->MarginL : render_priv->state.style->MarginL;
MarginR =
(event->MarginR) ? event->MarginR : render_priv->state.style->MarginR;
MarginV =
(event->MarginV) ? event->MarginV : render_priv->state.style->MarginV;
double max_text_width =
x2scr(render_priv, render_priv->track->PlayResX - MarginR) -
x2scr(render_priv, MarginL);
if (render_priv->state.evt_type != EVENT_HSCROLL) {
wrap_lines_smart(render_priv, max_text_width);
} else {
text_info->lines[0].offset = 0;
text_info->lines[0].len = text_info->length;
text_info->n_lines = 1;
measure_text(render_priv);
}
reorder_text(render_priv);
align_lines(render_priv, max_text_width);
compute_string_bbox(text_info, &bbox);
if (render_priv->state.evt_type == EVENT_NORMAL ||
render_priv->state.evt_type == EVENT_VSCROLL) {
device_x = x2scr(render_priv, MarginL);
} else if (render_priv->state.evt_type == EVENT_HSCROLL) {
if (render_priv->state.scroll_direction == SCROLL_RL)
device_x =
x2scr(render_priv,
render_priv->track->PlayResX -
render_priv->state.scroll_shift);
else if (render_priv->state.scroll_direction == SCROLL_LR)
device_x =
x2scr(render_priv,
render_priv->state.scroll_shift) - (bbox.xMax -
bbox.xMin);
}
if (render_priv->state.evt_type == EVENT_NORMAL ||
render_priv->state.evt_type == EVENT_HSCROLL) {
if (valign == VALIGN_TOP) { // toptitle
device_y =
y2scr_top(render_priv,
MarginV) + text_info->lines[0].asc;
} else if (valign == VALIGN_CENTER) { // midtitle
double scr_y =
y2scr(render_priv, render_priv->track->PlayResY / 2.0);
device_y = scr_y - (bbox.yMax + bbox.yMin) / 2.0;
} else { // subtitle
double line_pos = render_priv->state.explicit ?
0 : render_priv->settings.line_position;
double scr_top, scr_bottom, scr_y0;
if (valign != VALIGN_SUB)
ass_msg(render_priv->library, MSGL_V,
"Invalid valign, assuming 0 (subtitle)");
scr_bottom =
y2scr_sub(render_priv,
render_priv->track->PlayResY - MarginV);
scr_top = y2scr_top(render_priv, 0); //xxx not always 0?
device_y = scr_bottom + (scr_top - scr_bottom) * line_pos / 100.0;
device_y -= text_info->height;
device_y += text_info->lines[0].asc;
scr_y0 = scr_top + text_info->lines[0].asc;
if (device_y < scr_y0 && line_pos > 0) {
device_y = scr_y0;
}
}
} else if (render_priv->state.evt_type == EVENT_VSCROLL) {
if (render_priv->state.scroll_direction == SCROLL_TB)
device_y =
y2scr(render_priv,
render_priv->state.clip_y0 +
render_priv->state.scroll_shift) - (bbox.yMax -
bbox.yMin);
else if (render_priv->state.scroll_direction == SCROLL_BT)
device_y =
y2scr(render_priv,
render_priv->state.clip_y1 -
render_priv->state.scroll_shift);
}
if (render_priv->state.evt_type == EVENT_POSITIONED) {
double base_x = 0;
double base_y = 0;
get_base_point(&bbox, render_priv->state.alignment, &base_x, &base_y);
device_x =
x2scr_pos(render_priv, render_priv->state.pos_x) - base_x;
device_y =
y2scr_pos(render_priv, render_priv->state.pos_y) - base_y;
}
if (render_priv->state.evt_type == EVENT_NORMAL ||
render_priv->state.evt_type == EVENT_HSCROLL ||
render_priv->state.evt_type == EVENT_VSCROLL) {
render_priv->state.clip_x0 =
x2scr_scaled(render_priv, render_priv->state.clip_x0);
render_priv->state.clip_x1 =
x2scr_scaled(render_priv, render_priv->state.clip_x1);
if (valign == VALIGN_TOP) {
render_priv->state.clip_y0 =
y2scr_top(render_priv, render_priv->state.clip_y0);
render_priv->state.clip_y1 =
y2scr_top(render_priv, render_priv->state.clip_y1);
} else if (valign == VALIGN_CENTER) {
render_priv->state.clip_y0 =
y2scr(render_priv, render_priv->state.clip_y0);
render_priv->state.clip_y1 =
y2scr(render_priv, render_priv->state.clip_y1);
} else if (valign == VALIGN_SUB) {
render_priv->state.clip_y0 =
y2scr_sub(render_priv, render_priv->state.clip_y0);
render_priv->state.clip_y1 =
y2scr_sub(render_priv, render_priv->state.clip_y1);
}
} else if (render_priv->state.evt_type == EVENT_POSITIONED) {
render_priv->state.clip_x0 =
x2scr_pos_scaled(render_priv, render_priv->state.clip_x0);
render_priv->state.clip_x1 =
x2scr_pos_scaled(render_priv, render_priv->state.clip_x1);
render_priv->state.clip_y0 =
y2scr_pos(render_priv, render_priv->state.clip_y0);
render_priv->state.clip_y1 =
y2scr_pos(render_priv, render_priv->state.clip_y1);
}
if (render_priv->state.explicit) {
double zx = x2scr_pos_scaled(render_priv, 0);
double zy = y2scr_pos(render_priv, 0);
double sx = x2scr_pos_scaled(render_priv, render_priv->track->PlayResX);
double sy = y2scr_pos(render_priv, render_priv->track->PlayResY);
render_priv->state.clip_x0 = render_priv->state.clip_x0 < zx ? zx : render_priv->state.clip_x0;
render_priv->state.clip_y0 = render_priv->state.clip_y0 < zy ? zy : render_priv->state.clip_y0;
render_priv->state.clip_x1 = render_priv->state.clip_x1 > sx ? sx : render_priv->state.clip_x1;
render_priv->state.clip_y1 = render_priv->state.clip_y1 > sy ? sy : render_priv->state.clip_y1;
}
calculate_rotation_params(render_priv, &bbox, device_x, device_y);
render_and_combine_glyphs(render_priv, device_x, device_y);
memset(event_images, 0, sizeof(*event_images));
event_images->top = device_y - text_info->lines[0].asc;
event_images->height = text_info->height;
event_images->left =
(device_x + bbox.xMin * render_priv->font_scale_x) + 0.5;
event_images->width =
(bbox.xMax - bbox.xMin) * render_priv->font_scale_x + 0.5;
event_images->detect_collisions = render_priv->state.detect_collisions;
event_images->shift_direction = (valign == VALIGN_TOP) ? 1 : -1;
event_images->event = event;
event_images->imgs = render_text(render_priv);
if (render_priv->state.border_style == 4)
add_background(render_priv, event_images);
ass_shaper_cleanup(render_priv->shaper, text_info);
free_render_context(render_priv);
return 0;
}
| Non-vul |
CVE-2015-6769 | PasswordAutofillManager::~PasswordAutofillManager() {
if (deletion_callback_)
std::move(deletion_callback_).Run();
}
| Non-vul |
CVE-2017-9465 | int _yr_re_node_contains_dot_star(
RE_NODE* re_node)
{
if (re_node->type == RE_NODE_STAR && re_node->left->type == RE_NODE_ANY)
return TRUE;
if (re_node->left != NULL && _yr_re_node_contains_dot_star(re_node->left))
return TRUE;
if (re_node->right != NULL && _yr_re_node_contains_dot_star(re_node->right))
return TRUE;
return FALSE;
}
| Non-vul |
CVE-2013-0904 | bool hasMarginBeforeQuirk() const { return m_hasMarginBeforeQuirk; }
| Non-vul |
CVE-2016-1670 | void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) {
ResourceRequestInfoImpl* info = loader->GetRequestInfo();
if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) {
UMA_HISTOGRAM_SPARSE_SLOWLY(
"Net.ErrorCodesForMainFrame3",
-loader->request()->status().error());
base::TimeDelta request_loading_time(
base::TimeTicks::Now() - loader->request()->creation_time());
switch (loader->request()->status().error()) {
case net::OK:
UMA_HISTOGRAM_LONG_TIMES(
"Net.RequestTime2.Success", request_loading_time);
break;
case net::ERR_ABORTED:
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.ErrAborted.SentBytes",
loader->request()->GetTotalSentBytes(), 1,
50000000, 50);
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.ErrAborted.ReceivedBytes",
loader->request()->GetTotalReceivedBytes(),
1, 50000000, 50);
UMA_HISTOGRAM_LONG_TIMES(
"Net.RequestTime2.ErrAborted", request_loading_time);
if (loader->request()->url().SchemeIsHTTPOrHTTPS()) {
UMA_HISTOGRAM_LONG_TIMES("Net.RequestTime2.ErrAborted.HttpScheme",
request_loading_time);
} else {
UMA_HISTOGRAM_LONG_TIMES("Net.RequestTime2.ErrAborted.NonHttpScheme",
request_loading_time);
}
if (loader->request()->GetTotalReceivedBytes() > 0) {
UMA_HISTOGRAM_LONG_TIMES("Net.RequestTime2.ErrAborted.NetworkContent",
request_loading_time);
} else if (loader->request()->received_response_content_length() > 0) {
UMA_HISTOGRAM_LONG_TIMES(
"Net.RequestTime2.ErrAborted.NoNetworkContent.CachedContent",
request_loading_time);
} else {
UMA_HISTOGRAM_LONG_TIMES(
"Net.RequestTime2.ErrAborted.NoBytesRead",
request_loading_time);
}
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&RecordAbortRapporOnUI, loader->request()->url(),
request_loading_time));
break;
case net::ERR_CONNECTION_RESET:
UMA_HISTOGRAM_LONG_TIMES(
"Net.RequestTime2.ErrConnectionReset", request_loading_time);
break;
case net::ERR_CONNECTION_TIMED_OUT:
UMA_HISTOGRAM_LONG_TIMES(
"Net.RequestTime2.ErrConnectionTimedOut", request_loading_time);
break;
case net::ERR_INTERNET_DISCONNECTED:
UMA_HISTOGRAM_LONG_TIMES(
"Net.RequestTime2.ErrInternetDisconnected", request_loading_time);
break;
case net::ERR_NAME_NOT_RESOLVED:
UMA_HISTOGRAM_LONG_TIMES(
"Net.RequestTime2.ErrNameNotResolved", request_loading_time);
break;
case net::ERR_TIMED_OUT:
UMA_HISTOGRAM_LONG_TIMES(
"Net.RequestTime2.ErrTimedOut", request_loading_time);
break;
default:
UMA_HISTOGRAM_LONG_TIMES(
"Net.RequestTime2.MiscError", request_loading_time);
break;
}
if (loader->request()->url().SchemeIsCryptographic()) {
if (loader->request()->url().host() == "www.google.com") {
UMA_HISTOGRAM_SPARSE_SLOWLY("Net.ErrorCodesForHTTPSGoogleMainFrame2",
-loader->request()->status().error());
}
int num_valid_scts = std::count_if(
loader->request()->ssl_info().signed_certificate_timestamps.begin(),
loader->request()->ssl_info().signed_certificate_timestamps.end(),
IsValidatedSCT);
UMA_HISTOGRAM_COUNTS_100(
"Net.CertificateTransparency.MainFrameValidSCTCount", num_valid_scts);
}
} else {
if (info->GetResourceType() == RESOURCE_TYPE_IMAGE) {
UMA_HISTOGRAM_SPARSE_SLOWLY(
"Net.ErrorCodesForImages",
-loader->request()->status().error());
}
UMA_HISTOGRAM_SPARSE_SLOWLY(
"Net.ErrorCodesForSubresources2",
-loader->request()->status().error());
}
if (loader->request()->url().SchemeIsCryptographic()) {
RecordCertificateHistograms(loader->request()->ssl_info(),
info->GetResourceType());
}
if (delegate_)
delegate_->RequestComplete(loader->request());
RemovePendingRequest(info->GetChildID(), info->GetRequestID());
}
| Non-vul |
CVE-2017-5060 | explicit NonHostComponentTransform(net::UnescapeRule::Type unescape_rules)
: unescape_rules_(unescape_rules) {}
| Non-vul |
CVE-2016-0810 | void SoundPool::setLoop(int channelID, int loop)
{
ALOGV("setLoop(%d, %d)", channelID, loop);
Mutex::Autolock lock(&mLock);
SoundChannel* channel = findChannel(channelID);
if (channel) {
channel->setLoop(loop);
}
}
| Non-vul |
CVE-2012-5152 | void TestPlaybackRate(double playback_rate) {
static const int kDefaultBufferSize = kSamplesPerSecond / 10;
static const int kDefaultFramesRequested = 5 * kSamplesPerSecond;
TestPlaybackRate(playback_rate, kDefaultBufferSize,
kDefaultFramesRequested);
}
| CWE-119 |
CVE-2019-5760 | scoped_refptr<LocalRTCStatsResponse> LocalRTCStatsRequest::createResponse() {
return scoped_refptr<LocalRTCStatsResponse>(
new rtc::RefCountedObject<LocalRTCStatsResponse>(impl_.CreateResponse()));
}
| Non-vul |
CVE-2015-8844 | static int save_tm_user_regs(struct pt_regs *regs,
struct mcontext __user *frame,
struct mcontext __user *tm_frame, int sigret)
{
unsigned long msr = regs->msr;
/* Remove TM bits from thread's MSR. The MSR in the sigcontext
* just indicates to userland that we were doing a transaction, but we
* don't want to return in transactional state. This also ensures
* that flush_fp_to_thread won't set TIF_RESTORE_TM again.
*/
regs->msr &= ~MSR_TS_MASK;
/* Make sure floating point registers are stored in regs */
flush_fp_to_thread(current);
/* Save both sets of general registers */
if (save_general_regs(¤t->thread.ckpt_regs, frame)
|| save_general_regs(regs, tm_frame))
return 1;
/* Stash the top half of the 64bit MSR into the 32bit MSR word
* of the transactional mcontext. This way we have a backward-compatible
* MSR in the 'normal' (checkpointed) mcontext and additionally one can
* also look at what type of transaction (T or S) was active at the
* time of the signal.
*/
if (__put_user((msr >> 32), &tm_frame->mc_gregs[PT_MSR]))
return 1;
#ifdef CONFIG_ALTIVEC
/* save altivec registers */
if (current->thread.used_vr) {
flush_altivec_to_thread(current);
if (__copy_to_user(&frame->mc_vregs, ¤t->thread.vr_state,
ELF_NVRREG * sizeof(vector128)))
return 1;
if (msr & MSR_VEC) {
if (__copy_to_user(&tm_frame->mc_vregs,
¤t->thread.transact_vr,
ELF_NVRREG * sizeof(vector128)))
return 1;
} else {
if (__copy_to_user(&tm_frame->mc_vregs,
¤t->thread.vr_state,
ELF_NVRREG * sizeof(vector128)))
return 1;
}
/* set MSR_VEC in the saved MSR value to indicate that
* frame->mc_vregs contains valid data
*/
msr |= MSR_VEC;
}
/* We always copy to/from vrsave, it's 0 if we don't have or don't
* use altivec. Since VSCR only contains 32 bits saved in the least
* significant bits of a vector, we "cheat" and stuff VRSAVE in the
* most significant bits of that same vector. --BenH
*/
if (cpu_has_feature(CPU_FTR_ALTIVEC))
current->thread.vrsave = mfspr(SPRN_VRSAVE);
if (__put_user(current->thread.vrsave,
(u32 __user *)&frame->mc_vregs[32]))
return 1;
if (msr & MSR_VEC) {
if (__put_user(current->thread.transact_vrsave,
(u32 __user *)&tm_frame->mc_vregs[32]))
return 1;
} else {
if (__put_user(current->thread.vrsave,
(u32 __user *)&tm_frame->mc_vregs[32]))
return 1;
}
#endif /* CONFIG_ALTIVEC */
if (copy_fpr_to_user(&frame->mc_fregs, current))
return 1;
if (msr & MSR_FP) {
if (copy_transact_fpr_to_user(&tm_frame->mc_fregs, current))
return 1;
} else {
if (copy_fpr_to_user(&tm_frame->mc_fregs, current))
return 1;
}
#ifdef CONFIG_VSX
/*
* Copy VSR 0-31 upper half from thread_struct to local
* buffer, then write that to userspace. Also set MSR_VSX in
* the saved MSR value to indicate that frame->mc_vregs
* contains valid data
*/
if (current->thread.used_vsr) {
__giveup_vsx(current);
if (copy_vsx_to_user(&frame->mc_vsregs, current))
return 1;
if (msr & MSR_VSX) {
if (copy_transact_vsx_to_user(&tm_frame->mc_vsregs,
current))
return 1;
} else {
if (copy_vsx_to_user(&tm_frame->mc_vsregs, current))
return 1;
}
msr |= MSR_VSX;
}
#endif /* CONFIG_VSX */
#ifdef CONFIG_SPE
/* SPE regs are not checkpointed with TM, so this section is
* simply the same as in save_user_regs().
*/
if (current->thread.used_spe) {
flush_spe_to_thread(current);
if (__copy_to_user(&frame->mc_vregs, current->thread.evr,
ELF_NEVRREG * sizeof(u32)))
return 1;
/* set MSR_SPE in the saved MSR value to indicate that
* frame->mc_vregs contains valid data */
msr |= MSR_SPE;
}
/* We always copy to/from spefscr */
if (__put_user(current->thread.spefscr, (u32 __user *)&frame->mc_vregs + ELF_NEVRREG))
return 1;
#endif /* CONFIG_SPE */
if (__put_user(msr, &frame->mc_gregs[PT_MSR]))
return 1;
if (sigret) {
/* Set up the sigreturn trampoline: li r0,sigret; sc */
if (__put_user(0x38000000UL + sigret, &frame->tramp[0])
|| __put_user(0x44000002UL, &frame->tramp[1]))
return 1;
flush_icache_range((unsigned long) &frame->tramp[0],
(unsigned long) &frame->tramp[2]);
}
return 0;
}
| Non-vul |
CVE-2018-20482 | tar_sparse_done (struct tar_sparse_file *file)
{
if (file->optab->done)
return file->optab->done (file);
return true;
}
| Non-vul |
CVE-2011-3193 | static void Free_SinglePos( HB_GPOS_SubTable* st )
{
HB_UShort n, count, format;
HB_SinglePos* sp = &st->single;
HB_ValueRecord* v;
format = sp->ValueFormat;
switch ( sp->PosFormat )
{
case 1:
Free_ValueRecord( &sp->spf.spf1.Value, format );
break;
case 2:
if ( sp->spf.spf2.Value )
{
count = sp->spf.spf2.ValueCount;
v = sp->spf.spf2.Value;
for ( n = 0; n < count; n++ )
Free_ValueRecord( &v[n], format );
FREE( v );
}
break;
default:
break;
}
_HB_OPEN_Free_Coverage( &sp->Coverage );
}
| Non-vul |
CVE-2016-3821 | status_t MediaPlayer::setAudioSessionId(int sessionId)
{
ALOGV("MediaPlayer::setAudioSessionId(%d)", sessionId);
Mutex::Autolock _l(mLock);
if (!(mCurrentState & MEDIA_PLAYER_IDLE)) {
ALOGE("setAudioSessionId called in state %d", mCurrentState);
return INVALID_OPERATION;
}
if (sessionId < 0) {
return BAD_VALUE;
}
if (sessionId != mAudioSessionId) {
AudioSystem::acquireAudioSessionId(sessionId, -1);
AudioSystem::releaseAudioSessionId(mAudioSessionId, -1);
mAudioSessionId = sessionId;
}
return NO_ERROR;
}
| Non-vul |
CVE-2018-1000039 | static void pdf_run_ri(fz_context *ctx, pdf_processor *proc, const char *intent)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pdf_flush_text(ctx, pr);
gstate->fill.color_params.ri = fz_lookup_rendering_intent(intent);
gstate->stroke.color_params.ri = gstate->fill.color_params.ri;
}
| Non-vul |
CVE-2018-13093 | xfs_inode_match_id_union(
struct xfs_inode *ip,
struct xfs_eofblocks *eofb)
{
if ((eofb->eof_flags & XFS_EOF_FLAGS_UID) &&
uid_eq(VFS_I(ip)->i_uid, eofb->eof_uid))
return 1;
if ((eofb->eof_flags & XFS_EOF_FLAGS_GID) &&
gid_eq(VFS_I(ip)->i_gid, eofb->eof_gid))
return 1;
if ((eofb->eof_flags & XFS_EOF_FLAGS_PRID) &&
xfs_get_projid(ip) == eofb->eof_prid)
return 1;
return 0;
}
| Non-vul |
CVE-2013-2548 | static inline unsigned int ablkcipher_done_fast(struct ablkcipher_walk *walk,
unsigned int n)
{
scatterwalk_advance(&walk->in, n);
scatterwalk_advance(&walk->out, n);
return n;
}
| Non-vul |
CVE-2016-3839 | void btif_dm_cb_remove_bond(bt_bdaddr_t *bd_addr)
{
/*special handling for HID devices */
/* VUP needs to be sent if its a HID Device. The HID HOST module will check if there
is a valid hid connection with this bd_addr. If yes VUP will be issued.*/
#if (defined(BTA_HH_INCLUDED) && (BTA_HH_INCLUDED == TRUE))
if (btif_hh_virtual_unplug(bd_addr) != BT_STATUS_SUCCESS)
#endif
{
BTIF_TRACE_DEBUG("%s: Removing HH device", __func__);
BTA_DmRemoveDevice((UINT8 *)bd_addr->address);
}
}
| Non-vul |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 116