target
int64
func
string
cwe_id_cleaned
string
label
int64
1
void CLASS xtrans_interpolate(int passes) { int c, d, f, g, h, i, v, ng, row, col, top, left, mrow, mcol; #ifdef LIBRAW_LIBRARY_BUILD int cstat[4]={0,0,0,0}; #endif int val, ndir, pass, hm[8], avg[4], color[3][8]; static const short orth[12] = {1, 0, 0, 1, -1, 0, 0, -1, 1, 0, 0, 1}, patt[...
CWE-125
1
1
static void DecodeHeader(guchar *Data, gint Bytes, struct ico_progressive_state *State, GError **error) { /* For ICO's we have to be very clever. There are multiple images possible in an .ICO. As a simple heuristic, we select the image which occupies the largest number of bytes. */ struct ico_dirent...
CWE-787
7
1
int ptrace_setxregs(struct task_struct *child, void __user *uregs) { struct thread_info *ti = task_thread_info(child); struct pt_regs *regs = task_pt_regs(child); elf_xtregs_t *xtregs = uregs; int ret = 0; #if XTENSA_HAVE_COPROCESSORS /* Flush all coprocessors before we overwrite them. */ coprocessor_flush...
CWE-20
2
0
void CairoImageOutputDev::saveImage(CairoImage *image) { if (numImages >= size) { size += 16; images = (CairoImage **) greallocn (images, size, sizeof (CairoImage *)); } images[numImages++] = image; }
none
8
1
static int nr_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t size, int flags) { struct sock *sk = sock->sk; struct sockaddr_ax25 *sax = (struct sockaddr_ax25 *)msg->msg_name; size_t copied; struct sk_buff *skb; int er; /* * This works for seqpacket too. The receiver has ord...
CWE-20
2
1
decnet_print(netdissect_options *ndo, register const u_char *ap, register u_int length, register u_int caplen) { register const union routehdr *rhp; register int mflags; int dst, src, hops; u_int nsplen, pktlen; const u_char *nspp; if (length < sizeof(struct shorthdr)) { ND_PRINT((ndo...
CWE-125
1
1
static void imap_parser_save_arg(struct imap_parser *parser, const unsigned char *data, size_t size) { struct imap_arg *arg; char *str; arg = imap_arg_create(parser); switch (parser->cur_type) { case ARG_PARSE_ATOM: case ARG_PARSE_TEXT: if (size == 3 && i_memcasecmp(data, "NIL", 3) == 0) { /* NIL argu...
CWE-787
7
1
static unsigned int tun_chr_poll(struct file *file, poll_table * wait) { struct tun_file *tfile = file->private_data; struct tun_struct *tun = __tun_get(tfile); struct sock *sk = tun->sk; unsigned int mask = 0; if (!tun) return POLLERR; DBG(KERN_INFO "%s: tun_chr_poll\n", tun->dev->name); poll_wait(file, &t...
CWE-119
0
1
static void __dvb_frontend_free(struct dvb_frontend *fe) { struct dvb_frontend_private *fepriv = fe->frontend_priv; if (fepriv) dvb_free_device(fepriv->dvbdev); dvb_frontend_invoke_release(fe, fe->ops.release); if (fepriv) kfree(fepriv); }
CWE-416
5
1
static int _snd_timer_stop(struct snd_timer_instance * timeri, int keep_flag, int event) { struct snd_timer *timer; unsigned long flags; if (snd_BUG_ON(!timeri)) return -ENXIO; if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE) { if (!keep_flag) { spin_lock_irqsave(&slave_active_lock, flags); timeri->...
CWE-20
2
0
void CairoOutputDev::drawImageMaskRegular(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg) { unsigned char *buffer; unsigned char *dest; cairo_surface_t *image; cairo_pattern_t *pattern; int x, y; ImageStream *imgStr; Guchar *pix; cairo_mat...
none
8
0
static inline void printMatrix(cairo_matrix_t *matrix){ printf("%f %f, %f %f (%f %f)\n", matrix->xx, matrix->yx, matrix->xy, matrix->yy, matrix->x0, matrix->y0); }
none
8
1
ft_var_readpackedpoints( FT_Stream stream, FT_UInt *point_cnt ) { FT_UShort *points; FT_Int n; FT_Int runcnt; FT_Int i; FT_Int j; FT_Int first; FT_Memory memory = stream->memory; FT_Error error = TT_Err_Ok; FT_UNUSED( err...
CWE-119
0
1
static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define SkipLinesOp 0x01 #define SetColorOp 0x02 #define SkipPixelsOp 0x03 #define ByteDataOp 0x05 #define RunDataOp 0x06 #define EOFOp 0x07 char magick[12]; Image *image; int opcode, operand, status; ...
CWE-125
1
1
bool GetURLRowForAutocompleteMatch(Profile* profile, const AutocompleteMatch& match, history::URLRow* url_row) { DCHECK(url_row); HistoryService* history_service = profile->GetHistoryService(Profile::EXPLICIT_ACCESS); if (!history_service...
CWE-20
2
1
wb_prep(netdissect_options *ndo, const struct pkt_prep *prep, u_int len) { int n; const struct pgstate *ps; const u_char *ep = ndo->ndo_snapend; ND_PRINT((ndo, " wb-prep:")); if (len < sizeof(*prep)) { return (-1); } n = EXTRACT_32BITS(&prep->pp_n); ps = (const struct pgstate *)(prep + 1); wh...
CWE-125
1
1
static ssize_t ucma_migrate_id(struct ucma_file *new_file, const char __user *inbuf, int in_len, int out_len) { struct rdma_ucm_migrate_id cmd; struct rdma_ucm_migrate_resp resp; struct ucma_context *ctx; struct fd f; struct ucma_file *cur_file; int ret = 0; if (copy_from_user(&cmd, inbuf, s...
CWE-416
5
0
pdf_map_one_to_many(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *values, int len) { if (len == 1) { add_range(ctx, cmap, low, low, values[0], 1, 0); return; } /* Decode unicode surrogate pairs. */ /* Only the *-UCS2 CMaps use one-to-many mappings, so assuming unicode should be safe. */ if (len == ...
none
8
1
void WebURLLoaderImpl::Context::OnReceivedResponse( const ResourceResponseInfo& info) { if (!client_) return; WebURLResponse response; response.initialize(); PopulateURLResponse(request_.url(), info, &response); bool show_raw_listing = (GURL(request_.url()).query() == "raw"); if (info.mime_type =...
CWE-416
5
1
filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully) { filepos_t Result; FirstFrameLocation = input.getFilePointer(); // will be updated accordingly below SetValueIsSet(false); try { if (ReadFully == SCOPE_ALL_DATA) { Result = EbmlBinary::ReadData(input, ReadFully); i...
CWE-399
4
1
static void ssl3_take_mac(SSL *s) { const char *sender; int slen; if (s->state & SSL_ST_CONNECT) { sender=s->method->ssl3_enc->server_finished_label; sender=s->method->ssl3_enc->client_finished_label; slen=s->method->ssl3_enc->client_finished_label_len...
CWE-20
2
1
static int br_multicast_add_group(struct net_bridge *br, struct net_bridge_port *port, struct br_ip *group) { struct net_bridge_mdb_entry *mp; struct net_bridge_port_group *p; struct net_bridge_port_group __rcu **pp; unsigned long now = jiffies; int err; spin_lock(&br->multicast_lock); if (!netif_ru...
CWE-399
4
1
static void get_socket_name(SingleInstData* data, char* buf, int len) { const char* dpy = g_getenv("DISPLAY"); char* host = NULL; int dpynum; if(dpy) { const char* p = strrchr(dpy, ':'); host = g_strndup(dpy, (p - dpy)); dpynum = atoi(p + 1); } else dpynum ...
CWE-20
2
0
static void red_channel_client_ping_timer(void *opaque) { int so_unsent_size = 0; RedChannelClient *rcc = opaque; spice_assert(rcc->latency_monitor.state == PING_STATE_TIMER); red_channel_client_cancel_ping_timer(rcc); /* retrieving the occupied size of the socket's tcp snd buffer (unacked + unsent...
none
8
1
xmlDictComputeFastQKey(const xmlChar *prefix, int plen, const xmlChar *name, int len, int seed) { unsigned long value = (unsigned long) seed; if (plen == 0) value += 30 * (unsigned long) ':'; else value += 30 * (*prefix); if (len > 10) { value += name[len - (plen + 1 +...
CWE-119
0
1
JPEGSetupEncode(TIFF* tif) { JPEGState* sp = JState(tif); TIFFDirectory *td = &tif->tif_dir; static const char module[] = "JPEGSetupEncode"; #if defined(JPEG_DUAL_MODE_8_12) && !defined(TIFFInitJPEG) if( tif->tif_dir.td_bitspersample == 12 ) return TIFFReInitJPEG_12( tif, COMPRESSION_JPEG, 1 ); ...
CWE-20
2
0
inline void Splash::drawAALine(SplashPipe *pipe, int x0, int x1, int y) { #if splashAASize == 4 static int bitCount4[16] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 }; SplashColorPtr p0, p1, p2, p3; int t; #else SplashColorPtr p; int xx, yy, t; #endif int x; #if splashAASize == 4 p0 = aa...
none
8
0
static int samldb_add_handle_msDS_IntId(struct samldb_ctx *ac) { int ret; bool id_exists; uint32_t msds_intid; int32_t system_flags; struct ldb_context *ldb; struct ldb_result *ldb_res; struct ldb_dn *schema_dn; struct samldb_msds_intid_persistant *msds_intid_struct; struct dsdb_schema *schema; ldb = ldb_mod...
none
8
0
static void red_channel_client_peer_prepare_out_msg( void *opaque, struct iovec *vec, int *vec_size, int pos) { RedChannelClient *rcc = (RedChannelClient *)opaque; *vec_size = spice_marshaller_fill_iovec(rcc->send_data.marshaller, vec, IOV_MAX, pos); }
none
8
1
decodenetnum( const char *num, sockaddr_u *netnum ) { struct addrinfo hints, *ai = NULL; int err; u_short port; const char *cp; const char *port_str; char *pp; char *np; char name[80]; REQUIRE(num != NULL); REQUIRE(strlen(num) < sizeof(name)); port_str = NULL; if ('[' != num[0]) { /* * to distingu...
CWE-20
2
0
zcopydevice2(i_ctx_t *i_ctx_p) { os_ptr op = osp; gx_device *new_dev; int code; check_read_type(op[-1], t_device); check_type(*op, t_boolean); if (op[-1].value.pdevice == NULL) /* This can happen if we invalidated devices on the stack by calling nulldevice after they were pushed */ ...
none
8
1
MagickExport MagickBooleanType WriteImages(const ImageInfo *image_info, Image *images,const char *filename,ExceptionInfo *exception) { #define WriteImageTag "Write/Image" ExceptionInfo *sans_exception; ImageInfo *write_info; MagickBooleanType proceed; MagickOffsetType progress; MagickP...
CWE-476
6
1
static void youngcollection (lua_State *L, global_State *g) { GCObject **psurvival; /* to point to first non-dead survival object */ lua_assert(g->gcstate == GCSpropagate); markold(g, g->survival, g->reallyold); markold(g, g->finobj, g->finobjrold); atomic(L); /* sweep nursery and get a pointer to its las...
CWE-125
1
1
static int get_debug_info(struct PE_(r_bin_pe_obj_t)* bin, PE_(image_debug_directory_entry)* dbg_dir_entry, ut8* dbg_data, int dbg_data_len, SDebugInfo* res) { #define SIZEOF_FILE_NAME 255 int i = 0; const char* basename; if (!dbg_data) { return 0; } switch (dbg_dir_entry->Type) { case IMAGE_DEBUG_TYPE_CODEVI...
CWE-125
1
1
static const ut8 *r_bin_dwarf_parse_comp_unit(Sdb *s, const ut8 *obuf, RBinDwarfCompUnit *cu, const RBinDwarfDebugAbbrev *da, size_t offset, const ut8 *debug_str, size_t debug_str_len) { const ut8 *buf = obuf, *buf_end = obuf + (cu->hdr.length - 7); ut64 abbr_code; size_t i; if (cu->hdr.length > debug_str_len...
CWE-125
1
1
IDNSpoofChecker::IDNSpoofChecker() { UErrorCode status = U_ZERO_ERROR; checker_ = uspoof_open(&status); if (U_FAILURE(status)) { checker_ = nullptr; return; } uspoof_setRestrictionLevel(checker_, USPOOF_HIGHLY_RESTRICTIVE); SetAllowedUnicodeSet(&status); int32_t checks = uspoof_getChecks(check...
CWE-20
2
1
static void huffman_decode_row(x3f_info_t *I, x3f_directory_entry_t *DE, int bits, int row, int offset, int *minimum) { x3f_directory_entry_header_t *DEH = &DE->header; x3f_image_data_t *ID = &DEH->data_subsection.image_data; x3f_huffman_t *HUF = ID->huffman; int16_t c[3] = {(int...
CWE-125
1
0
SplashCoord *Splash::getLineDash() { return state->lineDash; }
none
8
1
static int read_header(FFV1Context *f) { uint8_t state[CONTEXT_SIZE]; int i, j, context_count = -1; //-1 to avoid warning RangeCoder *const c = &f->slice_context[0]->c; memset(state, 128, sizeof(state)); if (f->version < 2) { int chroma_planes, chroma_h_shift, chroma_v_shift, transparen...
CWE-119
0
1
static INLINE INT32 planar_skip_plane_rle(const BYTE* pSrcData, UINT32 SrcSize, UINT32 nWidth, UINT32 nHeight) { UINT32 x, y; BYTE controlByte; const BYTE* pRLE = pSrcData; const BYTE* pEnd = &pSrcData[SrcSize]; for (y = 0; y < nHeight; y++) { for (x = 0; x < nWidth;) ...
CWE-125
1
1
lha_read_file_header_1(struct archive_read *a, struct lha *lha) { const unsigned char *p; size_t extdsize; int i, err, err2; int namelen, padding; unsigned char headersum, sum_calculated; err = ARCHIVE_OK; if ((p = __archive_read_ahead(a, H1_FIXED_SIZE, NULL)) == NULL) return (truncated_error(a)); lha->hea...
CWE-125
1
0
GfxSubpath::GfxSubpath(GfxSubpath *subpath) { size = subpath->size; n = subpath->n; x = (double *)gmallocn(size, sizeof(double)); y = (double *)gmallocn(size, sizeof(double)); curve = (GBool *)gmallocn(size, sizeof(GBool)); memcpy(x, subpath->x, n * sizeof(double)); memcpy(y, subpath->y, n * sizeof(double...
none
8
1
static void update_read_synchronize(rdpUpdate* update, wStream* s) { WINPR_UNUSED(update); Stream_Seek_UINT16(s); /* pad2Octets (2 bytes) */ /** * The Synchronize Update is an artifact from the * T.128 protocol and should be ignored. ...
CWE-125
1
0
static void migrate_timeout(void *opaque) { spice_info(NULL); spice_assert(reds->mig_wait_connect || reds->mig_wait_disconnect); if (reds->mig_wait_connect) { /* we will fall back to the switch host scheme when migration completes */ main_channel_migrate_cancel_wait(reds->main_channel); ...
none
8
1
static u_char *php_parserr(u_char *cp, u_char *end, querybuf *answer, int type_to_fetch, int store, int raw, zval *subarray) { u_short type, class, dlen; u_long ttl; long n, i; u_short s; u_char *tp, *p; char name[MAXHOSTNAMELEN]; int have_v6_break = 0, in_v6_break = 0; ZVAL_UNDEF(subarray); n = dn_expand(an...
CWE-125
1
1
int Bind(const Node& node, int max_retry) override { receiver_ = zmq_socket(context_, ZMQ_ROUTER); CHECK(receiver_ != NULL) << "create receiver socket failed: " << zmq_strerror(errno); int local = GetEnv("DMLC_LOCAL", 0); std::string addr = local ? "ipc:///tmp/" : "tcp://*:"; int port = no...
CWE-200
3
0
void ArthurOutputDev::updateFillColor(GfxState *state) { GfxRGB rgb; QColor brushColour = m_currentBrush.color(); state->getFillRGB(&rgb); brushColour.setRgbF(colToDbl(rgb.r), colToDbl(rgb.g), colToDbl(rgb.b), brushColour.alphaF()); m_currentBrush.setColor(brushColour); }
none
8
0
static void red_channel_client_disconnect_dummy(RedChannelClient *rcc) { spice_assert(rcc->dummy); if (ring_item_is_linked(&rcc->channel_link)) { red_channel_remove_client(rcc); } rcc->dummy_connected = FALSE; }
none
8
1
TEE_Result syscall_cryp_obj_populate(unsigned long obj, struct utee_attribute *usr_attrs, unsigned long attr_count) { TEE_Result res; struct tee_ta_session *sess; struct tee_obj *o; const struct tee_cryp_obj_type_props *type_props; TEE_Attribute *attrs = NULL; res = tee_ta_get_current_session(&sess); if (...
CWE-119
0
1
static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement) { size_t i; int de, section_index = SECTION_MAKERNOTE; int NumDirEntries, old_motorola_intel; #ifdef KALLE_0 int offset_diff; #endif const maker_note_type ...
CWE-125
1
1
parseChars(FileInfo *nested, CharsString *result, CharsString *token) { int in = 0; int out = 0; int lastOutSize = 0; int lastIn; unsigned int ch = 0; int numBytes = 0; unsigned int utf32 = 0; int k; while (in < token->length) { ch = token->chars[in++] & 0xff; if (ch < 128) { if (ch == '\\') { /* escape...
CWE-787
7
1
search_in_range(regex_t* reg, const UChar* str, const UChar* end, const UChar* start, const UChar* range, /* match start range */ const UChar* data_range, /* subject string range */ OnigRegion* region, OnigOptionType option, OnigMatchParam* mp) { int r; ...
CWE-125
1
1
long kernel_wait4(pid_t upid, int __user *stat_addr, int options, struct rusage *ru) { struct wait_opts wo; struct pid *pid = NULL; enum pid_type type; long ret; if (options & ~(WNOHANG|WUNTRACED|WCONTINUED| __WNOTHREAD|__WCLONE|__WALL)) return -EINVAL; if (upid == -1) type = PIDTYPE_MAX; else...
CWE-20
2
1
_gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey, gcry_mpi_t r_r, gcry_mpi_t s, int hashalgo, gcry_mpi_t pk) { int rc; mpi_ec_t ctx = NULL; int b; unsigned int tmp; unsigned char *digest = NULL; gcry_buffer_t hvec[3]; const void *mbuf; size_t mlen; unsigned char *rawm...
CWE-200
3
0
int ssl3_get_req_cert_type(SSL *s, unsigned char *p) { int ret=0; unsigned long alg_k; alg_k = s->s3->tmp.new_cipher->algorithm_mkey; #ifndef OPENSSL_NO_GOST if (s->version >= TLS1_VERSION) { if (alg_k & SSL_kGOST) { p[ret++]=TLS_CT_GOST94_SIGN; p[ret++]=TLS_CT_GOST01_SIGN; return(ret); } } ...
none
8
1
static bool ldm_frag_add (const u8 *data, int size, struct list_head *frags) { struct frag *f; struct list_head *item; int rec, num, group; BUG_ON (!data || !frags); if (size < 2 * VBLK_SIZE_HEAD) { ldm_error("Value of size is to small."); return false; } group = get_unaligned_be32(data + 0x08); rec = ...
CWE-119
0
0
void reds_enable_mm_timer(void) { core->timer_start(reds->mm_timer, MM_TIMER_GRANULARITY_MS); reds->mm_timer_enabled = TRUE; reds->mm_time_latency = MM_TIME_DELTA; reds_send_mm_time(); }
none
8
0
CairoImageOutputDev::CairoImageOutputDev() { images = NULL; numImages = 0; size = 0; imgDrawCbk = NULL; imgDrawCbkData = NULL; }
none
8
1
formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form) { Buffer save; char *p; int spos, epos, rows, c_rows, pos, col = 0; Line *l; copyBuffer(&save, buf); gotoLine(buf, a->start.line); switch (form->type) { case FORM_TEXTAREA: case FORM_INPUT_TEXT: case FORM_INPUT_FILE: ...
CWE-119
0
1
Response PageHandler::SetDownloadBehavior(const std::string& behavior, Maybe<std::string> download_path) { WebContentsImpl* web_contents = GetWebContents(); if (!web_contents) return Response::InternalError(); if (behavior == Page::SetDownloadBehavior::BehaviorE...
CWE-20
2
0
static inline void red_channel_client_release_sent_item(RedChannelClient *rcc) { if (rcc->send_data.item) { red_channel_client_release_item(rcc, rcc->send_data.item, TRUE); rcc->send_data.item = NULL; } }
none
8
0
void red_channel_client_pipe_add_push(RedChannelClient *rcc, PipeItem *item) { red_channel_client_pipe_add(rcc, item); red_channel_client_push(rcc); }
none
8
1
fd_read_body (const char *downloaded_filename, int fd, FILE *out, wgint toread, wgint startpos, wgint *qtyread, wgint *qtywritten, double *elapsed, int flags, FILE *out2) { int ret = 0; #undef max #define max(a,b) ((a) > (b) ? (a) : (b)) int dlbufsize = max (BUFSIZ, 8 * 1024); char *d...
CWE-119
0
1
sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) { SDHCIState *s = (SDHCIState *)opaque; unsigned shift = 8 * (offset & 0x3); uint32_t mask = ~(((1ULL << (size * 8)) - 1) << shift); uint32_t value = val; value <<= shift; if (timer_pending(s->transfer_timer)) { sdhc...
CWE-119
0
1
static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, size_t count, loff_t *offset) { struct snd_timer_user *tu; long result = 0, unit; int qhead; int err = 0; tu = file->private_data; unit = tu->tread ? sizeof(struct snd_timer_tread) : sizeof(struct snd_timer_read); spin_lock_ir...
CWE-200
3
1
static void tcp_send_challenge_ack(struct sock *sk, const struct sk_buff *skb) { /* unprotected vars, we dont care of overwrites */ static u32 challenge_timestamp; static unsigned int challenge_count; struct tcp_sock *tp = tcp_sk(sk); u32 now; /* First check our per-socket dupack rate limit. */ if (tcp_oo...
CWE-200
3
1
static void cirrus_invalidate_region(CirrusVGAState * s, int off_begin, int off_pitch, int bytesperline, int lines) { int y; int off_cur; int off_cur_end; for (y = 0; y < lines; y++) { off_cur = off_begin; off_cur_end = (off_cur + bytesperline) & s->cirrus_addr_mas...
CWE-125
1
0
void Splash::setStrokeAlpha(SplashCoord alpha) { state->strokeAlpha = alpha; }
none
8
1
static void usb_xhci_exit(PCIDevice *dev) { int i; XHCIState *xhci = XHCI(dev); trace_usb_xhci_exit(); for (i = 0; i < xhci->numslots; i++) { xhci_disable_slot(xhci, i + 1); } if (xhci->mfwrap_timer) { timer_del(xhci->mfwrap_timer); timer_free(xhci->mfwrap_timer); ...
CWE-399
4
1
static inline loff_t ext4_isize(struct ext4_inode *raw_inode) { return ((loff_t)le32_to_cpu(raw_inode->i_size_high) << 32) | le32_to_cpu(raw_inode->i_size_lo);
CWE-399
4
1
void luaD_shrinkstack (lua_State *L) { int inuse = stackinuse(L); int goodsize = inuse + (inuse / 8) + 2*EXTRA_STACK; if (goodsize > LUAI_MAXSTACK) goodsize = LUAI_MAXSTACK; /* respect stack limit */ /* if thread is currently not handling a stack overflow and its good size is smaller than current size...
CWE-125
1
0
inline void Splash::updateModY(int y) { if (y < modYMin) { modYMin = y; } if (y > modYMax) { modYMax = y; } }
none
8
1
void Browser::SetWebContentsBlocked(content::WebContents* web_contents, bool blocked) { int index = tab_strip_model_->GetIndexOfWebContents(web_contents); if (index == TabStripModel::kNoTab) { return; } tab_strip_model_->SetTabBlocked(index, blocked); bool browser...
CWE-20
2
1
static char *get_pid_environ_val(pid_t pid,char *val){ char temp[500]; int i=0; int foundit=0; FILE *fp; sprintf(temp,"/proc/%d/environ",pid); fp=fopen(temp,"r"); if(fp==NULL) return NULL; for(;;){ temp[i]=fgetc(fp); if(foundit==1 && (temp[i]==0 || temp[i]=='\0' || temp[...
CWE-119
0
1
flushline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent, int force, int width) { TextLineList *buf = h_env->buf; FILE *f = h_env->f; Str line = obuf->line, pass = NULL; char *hidden_anchor = NULL, *hidden_img = NULL, *hidden_bold = NULL, *hidden_under = NULL, *hidden_italic = ...
CWE-476
6
1
String_Obj Parser::parse_url_function_argument() { const char* p = position; std::string uri(""); if (lex< real_uri_value >(false)) { uri = lexed.to_string(); } if (peek< exactly< hash_lbrace > >()) { const char* pp = position; // TODO: error checking for unclosed interpolant...
CWE-125
1
0
is_invalid_entry (struct fileinfo *f) { struct fileinfo *cur = f; char *f_name = f->name; /* If the node we're currently checking has a duplicate later, we eliminate * the current node and leave the next one intact. */ while (cur->next) { cur = cur->next; if (strcmp(f_name, cur->name) == 0) ...
none
8
1
static int qcow2_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVQcowState *s = bs->opaque; int len, i, ret = 0; QCowHeader header; QemuOpts *opts; Error *local_err = NULL; uint64_t ext_end; uint64_t l1_vm_state_index; const char *opt_overl...
CWE-20
2
0
void reds_disable_mm_timer(void) { core->timer_cancel(reds->mm_timer); reds->mm_timer_enabled = FALSE; }
none
8
1
static void parse_hid_report_descriptor(struct gtco *device, char * report, int length) { struct device *ddev = &device->intf->dev; int x, i = 0; /* Tag primitive vars */ __u8 prefix; __u8 size; __u8 tag; __u8 type; __u8 data = 0; __u16 data16 = 0; __u32 data32 = 0; /* For parsing logi...
CWE-125
1
1
static void mysql_prune_stmt_list(MYSQL *mysql) { LIST *element= mysql->stmts; LIST *pruned_list= 0; for (; element; element= element->next) { MYSQL_STMT *stmt= (MYSQL_STMT *) element->data; if (stmt->state != MYSQL_STMT_INIT_DONE) { stmt->mysql= 0; stmt->last_errno= CR_SERVER_LOST; ...
CWE-416
5
0
static void red_channel_client_default_disconnect(RedChannelClient *base) { red_channel_client_disconnect(base); }
none
8
1
gdImageScaleTwoPass(const gdImagePtr src, const unsigned int new_width, const unsigned int new_height) { const unsigned int src_width = src->sx; const unsigned int src_height = src->sy; gdImagePtr tmp_im = NULL; gdImagePtr dst = NULL; /* First, handle the trivial case. */ if (src_...
CWE-399
4
1
bool AsyncPixelTransfersCompletedQuery::End( base::subtle::Atomic32 submit_count) { AsyncMemoryParams mem_params; Buffer buffer = manager()->decoder()->GetSharedMemoryBuffer(shm_id()); if (!buffer.shared_memory) return false; mem_params.shared_memory = buffer.shared_memory; mem_params.shm_size = buff...
CWE-119
0
1
icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char *bp2, int fragmented) { char *cp; const struct icmp *dp; const struct icmp_ext_t *ext_dp; const struct ip *ip; const char *str, *fmt; const struct ip *oip; const struct udphdr *ouh; const uint8_t *obj_tptr; ...
CWE-125
1
1
void ColorChooserDialog::DidCloseDialog(bool chose_color, SkColor color, RunState run_state) { if (!listener_) return; EndRun(run_state); CopyCustomColors(custom_colors_, g_custom_colors); if (chose_color) listener_->On...
CWE-399
4
1
static int __br_mdb_del(struct net_bridge *br, struct br_mdb_entry *entry) { struct net_bridge_mdb_htable *mdb; struct net_bridge_mdb_entry *mp; struct net_bridge_port_group *p; struct net_bridge_port_group __rcu **pp; struct br_ip ip; int err = -EINVAL; if (!netif_running(br->dev) || br->multicast_disabled) ...
CWE-20
2
1
static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size) { int ia32_fxstate = (buf != buf_fx); struct task_struct *tsk = current; struct fpu *fpu = &tsk->thread.fpu; int state_size = fpu_kernel_xstate_size; u64 xfeatures = 0; int fx_only = 0; ia32_fxstate &= (IS_ENABLED(CONFIG_X86_32) || ...
CWE-200
3
1
static av_cold int vqa_decode_init(AVCodecContext *avctx) { VqaContext *s = avctx->priv_data; int i, j, codebook_index, ret; s->avctx = avctx; avctx->pix_fmt = AV_PIX_FMT_PAL8; /* make sure the extradata made it */ if (s->avctx->extradata_size != VQA_HEADER_SIZE) { av_log(s->avctx, AV_...
CWE-20
2
0
static const struct policy *policyof(const struct in6_addr *a) { int i; for (i=0; ; i++) { if (memcmp(a->s6_addr, defpolicy[i].addr, defpolicy[i].len)) continue; if ((a->s6_addr[defpolicy[i].len] & defpolicy[i].mask) != defpolicy[i].addr[defpolicy[i].len]) continue; return defpolicy+i; } }
none
8
0
void GfxDeviceRGBColorSpace::getGrayLine(Guchar *in, Guchar *out, int length) { int i; for (i = 0; i < length; i++) { out[i] = (in[i * 3 + 0] * 19595 + in[i * 3 + 1] * 38469 + in[i * 3 + 2] * 7472) / 65536; } }
none
8
0
static uint32_t *rpc_add_credentials(uint32_t *p) { /* * *BSD refuses AUTH_NONE, so use AUTH_UNIX. An empty hostname is OK for * both Linux and *BSD. */ /* Provide an AUTH_UNIX credential. */ *p++ = hton32(1); /* AUTH_UNIX */ *p++ = hton32(20); /* auth length: 20 + strlen(hostname) */ *p++ = hton32(0); ...
none
8
1
ext4_find_extent(struct inode *inode, ext4_lblk_t block, struct ext4_ext_path **orig_path, int flags) { struct ext4_extent_header *eh; struct buffer_head *bh; struct ext4_ext_path *path = orig_path ? *orig_path : NULL; short int depth, i, ppos = 0; int ret; eh = ext_inode_hdr(inode); depth = ext_depth(inode)...
CWE-125
1
1
BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) { int lastBorder; /* Seek left */ int leftLimit, rightLimit; int i; int restoreAlphaBleding; if (border < 0) { /* Refuse to fill to a non-solid border */ return; } leftLimit = (-1); restoreAlphaBleding =...
CWE-119
0
1
commonio_sort (struct commonio_db *db, int (*cmp) (const void *, const void *)) { struct commonio_entry **entries, *ptr; size_t n = 0, i; #if KEEP_NIS_AT_END struct commonio_entry *nis = NULL; #endif for (ptr = db->head; (NULL != ptr) #if KEEP_NIS_AT_END && (NULL != ptr->line) && ( ('+' != p...
CWE-787
7
1
ikev1_n_print(netdissect_options *ndo, u_char tpay _U_, const struct isakmp_gen *ext, u_int item_len, const u_char *ep, uint32_t phase _U_, uint32_t doi0 _U_, uint32_t proto0 _U_, int depth _U_) { const struct ikev1_pl_n *p; struct ikev1_pl_n n; const u_char *cp; const u_char *ep2; uint32_t do...
CWE-125
1
1
int MDC2_Update(MDC2_CTX *c, const unsigned char *in, size_t len) { size_t i, j; i = c->num; if (i != 0) { if (i + len < MDC2_BLOCK) { /* partial block */ memcpy(&(c->data[i]), in, len); c->num += (int)len; return 1; } else { ...
CWE-787
7
1
init_state(struct posix_acl_state *state, int cnt) { int alloc; memset(state, 0, sizeof(struct posix_acl_state)); state->empty = 1; /* * In the worst case, each individual acl could be for a distinct * named user or group, but we don't no which, so we allocate * enough space for either: */ alloc = sizeof(...
CWE-119
0
0
int SplashOutputDev::getBitmapWidth() { return bitmap->getWidth(); }
none
8
1
xmlParseEntityDecl(xmlParserCtxtPtr ctxt) { const xmlChar *name = NULL; xmlChar *value = NULL; xmlChar *URI = NULL, *literal = NULL; const xmlChar *ndata = NULL; int isParameter = 0; xmlChar *orig = NULL; int skipped; /* GROW; done in the caller */ if (CMP8(CUR_PTR, '<', '!', 'E', '...
CWE-119
0