instruction
stringclasses
1 value
input
stringlengths
56
241k
output
int64
0
1
__index_level_0__
int64
0
175k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) { __u32 __user *uaddr = (__u32 __user *)(unsigned long)reg->addr; struct kvm_regs *regs = vcpu_gp_regs(vcpu); int nr_regs = sizeof(*regs) / sizeof(__u32); __uint128_t tmp; void *valp = &tmp; u64 off; int err = 0; /* Our ID is a...
1
170,159
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int gpr32_set(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, const void *kbuf, const void __user *ubuf) { unsigned long *regs = &target->thread.regs->gpr[0]; const compat_ulong_t *k = kbuf; const compat_ulong_t __user *u = ubuf; ...
0
25,482
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Browser* Browser::GetOrCreateTabbedBrowser(Profile* profile) { Browser* browser = GetTabbedBrowser(profile, false); if (!browser) browser = Browser::Create(profile); return browser; } Commit Message: Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode via webkitR...
0
97,227
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Ins_SROUND( INS_ARG ) { DO_SROUND } Commit Message: CWE ID: CWE-119
0
10,179
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: error::Error GLES2DecoderImpl::DoCommand( unsigned int command, unsigned int arg_count, const void* cmd_data) { error::Error result = error::kNoError; if (log_commands()) { LOG(ERROR) << "[" << this << "]" << "cmd: " << GetCommandName(command); } unsigned int command_index = command - kSta...
0
108,960
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int key_notify_policy_flush(const struct km_event *c) { struct sk_buff *skb_out; struct sadb_msg *hdr; skb_out = alloc_skb(sizeof(struct sadb_msg) + 16, GFP_ATOMIC); if (!skb_out) return -ENOBUFS; hdr = (struct sadb_msg *) skb_put(skb_out, sizeof(struct sadb_msg)); hdr->sadb_msg_type = SADB_X_SPDF...
0
40,477
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static EAS_RESULT Parse_wave (SDLS_SYNTHESIZER_DATA *pDLSData, EAS_I32 pos, EAS_U16 waveIndex) { EAS_RESULT result; EAS_U32 temp; EAS_I32 size; EAS_I32 endChunk; EAS_I32 chunkPos; EAS_I32 wsmpPos = 0; EAS_I32 fmtPos = 0; EAS_I32 dataPos = 0; EAS_I32 dataSize = 0; S_WSMP_DAT...
1
173,356
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void StyleResolver::applyAnimatedProperties(StyleResolverState& state, Element* animatingElement) { if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled() || !animatingElement) return; state.setAnimationUpdate(CSSAnimations::calculateUpdate(animatingElement, *state.style(), this)); if (!state....
0
118,947
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: tight_detect_smooth_image24(VncState *vs, int w, int h) { int off; int x, y, d, dx; unsigned int c; unsigned int stats[256]; int pixels = 0; int pix, left[3]; unsigned int errors; unsigned char *buf = vs->tight.tight.buffer; /* * If client is big-endian, color samples be...
1
165,465
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: double VideoTrack::GetFrameRate() const { return m_rate; } Commit Message: libwebm: Pull from upstream Rolling mkvparser from upstream. Primarily for fixing a bug on parsing failures with certain Opus WebM files. Upstream commit hash of this pull: 574045edd4ecbeb802ee3f1d214b5510269852ae The diff is so hu...
1
174,326
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLES2DecoderImpl::~GLES2DecoderImpl() { } Commit Message: Fix SafeAdd and SafeMultiply BUG=145648,145544 Review URL: https://chromiumcodereview.appspot.com/10916165 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155478 0039d316-1c4b-4281-b951-d872f2087c98 CWE ID: CWE-189
0
103,707
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PSOutputDev::PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA, char *psTitle, XRef *xrefA, Catalog *catalog, int firstPage, int lastPage, PSOutMode modeA, int paperWidthA, int paperHeightA, GBool duplexA, int imgLLXA, int imgLLYA, int imgURXA, int imgURYA, GBool forceRasterizeA, ...
0
1,218
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void TabStripModel::ActivateTabAt(int index, bool user_gesture) { DCHECK(ContainsIndex(index)); bool had_multi = selection_model_.selected_indices().size() > 1; TabContentsWrapper* old_contents = (active_index() == TabStripSelectionModel::kUnselectedIndex) ? NULL : GetSelectedTabContents(); se...
0
98,067
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderFrameHostImpl::ResetWaitingState() { DCHECK(is_active()); if (is_waiting_for_beforeunload_ack_) { is_waiting_for_beforeunload_ack_ = false; if (beforeunload_timeout_) beforeunload_timeout_->Stop(); } send_before_unload_start_time_ = base::TimeTicks(); render_view_host_->is_wait...
0
127,889
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void reada_for_search(struct btrfs_root *root, struct btrfs_path *path, int level, int slot, u64 objectid) { struct extent_buffer *node; struct btrfs_disk_key disk_key; u32 nritems; u64 search; u64 target; u64 nread = 0; u64 gen; int direction = path->reada; struct extent_buffer *e...
0
45,349
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: selaFindSelByName(SELA *sela, const char *name, l_int32 *pindex, SEL **psel) { l_int32 i, n; char *sname; SEL *sel; PROCNAME("selaFindSelByName"); if (pindex) *pindex = -1; if (psel) *psel = NULL; if (!sela) ...
0
84,232
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline dma_addr_t __alloc_iova(struct dma_iommu_mapping *mapping, size_t size) { unsigned int order = get_order(size); unsigned int align = 0; unsigned int count, start; unsigned long flags; if (order > CONFIG_ARM_DMA_IOMMU_ALIGNMENT) order = CONFIG_ARM_DMA_IOMMU_ALIGNMENT; count = ((PA...
0
58,254
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int decode_zbuf(AVBPrint *bp, const uint8_t *data, const uint8_t *data_end) { z_stream zstream; unsigned char *buf; unsigned buf_size; int ret; zstream.zalloc = ff_png_zalloc; zstream.zfree = ff_png_zfree; zstream.opaque = NULL; if (inflateInit(&zstr...
1
168,245
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool WebContentsImpl::IsFullAccessibilityModeForTesting() const { return accessibility_mode_ == ui::kAXModeComplete; } Commit Message: Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser initiated navigation...
0
144,987
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void swevent_hlist_put(struct perf_event *event) { int cpu; for_each_possible_cpu(cpu) swevent_hlist_put_cpu(event, cpu); } Commit Message: perf: Fix event->ctx locking There have been a few reported issues wrt. the lack of locking around changing event->ctx. This patch tries to address those. It a...
0
50,534
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: s32 hid_snto32(__u32 value, unsigned n) { return snto32(value, n); } Commit Message: HID: core: prevent out-of-bound readings Plugging a Logitech DJ receiver with KASAN activated raises a bunch of out-of-bound readings. The fields are allocated up to MAX_USAGE, meaning that potentially, we do not have enough ...
0
49,523
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void pdu_complete(V9fsPDU *pdu, ssize_t len) { int8_t id = pdu->id + 1; /* Response */ V9fsState *s = pdu->s; if (len < 0) { int err = -len; len = 7; if (s->proto_version != V9FS_PROTO_2000L) { V9fsString str; str.data = strerror(err); ...
0
8,204
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void SetImpl(FixedArrayBase* backing_store, uint32_t entry, Object* value, WriteBarrierMode mode) { BackingStore::cast(backing_store)->SetValue(entry, value); } Commit Message: Backport: Fix Object.entries/values with changing elements Bug: 111274046 Test: m -j proxy_resolver_v8_unittest && ad...
0
163,179
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: VOID ParaNdis_PadPacketToMinimalLength(PNET_PACKET_INFO packetInfo) { if(packetInfo->dataLength < ETH_MIN_PACKET_SIZE) { RtlZeroMemory( RtlOffsetToPointer(packetInfo->headersBuffer, packetInfo->dataLength), ETH_MIN_PACKET_SIZE - packetInfo->dataLen...
0
74,435
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Plugin::BitcodeDidTranslateContinuation(int32_t pp_error) { ErrorInfo error_info; bool was_successful = LoadNaClModuleContinuationIntern(&error_info); NaClLog(4, "Entered BitcodeDidTranslateContinuation\n"); UNREFERENCED_PARAMETER(pp_error); if (was_successful) { ReportLoadSuccess(LENGTH_IS_NO...
0
103,334
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ResourceLoader::Release(ResourceLoadScheduler::ReleaseOption option) { DCHECK_NE(ResourceLoadScheduler::kInvalidClientId, scheduler_client_id_); bool released = scheduler_->Release(scheduler_client_id_, option); DCHECK(released); scheduler_client_id_ = ResourceLoadScheduler::kInvalidClientId; } Comm...
0
138,937
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gsicc_init_gs_colors(gs_gstate *pgs) { int code = 0; gs_color_space *cs_old; gs_color_space *cs_new; int k; if (pgs->in_cachedevice) return_error(gs_error_undefined); for (k = 0; k < 2; k++) { /* First do color space 0 */ cs_old = pgs->color[k].color...
0
13,970
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int wc_ecc_import_raw(ecc_key* key, const char* qx, const char* qy, const char* d, const char* curveName) { int err, x; /* if d is NULL, only import as public key using Qx,Qy */ if (key == NULL || qx == NULL || qy == NULL || curveName == NULL) { return BAD_FUNC_ARG; } ...
0
81,897
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderWidgetHostImpl::SetWidget(mojom::WidgetPtr widget) { if (widget && base::FeatureList::IsEnabled(features::kMojoInputMessages)) { if (widget_input_handler_.get()) SetupInputRouter(); mojom::WidgetInputHandlerHostPtr host; mojom::WidgetInputHandlerHostRequest host_request = m...
0
155,612
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WallpaperManagerBase::OnPolicySet(const std::string& policy, const AccountId& account_id) { WallpaperInfo info; GetUserWallpaperInfo(account_id, &info); info.type = POLICY; SetUserWallpaperInfo(account_id, info, true /* is_persistent */); } Commit Message: [rel...
0
128,077
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: dbmatch_authorize(krb5_context context, krb5_certauth_moddata moddata, const uint8_t *cert, size_t cert_len, krb5_const_principal princ, const void *opts, const struct _krb5_db_entry_new *db_entry, char ***authinds_out) { krb5_error_code ...
0
96,448
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void manage_server_side_cookies(struct session *s, struct channel *res) { struct http_txn *txn = &s->txn; struct server *srv; int is_cookie2; int cur_idx, old_idx, delta; char *hdr_beg, *hdr_end, *hdr_next; char *prev, *att_beg, *att_end, *equal, *val_beg, *val_end, *next; /* Iterate through the headers. ...
0
9,827
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: opj_tcd_t* opj_tcd_create(OPJ_BOOL p_is_decoder) { opj_tcd_t *l_tcd = 00; /* create the tcd structure */ l_tcd = (opj_tcd_t*) opj_calloc(1,sizeof(opj_tcd_t)); if (!l_tcd) { return 00; } l_tcd->m_is_decoder = p_is_decoder ? 1 : 0; l_tcd->tc...
0
52,127
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int usb_reset_and_verify_device(struct usb_device *udev) { struct usb_device *parent_hdev = udev->parent; struct usb_hub *parent_hub; struct usb_hcd *hcd = bus_to_hcd(udev->bus); struct usb_device_descriptor descriptor = udev->descriptor; struct usb_host_bos *bos; int i, j, ret = 0; int ...
0
56,826
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void cap_emulate_setxuid(struct cred *new, const struct cred *old) { if ((old->uid == 0 || old->euid == 0 || old->suid == 0) && (new->uid != 0 && new->euid != 0 && new->suid != 0) && !issecure(SECURE_KEEP_CAPS)) { cap_clear(new->cap_permitted); cap_clear(new->cap_effective); } if (o...
0
20,266
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static ssize_t vmci_transport_stream_enqueue( struct vsock_sock *vsk, struct iovec *iov, size_t len) { return vmci_qpair_enquev(vmci_trans(vsk)->qpair, iov, len, 0); } Commit Message: VSOCK: vmci - fix possible info leak in vmci_transport_dgram_dequeue() In case we received no data on the call to skb_recv_d...
0
30,440
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void AppCacheUpdateJob::Cancel() { internal_state_ = CANCELLED; LogHistogramStats(CANCELLED_ERROR, GURL()); if (manifest_fetcher_) { delete manifest_fetcher_; manifest_fetcher_ = NULL; } for (PendingUrlFetches::iterator it = pending_url_fetches_.begin(); it != pending_url_fetches_.end(...
0
124,122
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int snd_seq_ioctl_subscribe_port(struct snd_seq_client *client, void *arg) { struct snd_seq_port_subscribe *subs = arg; int result = -EINVAL; struct snd_seq_client *receiver = NULL, *sender = NULL; struct snd_seq_client_port *sport = NULL, *dport = NULL; if ((receiver = snd_seq_client_use_ptr(su...
0
60,609
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void neuterArrayBufferInAllWorlds(ArrayBuffer* object) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); if (isMainThread()) { Vector<RefPtr<DOMWrapperWorld> > worlds; DOMWrapperWorld::allWorldsInMainThread(worlds); for (size_t i = 0; i < worlds.size(); i++) { ...
0
120,493
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int aes_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t len) { EVP_AES_KEY *dat = EVP_C_DATA(EVP_AES_KEY,ctx); int num = EVP_CIPHER_CTX_num(ctx); CRYPTO_cfb128_encrypt(in, out, len, &dat->ks, EVP_CIPHER_CTX...
0
69,321
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WORD32 ihevcd_get_vui_params(iv_obj_t *ps_codec_obj, void *pv_api_ip, void *pv_api_op) { ihevcd_cxa_ctl_get_vui_params_ip_t *ps_ip; ihevcd_cxa_ctl_get_vui_params_op_t *ps_op; codec_t *ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle; sps_t *ps_sps; vui_t *ps_vui; WORD32 i; ps_ip = (ihevcd_cxa_c...
0
163,311
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: lex_expect(JsonParseContext ctx, JsonLexContext *lex, JsonTokenType token) { if (!lex_accept(lex, token, NULL)) report_parse_error(ctx, lex); } Commit Message: CWE ID: CWE-119
0
2,544
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool PSIR_FileWriter::GetImgRsrc ( XMP_Uns16 id, ImgRsrcInfo* info ) const { InternalRsrcMap::const_iterator rsrcPos = this->imgRsrcs.find ( id ); if ( rsrcPos == this->imgRsrcs.end() ) return false; const InternalRsrcInfo & rsrcInfo = rsrcPos->second; if ( info != 0 ) { info->id = rsrcInfo.id; info->da...
0
9,959
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: UINT CSoundFile::ReadSample(MODINSTRUMENT *pIns, UINT nFlags, LPCSTR lpMemFile, DWORD dwMemLength) { UINT len = 0, mem = pIns->nLength+6; if ((!pIns) || (pIns->nLength < 4) || (!lpMemFile)) return 0; if (pIns->nLength > MAX_SAMPLE_LENGTH) pIns->nLength = MAX_SAMPLE_LENGTH; pIns->uFlags &= ~(CHN_16BIT|CH...
1
164,930
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: check_symlinks(struct archive_write_disk *a) { #if !defined(HAVE_LSTAT) /* Platform doesn't have lstat, so we can't look for symlinks. */ (void)a; /* UNUSED */ return (ARCHIVE_OK); #else char *pn; char c; int r; struct stat st; /* * Guard against symlink tricks. Reject any archive entry wh...
1
167,135
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void vrend_destroy_vertex_elements_object(void *obj_ptr) { struct vrend_vertex_element_array *v = obj_ptr; if (vrend_state.have_vertex_attrib_binding) { glDeleteVertexArrays(1, &v->id); } FREE(v); } Commit Message: CWE ID: CWE-772
0
8,853
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: top_proc(mrb_state *mrb, struct RProc *proc) { while (proc->upper) { if (MRB_PROC_SCOPE_P(proc) || MRB_PROC_STRICT_P(proc)) return proc; proc = proc->upper; } return proc; } Commit Message: Check length of env stack before accessing upvar; fix #3995 CWE ID: CWE-190
0
83,198
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Gfx::opSetTextLeading(Object args[], int numArgs) { state->setLeading(args[0].getNum()); } Commit Message: CWE ID: CWE-20
0
8,162
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CLOSE_BRACKET_WITHOUT_ESC_WARN(ScanEnv* env, UChar* c) { if (onig_warn == onig_null_warn) return ; if (IS_SYNTAX_BV((env)->syntax, ONIG_SYN_WARN_CC_OP_NOT_ESCAPED)) { UChar buf[WARN_BUFSIZE]; onig_snprintf_with_pattern(buf, WARN_BUFSIZE, (env)->enc, (env)->pattern, (env)->pattern_end, (UChar* )"r...
0
64,696
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int mkfifo_atomic(const char *path, mode_t mode) { _cleanup_free_ char *t = NULL; int r; assert(path); r = tempfn_random(path, NULL, &t); if (r < 0) return r; if (mkfifo(t, mode) < 0) return -errno; if (rename(t, path) < 0...
0
71,135
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GLES2DecoderImpl::DoCopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) { TextureManager::TextureInfo* info = GetTextureInfoForTarget(target); if (!info) { SetGLError(GL_INVALID_OPERATION, "glCopy...
0
99,135
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void aesni_xts_dec(void *ctx, u128 *dst, const u128 *src, le128 *iv) { glue_xts_crypt_128bit_one(ctx, dst, src, iv, GLUE_FUNC_CAST(aesni_dec)); } Commit Message: crypto: aesni - fix memory usage in GCM decryption The kernel crypto API logic requires the caller to provide the length of (ciphertext || aut...
0
43,470
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cff_builder_add_contour( CFF_Builder* builder ) { FT_Outline* outline = builder->current; FT_Error error; if ( !builder->load_points ) { outline->n_contours++; return CFF_Err_Ok; } error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 ); if ( !error ) ...
0
10,348
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: fz_drop_cmm_context(fz_context *ctx) { fz_cmm_drop_instance(ctx); ctx->cmm_instance = NULL; } Commit Message: CWE ID: CWE-20
0
365
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Document::detachNodeIterator(NodeIterator* ni) { m_nodeIterators.remove(ni); } Commit Message: Refactoring: Move m_mayDisplaySeamlesslyWithParent down to Document The member is used only in Document, thus no reason to stay in SecurityContext. TEST=none BUG=none R=haraken@chromium.org, abarth, haraken,...
0
102,682
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void js_pushrune(js_State *J, Rune rune) { char buf[UTFmax + 1]; if (rune > 0) { buf[runetochar(buf, &rune)] = 0; js_pushstring(J, buf); } else { js_pushundefined(J); } } Commit Message: CWE ID: CWE-119
0
13,466
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void e1000e_update_flowctl_status(E1000ECore *core) { if (e1000e_have_autoneg(core) && core->phy[0][PHY_STATUS] & MII_SR_AUTONEG_COMPLETE) { trace_e1000e_link_autoneg_flowctl(true); core->mac[CTRL] |= E1000_CTRL_TFCE | E1000_CTRL_RFCE; } else { trace_e1000e_link_auto...
0
6,092
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv) { (void)pamh; (void)flags; (void)argc; (void)argv; return PAM_SUCCESS; } Commit Message: Do not leak file descriptor when doing exec When opening a custom debug file, the descriptor...
0
89,791
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int vop_host_init(struct vop_info *vi) { int rc; struct miscdevice *mdev; struct vop_device *vpdev = vi->vpdev; INIT_LIST_HEAD(&vi->vdev_list); vi->dma_ch = vpdev->dma_ch; mdev = &vi->miscdev; mdev->minor = MISC_DYNAMIC_MINOR; snprintf(vi->name, sizeof(vi->name), "vop_virtio%d", vpdev->index); mdev->nam...
0
51,486
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GLES2DecoderImpl::DoGetBooleanv(GLenum pname, GLboolean* params) { DCHECK(params); GLsizei num_written = 0; if (GetNumValuesReturnedForGLGet(pname, &num_written)) { scoped_ptr<GLint[]> values(new GLint[num_written]); if (!state_.GetStateAsGLint(pname, values.get(), &num_written)) { GetHel...
0
120,816
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static gboolean cosine_check_file_type(wtap *wth, int *err, gchar **err_info) { char buf[COSINE_LINE_LENGTH]; gsize reclen; guint line; buf[COSINE_LINE_LENGTH-1] = '\0'; for (line = 0; line < COSINE_HEADER_LINES_TO_CHECK; line++) { if (file_gets(buf, COSINE_LINE_LENGTH, wth->fh) == NULL) { /* EOF or e...
0
51,770
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void AutofillPopupViewViews::CreateChildViews() { RemoveAllChildViews(true /* delete_children */); int set_size = controller_->GetLineCount(); for (int i = 0; i < set_size; ++i) { AddChildView(new AutofillPopupChildView(controller_->GetSuggestionAt(i), set_si...
0
130,587
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: eval_condition(uschar *s, BOOL *resetok, BOOL *yield) { BOOL testfor = TRUE; BOOL tempcond, combined_cond; BOOL *subcondptr; BOOL sub2_honour_dollar = TRUE; int i, rc, cond_type, roffset; int_eximarith_t num[2]; struct stat statbuf; uschar name[256]; uschar *sub[10]; const pcre *re; const uschar *rerror; for (;...
1
165,190
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void customLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); V8TestObjectPython::customLongAttributeAttributeGetterCustom(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution")...
0
122,245
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void fixup_vary(request_rec *r) { apr_array_header_t *varies; varies = apr_array_make(r->pool, 5, sizeof(char *)); /* Extract all Vary fields from the headers_out, separate each into * its comma-separated fieldname values, and then add them to varies * if not already present in the ...
0
43,631
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int sc_valid_oid(const struct sc_object_id *oid) { int ii; if (!oid) return 0; if (oid->value[0] == -1 || oid->value[1] == -1) return 0; if (oid->value[0] > 2 || oid->value[1] > 39) return 0; for (ii=0;ii<SC_MAX_OBJECT_ID_OCTETS;ii++) if (oid->value[ii]) break; if (ii==SC_MAX_OBJECT_ID_OCTETS) ...
0
78,862
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: kdc_process_for_user(kdc_realm_t *kdc_active_realm, krb5_pa_data *pa_data, krb5_keyblock *tgs_session, krb5_pa_s4u_x509_user **s4u_x509_user, const char **status) { krb5_error_code code; krb5_pa_for_user ...
0
75,479
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int connectSocketNative(JNIEnv *env, jobject object, jbyteArray address, jint type, jbyteArray uuidObj, jint channel, jint flag) { jbyte *addr = NULL, *uuid = NULL; int socket_fd; bt_status_t status; if (!sBluetoothSocketInterface) return -1; addr = env->GetB...
0
163,672
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: g_NPN_GetURL(NPP instance, const char *url, const char *target) { if (!thread_check()) { npw_printf("WARNING: NPN_GetURL not called from the main thread\n"); return NPERR_INVALID_INSTANCE_ERROR; } if (instance == NULL) return NPERR_INVALID_INSTANCE_ERROR; PluginInstance *plugin = PLUGIN_INSTANCE(inst...
0
27,045
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ChromotingInstance::NotifyClientDimensions(int width, int height) { if (!IsConnected()) { return; } protocol::ClientDimensions client_dimensions; client_dimensions.set_width(width); client_dimensions.set_height(height); host_connection_->host_stub()->NotifyClientDimensions(client_dimensions);...
0
102,342
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void spl_array_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ { spl_array_it *iterator = (spl_array_it *)iter; zend_user_it_invalidate_current(iter TSRMLS_CC); zval_ptr_dtor((zval**)&iterator->intern.it.data); efree(iterator); } /* }}} */ Commit Message: CWE ID:
0
12,362
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int wc_ecc_cmp_param(const char* curveParam, const byte* param, word32 paramSz) { int err = MP_OKAY; mp_int a, b; if (param == NULL || curveParam == NULL) return BAD_FUNC_ARG; if ((err = mp_init_multi(&a, &b, NULL, NULL, NULL, NULL)) != MP_OKAY) ...
0
81,851
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: string_num_dots(const char *s) { int count = 0; while ((s = strchr(s, '.'))) { s++; count++; } return count; } Commit Message: evdns: fix searching empty hostnames From #332: Here follows a bug report by **Guido Vranken** via the _Tor bug bounty program_. Please credit Guido accordingly. ## Bug rep...
0
70,702
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static unsigned char *DecodeImage(Image *blob,Image *image, size_t bytes_per_line,const unsigned int bits_per_pixel,size_t *extent, ExceptionInfo *exception) { MagickSizeType number_pixels; register ssize_t i; register unsigned char *p, *q; size_t bytes_per_pixel, length, ...
0
74,048
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int compact_input_order(void) { int i; dbg_printf("\nCompacting element input order: %u elements\n", cache.input_count); for ( i=0; i< cache.input_count; i++ ) { dbg_printf("%i: type: %u, length: %u\n", i, cache.input_order[i].type, cache.input_order[i].length); if ( (cache.input_order[i].typ...
0
88,781
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ResourceDispatcherHostImpl::ResourceDispatcherHostImpl() : download_file_manager_(new DownloadFileManager(NULL)), save_file_manager_(new SaveFileManager()), request_id_(-1), ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), ALLOW_THIS_IN_INITIALIZER_LIST(ssl_delegate_weak_factory...
1
170,991
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MessageLoop::MessageLoop(std::unique_ptr<MessagePump> pump) : MessageLoop(TYPE_CUSTOM, BindOnce(&ReturnPump, Passed(&pump))) { BindToCurrentThread(); } Commit Message: Introduce RunLoop::Type::NESTABLE_TASKS_ALLOWED to replace MessageLoop::ScopedNestableTaskAllower. (as well as MessageLoop::SetNestableTas...
0
126,547
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SPL_METHOD(SplObjectStorage, addAll) { zval *obj; spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis()); spl_SplObjectStorage *other; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, spl_ce_SplObjectStorage) == FAILURE) { return; } other = Z_SPLOBJSTORAGE_P(obj); spl_object_storage_addall(i...
0
73,671
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: status_t OMXNodeInstance::enableNativeBuffers( OMX_U32 portIndex, OMX_BOOL graphic, OMX_BOOL enable) { Mutex::Autolock autoLock(mLock); CLOG_CONFIG(enableNativeBuffers, "%s:%u%s, %d", portString(portIndex), portIndex, graphic ? ", graphic" : "", enable); OMX_STRING name = ...
1
173,385
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TestLifecycleUnit::TestLifecycleUnit(content::Visibility visibility) : LifecycleUnitBase(visibility) {} Commit Message: Connect the LocalDB to TabManager. Bug: 773382 Change-Id: Iec8fe5226ee175105d51f300f30b4865478ac099 Reviewed-on: https://chromium-review.googlesource.com/1118611 Commit-Queue: Sébastien Ma...
0
132,181
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int is_number(char *p) { while (*p) { if (!isdigit(*p)) return FALSE; ++p; } return TRUE; } Commit Message: DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f3597b691b63bc0bf46084833 (cherry picked from commit bbe98b40cda082024b669fa508931042eed18f82) CWE ID:
0
159,802
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static char *MakeNewMapValue(STRING2PTR value, const char *mapstr) { char *ptr; char *newtitle = NULL; StrAllocCopy(newtitle, "["); StrAllocCat(newtitle, mapstr); /* ISMAP or USEMAP */ if (verbose_img && non_empty(value[HTML_IMG_SRC])) { StrAllocCat(newtitle, ":"); ptr = strrchr(value[HTML_...
0
59,018
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags) { /* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */ if (png_ptr != NULL) png_ptr->asm_flags = 0; PNG_UNUSED(asm_flags) /* Quiet the compiler */ } Commit Message: third_party/libpng: update to 1.2.54 TBR=darin@chrom...
0
131,393
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: InputMsgWatcher::~InputMsgWatcher() { render_widget_host_->RemoveInputEventObserver(this); } Commit Message: Apply ExtensionNavigationThrottle filesystem/blob checks to all frames. BUG=836858 Change-Id: I34333a72501129fd40b5a9aa6378c9f35f1e7fc2 Reviewed-on: https://chromium-review.googlesource.com/1028511 Re...
0
156,227
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void delete_item(struct pppoe_net *pn, __be16 sid, char *addr, int ifindex) { write_lock_bh(&pn->hash_lock); __delete_item(pn, sid, addr, ifindex); write_unlock_bh(&pn->hash_lock); } Commit Message: net: rework recvmsg handler msg_name and msg_namelen logic This patch now always passes msg...
0
40,272
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void cJSON_AddItemToObject( cJSON *object, const char *string, cJSON *item ) { if ( ! item ) return; if ( item->string ) cJSON_free( item->string ); item->string = cJSON_strdup( string ); cJSON_AddItemToArray( object, item ); } Commit Message: Fix a buffer overflow / heap corruption issue that could occu...
1
167,268
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct fsnotify_event *inotify_merge(struct list_head *list, struct fsnotify_event *event) { struct fsnotify_event_holder *last_holder; struct fsnotify_event *last_event; /* and the list better be locked by something too */ spin_lock(&event->lock); last_holder = list_entry(list->prev, struc...
0
27,529
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Document::CloneDataFromDocument(const Document& other) { SetCompatibilityMode(other.GetCompatibilityMode()); SetEncodingData(other.encoding_data_); SetContextFeatures(other.GetContextFeatures()); SetSecurityOrigin(other.GetSecurityOrigin()->IsolatedCopy()); SetMimeType(other.contentType()); } Comm...
0
129,621
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LayoutSize RenderBox::topLeftLocationOffset() const { RenderBlock* containerBlock = containingBlock(); if (!containerBlock || containerBlock == this) return locationOffset(); LayoutRect rect(frameRect()); containerBlock->flipForWritingMode(rect); // FIXME: This is wrong if we are an absol...
0
116,616
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: size_t ZSTD_compressBound(size_t srcSize) { return ZSTD_COMPRESSBOUND(srcSize); } Commit Message: fixed T36302429 CWE ID: CWE-362
0
90,016
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static size_t sizeForShareableElementDataWithAttributeCount(unsigned count) { return sizeof(ShareableElementData) + sizeof(Attribute) * count; } Commit Message: Set Attr.ownerDocument in Element#setAttributeNode() Attr objects can move across documents by setAttributeNode(). So It needs to reset ownerDocume...
0
112,407
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HTMLHeadElement* Document::head() { Node* de = documentElement(); if (!de) return 0; for (Node* e = de->firstChild(); e; e = e->nextSibling()) if (e->hasTagName(headTag)) return static_cast<HTMLHeadElement*>(e); return 0; } Commit Message: Unreviewed, rolling out r14...
0
105,530
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: double AudioTrack::GetSamplingRate() const { return m_rate; } Commit Message: external/libvpx/libwebm: Update snapshot Update libwebm snapshot. This update contains security fixes from upstream. Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5f2b BUG=23167726 Change-Id: Id3e140e7b31ae11294724b1ecfe2e...
0
160,794
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ChromeContentBrowserClient::AdjustUtilityServiceProcessCommandLine( const service_manager::Identity& identity, base::CommandLine* command_line) { #if defined(OS_CHROMEOS) bool copy_switches = false; if (identity.name() == ash::mojom::kServiceName) { copy_switches = true; command_line->App...
0
142,581
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void ap_device_release(struct device *dev) { struct ap_device *ap_dev = to_ap_dev(dev); kfree(ap_dev); } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a c...
0
47,589
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mark_source_chains(const struct xt_table_info *newinfo, unsigned int valid_hooks, void *entry0) { unsigned int hook; /* No recursion; use packet counter to save back ptrs (reset to 0 as we leave), and comefrom to save source hook bitmask */ for (hook = 0; hook < NF_INET_NUMHOOKS; hook++) { unsigned...
1
167,370
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void rehighlight_forbidden_words(int page, GtkTextView *tev) { GList *forbidden_words = load_words_from_file(FORBIDDEN_WORDS_BLACKLLIST); GList *allowed_words = load_words_from_file(FORBIDDEN_WORDS_WHITELIST); highligh_words_in_textview(page, tev, forbidden_words, allowed_words, /*case sensitiv...
0
42,854
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: off_t size_autodetect(int fhandle) { off_t es; u64 bytes; struct stat stat_buf; int error; #ifdef HAVE_SYS_MOUNT_H #ifdef HAVE_SYS_IOCTL_H #ifdef BLKGETSIZE64 DEBUG("looking for export size with ioctl BLKGETSIZE64\n"); if (!ioctl(fhandle, BLKGETSIZE64, &bytes) && bytes) { return (off_t)bytes; } #endif /...
0
18,456
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void perf_branch_stack_sched_in(struct task_struct *prev, struct task_struct *task) { struct perf_cpu_context *cpuctx; struct pmu *pmu; unsigned long flags; /* no need to flush branch stack if not changing task */ if (prev == task) return; local_irq_save(flags); rcu_read_lock(); li...
0
31,921
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool InspectorPageAgent::applyViewportStyleOverride(StyleResolver* resolver) { if (!m_deviceMetricsOverridden || !m_emulateViewportEnabled) return false; RefPtr<StyleSheetContents> styleSheet = StyleSheetContents::create(CSSParserContext(UASheetMode)); styleSheet->parseString(String(viewportA...
0
115,248