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 MagickBooleanType WriteMATImage(const ImageInfo *image_info,Image *image) { ExceptionInfo *exception; ssize_t y; unsigned z; const PixelPacket *p; unsigned int status; int logging; size_t DataSize; char padding; char MATLAB_HDR[0x80]; time_t current_time; struct tm local_time; ...
0
71,594
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 RenderFrameImpl::willSendRequest( blink::WebLocalFrame* frame, unsigned identifier, blink::WebURLRequest& request, const blink::WebURLResponse& redirect_response) { DCHECK(!frame_ || frame_ == frame); if (request.url().isEmpty()) return; if (request.firstPartyForCookies().isEmpty()...
0
123,274
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 prism2_tx_timeout(struct net_device *dev) { struct hostap_interface *iface; local_info_t *local; struct hfa384x_regs regs; iface = netdev_priv(dev); local = iface->local; printk(KERN_WARNING "%s Tx timed out! Resetting card\n", dev->name); netif_stop_queue(local->dev); local->func->read_reg...
0
24,126
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 enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF* tif, TIFFDirEntry* direntry, uint16** value) { enum TIFFReadDirEntryErr err; uint32 count; void* origdata; uint16* data; switch (direntry->tdir_type) { case TIFF_BYTE: case TIFF_SBYTE: case TIFF_SHORT: case TIFF_SSHORT: case TIFF_LON...
0
70,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: static int read_channel_info (WavpackContext *wpc, WavpackMetadata *wpmd) { int bytecnt = wpmd->byte_length, shift = 0, mask_bits; unsigned char *byteptr = (unsigned char *)wpmd->data; uint32_t mask = 0; if (!bytecnt || bytecnt > 7) return FALSE; if (!wpc->config.num_channels) { ...
0
75,627
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 alpha_pmu_read(struct perf_event *event) { struct hw_perf_event *hwc = &event->hw; alpha_perf_event_update(event, hwc, hwc->idx, 0); } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context...
0
25,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: void gss_krb5int_lib_fini(void) { #ifndef _GSS_STATIC_LINK if (!INITIALIZER_RAN(gss_krb5int_lib_init) || PROGRAM_EXITING()) { # ifdef SHOW_INITFINI_FUNCS printf("gss_krb5int_lib_fini: skipping\n"); # endif return; } #endif #ifdef SHOW_INITFINI_FUNCS printf("gss_krb5int_lib_fini\n"); #e...
0
43,751
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: acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp) { acpi_cpu_flags flags; spin_lock_irqsave(lockp, flags); return flags; } Commit Message: acpi: Disable ACPI table override if securelevel is set From the kernel documentation (initrd_table_override.txt): If the ACPI_INITRD_TABLE_OVERRIDE compile opt...
0
53,833
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 f_midi_transmit_byte(struct usb_request *req, struct gmidi_in_port *port, uint8_t b) { uint8_t p[4] = { port->cable << 4, 0, 0, 0 }; uint8_t next_state = STATE_INITIAL; switch (b) { case 0xf8 ... 0xff: /* System Real-Time Messages */ p[0] |= 0x0f; p[1] = b; next_state = port->state; ...
0
91,936
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 l2cap_sock_clear_timer(struct sock *sk) { BT_DBG("sock %p state %d", sk, sk->sk_state); sk_stop_timer(sk, &sk->sk_timer); } Commit Message: Bluetooth: Add configuration support for ERTM and Streaming mode Add support to config_req and config_rsp to configure ERTM and Streaming mode. If the remote ...
0
58,964
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 Stop() { if (loading()) { data_provider()->DidFail(response_generator_->GenerateError()); base::RunLoop().RunUntilIdle(); } data_source_->Stop(); base::RunLoop().RunUntilIdle(); } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer ha...
0
144,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: xsltCheckExtPrefix(xsltStylesheetPtr style, const xmlChar * URI) { #ifdef XSLT_REFACTORED if ((style == NULL) || (style->compCtxt == NULL) || (XSLT_CCTXT(style)->inode == NULL) || (XSLT_CCTXT(style)->inode->extElemNs == NULL)) return (0); /* * Lookup the extension namespaces registered *...
0
156,665
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 bool mmu_spte_update(u64 *sptep, u64 new_spte) { u64 old_spte = *sptep; bool ret = false; WARN_ON(!is_rmap_spte(new_spte)); if (!is_shadow_present_pte(old_spte)) { mmu_spte_set(sptep, new_spte); return ret; } if (!spte_has_volatile_bits(old_spte)) __update_clear_spte_fast(sptep, new_spte); ...
0
37,542
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_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) { png_debug(1, "in png_handle_IEND"); if (!(png_ptr->mode & PNG_HAVE_IHDR) || !(png_ptr->mode & PNG_HAVE_IDAT)) { png_error(png_ptr, "No image in file"); } png_ptr->mode |= (PNG_AFTER_IDAT | PNG_HAVE_IEND); if ...
0
131,387
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 U32 ZSTD_equivalentLdmParams(ldmParams_t ldmParams1, ldmParams_t ldmParams2) { return (!ldmParams1.enableLdm && !ldmParams2.enableLdm) || (ldmParams1.enableLdm == ldmParams2.enableLdm && ldmParams1.hashLog == ldmParams2.hashLog && l...
0
90,055
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 AppCacheGroup::ScheduleUpdateRestart(int delay_ms) { DCHECK(restart_update_task_.IsCancelled()); restart_update_task_.Reset( base::Bind(&AppCacheGroup::RunQueuedUpdates, this)); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, restart_update_task_.callback(), base::Tim...
0
145,415
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 HTMLMediaElement::paused() const { return m_paused; } Commit Message: [Blink>Media] Allow autoplay muted on Android by default There was a mistake causing autoplay muted is shipped on Android but it will be disabled if the chromium embedder doesn't specify content setting for "AllowAutoplay" preference. ...
0
128,857
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 int nfs4_server_supports_acls(struct nfs_server *server) { return (server->caps & NFS_CAP_ACLS) && (server->acl_bitmask & ACL4_SUPPORT_ALLOW_ACL) && (server->acl_bitmask & ACL4_SUPPORT_DENY_ACL); } Commit Message: Fix length of buffer copied in __nfs4_get_acl_uncached _copy_from_pages() used ...
0
20,026
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 __exit asymmetric_key_cleanup(void) { unregister_key_type(&key_type_asymmetric); } Commit Message: KEYS: Remove key_type::match in favour of overriding default by match_preparse A previous patch added a ->match_preparse() method to the key type. This is allowed to override the function called by t...
0
69,401
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 ssh2_pkt_construct(Ssh ssh, struct Packet *pkt) { int cipherblk, maclen, padding, unencrypted_prefix, i; if (ssh->logctx) ssh2_log_outgoing_packet(ssh, pkt); if (ssh->bare_connection) { /* * Trivial packet construction for the bare connection * protocol. ...
0
8,541
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: FromMojom(media::mojom::VideoCaptureBufferType input, media::VideoCaptureBufferType* output) { switch (input) { case media::mojom::VideoCaptureBufferType::kSharedMemory: *output = media::VideoCaptureBufferType::kSharedMemory; return true; case media::mojom::VideoCaptureBuff...
0
140,239
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 do_truncation(struct ubifs_info *c, struct inode *inode, const struct iattr *attr) { int err; struct ubifs_budget_req req; loff_t old_size = inode->i_size, new_size = attr->ia_size; int offset = new_size & (UBIFS_BLOCK_SIZE - 1), budgeted = 1; struct ubifs_inode *ui = ubifs_inode(inode); dbg...
0
46,408
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 file_close(jas_stream_obj_t *obj) { jas_stream_fileobj_t *fileobj; JAS_DBGLOG(100, ("file_close(%p)\n", obj)); fileobj = JAS_CAST(jas_stream_fileobj_t *, obj); int ret; ret = close(fileobj->fd); if (fileobj->flags & JAS_STREAM_FILEOBJ_DELONCLOSE) { unlink(fileobj->pathname); } jas_free(fileob...
0
67,901
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 TransportTexture::CreateTextures( int n, int width, int height, Format format, std::vector<int>* textures, Task* done_task) { output_textures_ = textures; DCHECK(!create_task_.get()); create_task_.reset(done_task); bool ret = sender_->Send(new GpuTransportTextureHostMsg_CreateTextures( ...
0
98,474
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: ScopedRenderBufferBinder::ScopedRenderBufferBinder(GLES2DecoderImpl* decoder, GLuint id) : decoder_(decoder) { ScopedGLErrorSuppressor suppressor(decoder_); glBindRenderbufferEXT(GL_RENDERBUFFER, id); } Commit Message: Revert "Revert 100494 - Fix bug in ...
0
99,312
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: IV_API_CALL_STATUS_T impeg2d_api_reset(iv_obj_t *ps_dechdl, void *pv_api_ip, void *pv_api_op) { dec_state_t *ps_dec_state; dec_state_multi_core_t *ps_dec_state_multi_core; UNUSED(pv_api_ip); impeg2d_ctl_reset_op_t *s_ctl_reset_op = (impeg2d_ctl_reset_op_t *)pv_api_op; WORD32 i4_num_threads; ps_...
0
162,592
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: AXObject* AXNodeObject::rawFirstChild() const { if (!getNode()) return 0; Node* firstChild = getNode()->firstChild(); if (!firstChild) return 0; return axObjectCache().getOrCreate(firstChild); } Commit Message: Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Revi...
0
127,205
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 SizeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); V8SetReturnValueUnsigned(info, impl->size()); } Commit Message: bindings: Support "attribute FrozenArray<T>?" Adds a quick hac...
0
135,172
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 GetCSITransitionType(WebNavigationType nav_type) { switch (nav_type) { case blink::WebNavigationTypeLinkClicked: case blink::WebNavigationTypeFormSubmitted: case blink::WebNavigationTypeFormResubmitted: return kTransitionLink; case blink::WebNavigationTypeBackForwa...
0
124,980
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: const gfx::ImageSkia PageInfoUI::GetPermissionIcon(const PermissionInfo& info, SkColor related_text_color) { const gfx::VectorIcon* icon = &gfx::kNoneIcon; switch (info.type) { case CONTENT_SETTINGS_TYPE_COOKIES: icon = &kCookieIcon; break; ...
0
138,022
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: __sum16 __skb_checksum_complete(struct sk_buff *skb) { return __skb_checksum_complete_head(skb, skb->len); } Commit Message: net: fix infinite loop in __skb_recv_datagram() Tommi was fuzzing with trinity and reported the following problem : commit 3f518bf745 (datagram: Add offset argument to __skb_recv_datagr...
0
33,832
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: ShellContentBrowserClient::GetDevToolsManagerDelegate() { return new ShellDevToolsManagerDelegate(browser_context()); } Commit Message: content: Rename webkit_test_helpers.{cc,h} to blink_test_helpers.{cc,h} Now that webkit/ is gone, we are preparing ourselves for the merge of third_party/WebKit into //blink....
0
123,472
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 inet_csk_bind_conflict(const struct sock *sk, const struct inet_bind_bucket *tb, bool relax, bool reuseport_ok) { struct sock *sk2; bool reuse = sk->sk_reuse; bool reuseport = !!sk->sk_reuseport && reuseport_ok; kuid_t uid = sock_i_uid((struct sock *)sk); /* * Unlike other sk lookup...
0
66,114
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 RenderThread::OnNetworkStateChanged(bool online) { EnsureWebKitInitialized(); WebNetworkStateNotifier::setOnLine(online); } Commit Message: DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://codereview.chromium.org/7461019 git-svn-id: svn://svn.chromium.org/chrome/tr...
0
98,882
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: v8::Local<v8::Value> PrivateScriptRunner::runDOMAttributeGetter( ScriptState* scriptState, ScriptState* scriptStateInUserScript, const char* className, const char* attributeName, v8::Local<v8::Value> holder) { v8::Isolate* isolate = scriptState->isolate(); v8::Local<v8::Object> classObject...
0
138,280
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 __blk_rq_map_user_iov(struct request *rq, struct rq_map_data *map_data, struct iov_iter *iter, gfp_t gfp_mask, bool copy) { struct request_queue *q = rq->q; struct bio *bio, *orig_bio; int ret; if (copy) bio = bio_copy_user_iov(q, map_data, iter, gfp_mask); else bio = bio_map_user_iov(q, ...
0
48,153
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 module_slot_match(struct module *module, int idx) { int match = 1; #ifdef MODULE const char *s1, *s2; if (!module || !*module->name || !slots[idx]) return 0; s1 = module->name; s2 = slots[idx]; if (*s2 == '!') { match = 0; /* negative match */ s2++; } /* compare module name strings * ...
0
36,510
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 coroutine_fn v9fs_complete_renameat(V9fsPDU *pdu, int32_t olddirfid, V9fsString *old_name, int32_t newdirfid, V9fsString *new_name) { int err = 0; V9fsSta...
0
1,481
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 GoForward(TabContents* contents) { controller().GoForward(); } Commit Message: chromeos: fix bug where "aw snap" page replaces first tab if it was a NTP when closing window with > 1 tab. BUG=chromium-os:12088 TEST=verify bug per bug report. Review URL: http://codereview.chromium.org/6882058 git-sv...
0
98,163
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 AppLauncherHandler::OnExtensionPreferenceChanged() { base::DictionaryValue dictionary; FillAppDictionary(&dictionary); web_ui()->CallJavascriptFunction("ntp.appsPrefChangeCallback", dictionary); } Commit Message: Remove --disable-app-shims. App shims have been enabled by default for 3 milestones (sin...
0
110,343
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 WebContentsImpl::SetHasPersistentVideo(bool has_persistent_video) { if (has_persistent_video_ == has_persistent_video) return; has_persistent_video_ = has_persistent_video; NotifyPreferencesChanged(); media_web_contents_observer()->RequestPersistentVideo(has_persistent_video); } Commit Message:...
0
135,880
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 evict_inodes(struct super_block *sb) { struct inode *inode, *next; LIST_HEAD(dispose); again: spin_lock(&sb->s_inode_list_lock); list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) { if (atomic_read(&inode->i_count)) continue; spin_lock(&inode->i_lock); if (inode->i_state & (I_NEW ...
0
79,825
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 map_decision(u16 tclass, struct av_decision *avd, int allow_unknown) { if (tclass < current_mapping_size) { unsigned i, n = current_mapping[tclass].num_perms; u32 result; for (i = 0, result = 0; i < n; i++) { if (avd->allowed & current_mapping[tclass].perms[i]) result |= 1<<i; if...
0
39,259
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: GF_Err gf_isom_text_dump(GF_ISOFile *the_file, u32 track, FILE *dump, GF_TextDumpType dump_type) { switch (dump_type) { case GF_TEXTDUMPTYPE_SVG: return gf_isom_dump_svg_track(the_file, track, dump); case GF_TEXTDUMPTYPE_SRT: return gf_isom_dump_srt_track(the_file, track, dump); case GF_TEXTDUMPTYPE_TTXT:...
0
80,746
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 bta_hl_co_get_tx_data (UINT8 app_id, tBTA_HL_MDL_HANDLE mdl_handle, UINT16 buf_size, UINT8 *p_buf, UINT16 evt) { UINT8 app_idx, mcl_idx, mdl_idx; btif_hl_mdl_cb_t *p_dcb; tBTA_HL_STATUS status = BTA_HL_STATUS_FAIL; BTIF_TRACE_DEBUG("%s app_id=%d mdl_handle=0x%x buf_...
0
158,522
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: strpbrk_or_eos (const char *s, const char *accept) { char *p = strpbrk (s, accept); if (!p) p = strchr (s, '\0'); return p; } Commit Message: CWE ID: CWE-93
0
8,699
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 TIFFUnmapBlob(thandle_t image,tdata_t base,toff_t size) { (void) image; (void) base; (void) size; } Commit Message: https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31161 CWE ID: CWE-119
0
69,086
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: inline void FrameView::forceLayoutParentViewIfNeeded() { RenderPart* ownerRenderer = m_frame->ownerRenderer(); if (!ownerRenderer || !ownerRenderer->frame()) return; RenderBox* contentBox = embeddedContentBox(); if (!contentBox) return; RenderSVGRoot* svgRoot = toRenderSVGRoo...
0
119,836
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: xmlXPtrMatchString(const xmlChar *string, xmlNodePtr start, int startindex, xmlNodePtr *end, int *endindex) { xmlNodePtr cur; int pos; /* 0 based */ int len; /* in bytes */ int stringlen; /* in bytes */ int match; if (string == NULL) return(-1); if (start == NULL) retur...
0
109,066
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 ff_amf_write_object_start(uint8_t **dst) { bytestream_put_byte(dst, AMF_DATA_TYPE_OBJECT); } Commit Message: avformat/rtmppkt: Convert ff_amf_get_field_value() to bytestream2 Fixes: out of array accesses Found-by: JunDong Xie of Ant-financial Light-Year Security Lab Signed-off-by: Michael Niedermayer ...
0
63,206
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 RenderBlockFlow::addOverflowFromFloats() { if (!m_floatingObjects) return; const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); FloatingObjectSetIterator end = floatingObjectSet.end(); for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) {...
0
116,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: void SetString(DictionaryValue* strings, const char* name, int resource_id) { strings->SetString(name, l10n_util::GetStringUTF16(resource_id)); } Commit Message: cros: The next 100 clang plugin errors. BUG=none TEST=none TBR=dpolukhin Review URL: http://codereview.chromium.org/7022008 git-svn-id: svn://svn....
0
101,513
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_dac(struct task_struct *child, struct ppc_hw_breakpoint *bp_info) { int byte_enable = (bp_info->condition_mode >> PPC_BREAKPOINT_CONDITION_BE_SHIFT) & 0xf; int condition_mode = bp_info->condition_mode & PPC_BREAKPOINT_CONDITION_MODE; int slot; if (byte_enable && (condition_mode == 0)) ...
0
25,490
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: parse_file (FILE* input_file, char* directory, char *body_filename, char *body_pref, int flags) { uint32 d; uint16 key; Attr *attr = NULL; File *file = NULL; int rtf_size = 0, html_size = 0; MessageBody body; memset (&body, '\0', sizeof (MessageBody)); /* store the prog...
1
168,353
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: lexer_parse_string (parser_context_t *context_p) /**< context */ { uint8_t str_end_character = context_p->source_p[0]; const uint8_t *source_p = context_p->source_p + 1; const uint8_t *string_start_p = source_p; const uint8_t *source_end_p = context_p->source_end_p; parser_line_counter_t line = context_...
0
64,619
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: Eina_Bool ewk_frame_editable_get(const Evas_Object* ewkFrame) { EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, false); EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false); return smartData->editable; } Commit Message: [EFL] fast/frames/frame-crash-with-page-cache.html is crashing https://bugs.we...
0
107,643
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: XmlConfigParser::~XmlConfigParser() {} Commit Message: Use install_static::GetAppGuid instead of the hardcoded string in BrandcodeConfigFetcher. Bug: 769756 Change-Id: Ifdcb0a5145ffad1d563562e2b2ea2390ff074cdc Reviewed-on: https://chromium-review.googlesource.com/1213178 Reviewed-by: Dominic Battré <battre@chro...
0
132,931
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::OnDidAddContentSecurityPolicies( const std::vector<ContentSecurityPolicy>& policies) { TRACE_EVENT1("navigation", "RenderFrameHostImpl::OnDidAddContentSecurityPolicies", "frame_tree_node", frame_tree_node_->frame_tree_node_id()); std::vector<Content...
0
139,346
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::AppendExtraCommandLineSwitches( CommandLine* command_line, int child_process_id) { #if defined(USE_LINUX_BREAKPAD) if (IsCrashReporterEnabled()) { command_line->AppendSwitchASCII(switches::kEnableCrashReporter, child_process_logging::GetClientId() + "," + base::G...
0
115,726
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 send_stream_error(h2o_http2_conn_t *conn, uint32_t stream_id, int errnum) { assert(stream_id != 0); assert(conn->state < H2O_HTTP2_CONN_STATE_IS_CLOSING); h2o_http2_encode_rst_stream_frame(&conn->_write.buf, stream_id, -errnum); h2o_http2_conn_request_write(conn); } Commit Message: h2: use...
0
52,580
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: file_end(struct file *file) { int rc; /* If either of the chunk pointers are set end them here, the IDAT structure * must be deallocated first as it may deallocate the chunk structure. */ if (file->idat != NULL) IDAT_end(&file->idat); if (file->chunk != NULL) chunk_end(&file->chunk); ...
0
160,123
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 avi_probe(AVProbeData *p) { int i; /* check file header */ for (i = 0; avi_headers[i][0]; i++) if (AV_RL32(p->buf ) == AV_RL32(avi_headers[i] ) && AV_RL32(p->buf + 8) == AV_RL32(avi_headers[i] + 4)) return AVPROBE_SCORE_MAX; return 0; } Commit Me...
0
64,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 *videobuf_to_vmalloc (struct videobuf_buffer *buf) { struct videbuf_vmalloc_memory *mem=buf->priv; BUG_ON (!mem); MAGIC_CHECK(mem->magic,MAGIC_VMAL_MEM); return mem->vmalloc; } Commit Message: V4L/DVB (6751): V4L: Memory leak! Fix count in videobuf-vmalloc mmap This is pretty serious bug. map->count...
0
74,710
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 MSG_LookaheadByte( msg_t *msg ) { const int bloc = Huff_getBloc(); const int readcount = msg->readcount; const int bit = msg->bit; int c = MSG_ReadByte(msg); Huff_setBloc(bloc); msg->readcount = readcount; msg->bit = bit; return c; } Commit Message: Fix/improve buffer overflow in MSG_ReadBits/MSG_Wri...
0
63,142
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 AppCacheUpdateJob::URLFetcher::ConsumeResponseData(int bytes_read) { DCHECK_GT(bytes_read, 0); switch (fetch_type_) { case MANIFEST_FETCH: case MANIFEST_REFETCH: manifest_data_.append(buffer_->data(), bytes_read); break; case URL_FETCH: case MASTER_ENTRY_FETCH: DCHECK(re...
0
124,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: Frame* V8Proxy::retrieveFrame(v8::Handle<v8::Context> context) { DOMWindow* window = retrieveWindow(context); Frame* frame = window->frame(); if (frame && frame->domWindow() == window) return frame; return 0; } Commit Message: [V8] Pass Isolate to throwNotEnoughArgumentsError() https://bu...
0
109,754
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 rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc **d) { struct sock *sk, *parent; bdaddr_t src, dst; int result = 0; BT_DBG("session %p channel %d", s, channel); rfcomm_session_getaddr(s, &src, &dst); /* Check if we have socket listening on channel */ parent = rfcomm_get_so...
0
30,723
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 xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb) { skb_push(skb, -skb_network_offset(skb)); return 0; } Commit Message: tunnels: fix netns vs proto registration ordering Same stuff as in ip_gre patch: receive hook can be called before netns setup is done, oopsing in net_generic(). Si...
0
27,471
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 crc32_final(struct shash_desc *desc, u8 *out) { u32 *crcp = shash_desc_ctx(desc); *(__le32 *)out = cpu_to_le32p(crcp); return 0; } 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 au...
0
47,191
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: ChromeExtensionWebContentsObserver::ChromeExtensionWebContentsObserver( content::WebContents* web_contents) : ExtensionWebContentsObserver(web_contents) {} Commit Message: This patch implements a mechanism for more granular link URL permissions (filtering on scheme/host). This fixes the bug that allowed ...
0
125,112
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 extract_sockaddr(char *url, char **sockaddr_url, char **sockaddr_port) { char *url_begin, *url_end, *ipv6_begin, *ipv6_end, *port_start = NULL; char url_address[256], port[6]; int url_len, port_len = 0; *sockaddr_url = url; url_begin = strstr(url, "//"); if (!url_begin) url_begin = url; else url_...
1
166,304
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 res_unpack(vorbis_info_residue *info, vorbis_info *vi,oggpack_buffer *opb){ int j,k; codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; memset(info,0,sizeof(*info)); info->type=oggpack_read(opb,16); if(info->type>2 || info->type<0)goto errout; info->begin=oggpack_read...
1
173,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: SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5) { switch (option) { case KEYCTL_GET_KEYRING_ID: return keyctl_get_keyring_ID((key_serial_t) arg2, (int) arg3); case KEYCTL_JOIN_SESSION_KEYRING: return keyctl_join_session_k...
0
60,233
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: irc_server_get_channel_count (struct t_irc_server *server) { int count; struct t_irc_channel *ptr_channel; count = 0; for (ptr_channel = server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) { if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL) co...
0
3,480
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 openssl_print_object_sn(const char *s) { } Commit Message: fixed out of bounds reads Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting security fixes. CWE ID: CWE-125
0
78,116
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: PHP_FUNCTION(linkinfo) { char *link; char *dirname; int link_len, dir_len; struct stat sb; int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) { return; } dirname = estrndup(link, link_len); dir_len = php_dirname(dirname, link_len); if (php_check_open_ba...
0
15,247
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 is_xattr_supported() const { return is_xattr_supported_; } Commit Message: Disable setxattr calls from quarantine subsystem on Chrome OS. BUG=733943 Change-Id: I6e743469a8dc91536e180ecf4ff0df0cf427037c Reviewed-on: https://chromium-review.googlesource.com/c/1380571 Commit-Queue: Will Harris <wfh@chromiu...
0
153,437
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: gx_dc_pattern_get_nonzero_comps( const gx_device_color * pdevc_ignored, const gx_device * dev_ignored, gx_color_index * pcomp_bits_ignored ) { return 1; } Commit Message: CWE ID: CWE-704
0
1,677
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 u64 max_vruntime(u64 max_vruntime, u64 vruntime) { s64 delta = (s64)(vruntime - max_vruntime); if (delta > 0) max_vruntime = vruntime; return max_vruntime; } Commit Message: sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie XiuQi and Sargun...
0
92,605
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 handle_task_switch(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); unsigned long exit_qualification; bool has_error_code = false; u32 error_code = 0; u16 tss_selector; int reason, type, idt_v, idt_index; idt_v = (vmx->idt_vectoring_info & VECTORING_INFO_VALID_MASK); idt_index = (...
0
42,670
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 ApplyEdits(BookmarkEditorView::EditorNode* node) { editor_->ApplyEdits(node); } Commit Message: Prevent interpretating userinfo as url scheme when editing bookmarks Chrome's Edit Bookmark dialog formats urls for display such that a url of http://javascript:scripttext@host.com is later converted to ...
0
130,761
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::Abort() { CancelParsing(); CheckCompletedInternal(); } Commit Message: Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea3446283965c7eabab592cbffe223b1cf2bc Back then, we applied fragment focus in LayoutUpdated() which could cause this iss...
0
129,568
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 bt_status_t register_notification_rsp(btrc_event_id_t event_id, btrc_notification_type_t type, btrc_register_notification_t *p_param) { tAVRC_RESPONSE avrc_rsp; CHECK_RC_CONNECTED BTIF_TRACE_EVENT("## %s ## event_id:%s", __FUNCTION__, dump_rc_notification_event_id(event_id)); if (btif_rc_cb.r...
0
158,829
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_NOT( FT_Long* args ) { args[0] = !args[0]; } Commit Message: CWE ID: CWE-476
0
10,637
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: pr_sgr_start_if (char const *s) { if (color_option) pr_sgr_start (s); } Commit Message: CWE ID: CWE-189
0
6,548
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 cmd_env(void *data, const char *input) { RCore *core = (RCore*)data; int ret = true; switch (*input) { case '?': cmd_help_percent (core); break; default: ret = r_core_cmdf (core, "env %s", input); } return ret; } Commit Message: Fix #14990 - multiple quoted command parsing issue ##core ...
0
87,779
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 cdrom_read_cdda(struct cdrom_device_info *cdi, __u8 __user *ubuf, int lba, int nframes) { int ret; if (cdi->cdda_method == CDDA_OLD) return cdrom_read_cdda_old(cdi, ubuf, lba, nframes); retry: /* * for anything else than success and io error, we need to retry */ ret = cdrom_read_cdda_...
0
76,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: void SoundChannel::autoResume() { Mutex::Autolock lock(&mLock); if (mAutoPaused && (mState == PAUSED)) { ALOGV("resume track"); mState = PLAYING; mAutoPaused = false; mAudioTrack->start(); } } Commit Message: DO NOT MERGE SoundPool: add lock for findSample access from SoundPool...
0
161,894
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 start_tty(struct tty_struct *tty) { unsigned long flags; spin_lock_irqsave(&tty->ctrl_lock, flags); if (!tty->stopped || tty->flow_stopped) { spin_unlock_irqrestore(&tty->ctrl_lock, flags); return; } tty->stopped = 0; if (tty->link && tty->link->packet) { tty->ctrl_status &= ~TIOCPKT_STOP; tty-...
0
58,739
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 BROTLI_INLINE int SafeReadCommand(BrotliState* s, BrotliBitReader* br, int* insert_length) { return ReadCommandInternal(1, s, br, insert_length); } Commit Message: Cherry pick underflow fix. BUG=583607 Review URL: https://codereview.chromium.org/1662313002 Cr-Commit-Position: refs/heads/master@{#...
0
133,136
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 ExtensionSystemImpl::InitForRegularProfile(bool extensions_enabled) { DCHECK(!profile_->IsOffTheRecord()); if (user_script_master() || extension_service()) return; // Already initialized. shared_->info_map(); extension_process_manager_.reset(ExtensionProcessManager::Create(profile_)); alarm_...
0
115,926
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 withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { INC_STATS("DOM.TestObj.withScriptExecutionContextAndScriptStateAttributeRaises._set"); TestObj* imp = V8TestObj::toNative(info.Holder()); ...
0
109,644
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: gx_dc_pattern2_equal(const gx_device_color * pdevc1, const gx_device_color * pdevc2) { return pdevc2->type == pdevc1->type && pdevc1->ccolor.pattern == pdevc2->ccolor.pattern; } Commit Message: CWE ID: CWE-704
0
1,713
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: xmlReadIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void *ioctx, const char *URL, const char *encoding, int options) { xmlParserCtxtPtr ctxt; xmlParserInputBufferPtr input; xmlParserInputPtr stream; if (ioread == NULL) return (NULL); xmlInitParser(); i...
0
59,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: void mbedtls_ecp_point_init( mbedtls_ecp_point *pt ) { if( pt == NULL ) return; mbedtls_mpi_init( &pt->X ); mbedtls_mpi_init( &pt->Y ); mbedtls_mpi_init( &pt->Z ); } Commit Message: Merge remote-tracking branch 'upstream-restricted/pr/549' into mbedtls-2.7-restricted CWE ID: CWE-200
0
96,583
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 AutofillPopupFooterView::ShouldUseCustomFontWeightForPrimaryInfo( gfx::Font::Weight* font_weight) const { return false; } Commit Message: [Autofill] Remove AutofillPopupViewViews and associated feature. Bug: 906135,831603 Change-Id: I3c982f8b3ffb4928c7c878e74e10113999106499 Reviewed-on: https://chrom...
0
130,578
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 MagickBooleanType MonitorProgress(const char *text, const MagickOffsetType offset,const MagickSizeType extent, void *wand_unused(client_data)) { char message[MagickPathExtent], tag[MagickPathExtent]; const char *locale_message; register char *p; magick_unreferenced(client_dat...
0
89,042
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 __init ecryptfs_init_kthread(void) { int rc = 0; mutex_init(&ecryptfs_kthread_ctl.mux); init_waitqueue_head(&ecryptfs_kthread_ctl.wait); INIT_LIST_HEAD(&ecryptfs_kthread_ctl.req_list); ecryptfs_kthread = kthread_run(&ecryptfs_threadfn, NULL, "ecryptfs-kthread"); if (IS_ERR(ecryptfs_kthread))...
0
55,436
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: IHEVCD_ERROR_T ihevcd_parse_prediction_unit(codec_t *ps_codec, WORD32 x0, WORD32 y0, WORD32 wd, WORD32 ht) { IHEVCD_ERROR_T ret =...
0
162,574
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: WebContentsImpl::CreateThrottlesForNavigation( NavigationHandle* navigation_handle) { return GetContentClient()->browser()->CreateThrottlesForNavigation( navigation_handle); } Commit Message: If JavaScript shows a dialog, cause the page to lose fullscreen. BUG=670135, 550017, 726761, 728276 Review-...
0
135,653