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: FileTransfer::AddDownloadFilenameRemap(char const *source_name,char const *target_name) { if(!download_filename_remaps.IsEmpty()) { download_filename_remaps += ";"; } download_filename_remaps += source_name; download_filename_remaps += "="; download_filename_remaps += target_name; } Commit Message: CWE I...
0
16,560
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 WorkerFetchContext::DispatchWillSendRequest( unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirect_response, const FetchInitiatorInfo& initiator_info) { probe::willSendRequest(global_scope_, identifier, nullptr, request, redirect_...
1
172,476
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 phar_destroy_phar_data(phar_archive_data *phar TSRMLS_DC) /* {{{ */ { if (phar->alias && phar->alias != phar->fname) { pefree(phar->alias, phar->is_persistent); phar->alias = NULL; } if (phar->fname) { pefree(phar->fname, phar->is_persistent); phar->fname = NULL; } if (phar->signature) { pef...
0
4,461
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 BrowserWindowGtk::BookmarkBarStateChanged( BookmarkBar::AnimateChangeType change_type) { MaybeShowBookmarkBar(change_type == BookmarkBar::ANIMATE_STATE_CHANGE); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chro...
0
117,896
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(Handle<JSObject> holder, uint32_t entry, Object* value) { SetImpl(holder->elements(), entry, value); } Commit Message: Backport: Fix Object.entries/values with changing elements Bug: 111274046 Test: m -j proxy_resolver_v8_unittest && adb sync && adb shell \ /data/nativetest64/prox...
0
163,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 long media_device_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct media_devnode *devnode = media_devnode_data(filp); struct media_device *dev = to_media_device(devnode); long ret; switch (cmd) { case MEDIA_IOC_DEVICE_INFO: case MEDIA_IOC_ENUM_ENTITIES: case M...
0
39,313
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: unsigned WebMediaPlayerMS::DroppedFrameCount() const { DCHECK(thread_checker_.CalledOnValidThread()); return compositor_->dropped_frame_count(); } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFromServiceWorker - Has...
0
144,140
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: XML_GetInputContext(XML_Parser parser, int *offset, int *size) { #ifdef XML_CONTEXT_BYTES if (parser == NULL) return NULL; if (parser->m_eventPtr && parser->m_buffer) { if (offset != NULL) *offset = (int)(parser->m_eventPtr - parser->m_buffer); if (size != NULL) *size = (int)(parser-...
0
92,253
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: header_seek (SF_PRIVATE *psf, sf_count_t position, int whence) { switch (whence) { case SEEK_SET : if (position > SIGNED_SIZEOF (psf->header)) { /* Too much header to cache so just seek instead. */ psf_fseek (psf, position, whence) ; return ; } ; if (position > psf->headend) psf-...
1
170,062
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 CLASS remove_zeroes() { unsigned row, col, tot, n, r, c; for (row=0; row < height; row++) for (col=0; col < width; col++) if (BAYER(row,col) == 0) { tot = n = 0; for (r = row-2; r <= row+2; r++) for (c = col-2; c <= col+2; c++) if (r < height && c < width && FC(r,c) == FC(row,col) ...
0
43,367
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_ctcp_display_request (struct t_irc_server *server, time_t date, const char *command, struct t_irc_channel *channel, const char *nick, const char *address, ...
0
66,434
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 impeg2d_get_frm_buf(yuv_buf_t *ps_frm_buf,UWORD8 *pu1_frm,UWORD32 u4_width,UWORD32 u4_height) { UWORD32 u4_luma_size = u4_width * u4_height; UWORD32 u4_chroma_size = (u4_width * u4_height)>>2; ps_frm_buf->pu1_y = pu1_frm; ps_frm_buf->pu1_u = pu1_frm + u4_luma_size; ps_frm_buf->pu1_v = pu1_frm...
0
161,848
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 ExecuteMoveWordLeft(LocalFrame& frame, Event*, EditorCommandSource, const String&) { frame.Selection().Modify(SelectionModifyAlteration::kMove, SelectionModifyDirection::kLeft, ...
0
128,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: bool get_resource_context_called() const { return get_resource_context_called_; } Commit Message: Follow-on fixes and naming changes for https://codereview.chromium.org/12086077/ BUG=172573 Review URL: https://codereview.chromium.org/12177018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180600 0...
0
116,822
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: UpdateCurrentTime(void) { TimeStamp systime; /* To avoid time running backwards, we must call GetTimeInMillis before * calling ProcessInputEvents. */ systime.months = currentTime.months; systime.milliseconds = GetTimeInMillis(); if (systime.milliseconds < currentTime.milliseconds) ...
0
17,796
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: sec_parse_public_key(STREAM s, uint8 * modulus, uint8 * exponent) { uint32 magic, modulus_len; in_uint32_le(s, magic); if (magic != SEC_RSA_MAGIC) { logger(Protocol, Error, "sec_parse_public_key(), magic (0x%x) != SEC_RSA_MAGIC", magic); return False; } in_uint32_le(s, modulus_len); modulus_...
0
93,110
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 StreamTcpPacketStateSynRecv(ThreadVars *tv, Packet *p, StreamTcpThread *stt, TcpSession *ssn, PacketQueue *pq) { if (ssn == NULL) return -1; if (p->tcph->th_flags & TH_RST) { if (!StreamTcpValidateRst(ssn, p)) return -1; uint8_t rese...
0
84,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: void bvec_free(mempool_t *pool, struct bio_vec *bv, unsigned int idx) { if (!idx) return; idx--; BIO_BUG_ON(idx >= BVEC_POOL_NR); if (idx == BVEC_POOL_MAX) { mempool_free(bv, pool); } else { struct biovec_slab *bvs = bvec_slabs + idx; kmem_cache_free(bvs->slab, bv); } } Commit Message: fix unbal...
0
62,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: bool TabletModeWindowManager::IsTrackingWindow(aura::Window* window) { return base::Contains(window_state_map_, window); } Commit Message: Fix the crash after clamshell -> tablet transition in overview mode. This CL just reverted some changes that were made in https://chromium-review.googlesource.com/c/chromi...
0
137,531
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 ReleaseTouchPoint(int index) { touch_event_.ReleasePoint(index); } Commit Message: Start rendering timer after first navigation Currently the new content rendering timer in the browser process, which clears an old page's contents 4 seconds after a navigation if the new page doesn't draw in that tim...
0
145,620
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 PageHandler::DidRunBeforeUnloadConfirm(const GURL& url, bool has_non_devtools_handlers, JavaScriptDialogCallback callback) { if (!enabled_) return; DCHECK(pending_dialog_.is_null()); pending_dialog_ = std::move(...
0
143,599
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 bool is_exception(u32 intr_info) { return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VALID_MASK)) == (INTR_TYPE_HARD_EXCEPTION | INTR_INFO_VALID_MASK); } Commit Message: x86,kvm,vmx: Preserve CR4 across VM entry CR4 isn't constant; at least the TSD and PCE bits can vary. TBH, treating ...
0
37,110
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 phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, char *mode, char allow_dir, char **error, int security TSRMLS_DC) /* {{{ */ { phar_archive_data *phar; phar_entry_info *entry; int for_write = mode[0] != 'r' || mode[1] == '+'; int for_append = mode[0] == 'a'...
0
196
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 TestRenderWidgetHostView::IsShowing() { return is_showing_; } Commit Message: Correctly reset FP in RFHI whenever origin changes Bug: 713364 Change-Id: Id8bb923750e20f3db6fc9358b1d44120513ac95f CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Change-Id: Id8bb923750e20f3db6fc9358b...
0
127,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: int set_create_files_as(struct cred *new, struct inode *inode) { new->fsuid = inode->i_uid; new->fsgid = inode->i_gid; return security_kernel_create_files_as(new, inode); } Commit Message: cred: copy_process() should clear child->replacement_session_keyring keyctl_session_to_parent(task) sets ->replacement_s...
0
19,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: static bool TrackIndexCompare(TextTrack* a, TextTrack* b) { return a->TrackIndex() - b->TrackIndex() < 0; } Commit Message: Support negative timestamps of TextTrackCue Ensure proper behaviour for negative timestamps of TextTrackCue. 1. Cues with negative startTime should become active from 0s. 2. Cues with ne...
0
124,995
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 AppListSyncableService::DeleteSyncItemSpecifics( const sync_pb::AppListSpecifics& specifics) { const std::string& item_id = specifics.item_id(); if (item_id.empty()) { LOG(ERROR) << "Delete AppList item with empty ID"; return; } VLOG(2) << this << ": DeleteSyncItemSpecifics: " << item_id....
0
123,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: static int __hw_addr_del(struct netdev_hw_addr_list *list, unsigned char *addr, int addr_len, unsigned char addr_type) { struct netdev_hw_addr *ha; list_for_each_entry(ha, &list->list, list) { if (!memcmp(ha->addr, addr, addr_len) && (ha->type == addr_type || !addr_type)) { if (--ha->refcount) ...
0
32,071
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 GLES2DecoderPassthroughImpl::DoDeleteSync(GLuint sync) { return DeleteHelper(sync, &resources_->sync_id_map, [this](uintptr_t sync) { api()->glDeleteSyncFn(reinterpret_cast<GLsync>(sync)); }); } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_S...
0
141,932
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 list_has_conn(struct list_head *list, struct rds_connection *conn) { struct rds_tcp_connection *tc, *_tc; list_for_each_entry_safe(tc, _tc, list, t_tcp_node) { if (tc->t_cpath->cp_conn == conn) return true; } return false; } Commit Message: net: rds: force to destroy connection if t_sock is...
0
90,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: static int mac80211_hwsim_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta) { hwsim_check_magic(vif); hwsim_set_sta_magic(sta); return 0; } Commit Message: mac80211_hwsim: fix possible memory leak in hwsim_new_radio_nl() 'hwname' is malloced in hwsim_new_radi...
0
83,859
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 dccp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) { struct dccp_hdr *dh = dccp_hdr(skb); if (sk->sk_state == DCCP_OPEN) { /* Fast path */ if (dccp_rcv_established(sk, skb, dh, skb->len)) goto reset; return 0; } /* * Step 3: Process LISTEN state * If P.type == Request or P contains a vali...
0
18,743
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 activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterPerWorldBindingsLongAttribute", "TestObjectPython", info.Holder(), info.G...
0
122,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: WebContentsDelegate* WebContentsImpl::GetDelegate() { return delegate_; } Commit Message: Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225026 00...
0
110,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: check_firmware_version(YK_KEY *yk, bool verbose, bool quiet, FILE *debug_file) { YK_STATUS *st = ykds_alloc(); if (!yk_get_status(yk, st)) { free(st); return 0; } if (verbose) { D(debug_file, "YubiKey Firmware version: %d.%d.%d\n", ykds_version_major(st), ykds_version_minor(st), ...
0
83,428
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 GetIdleSocketCountInSSLSocketPool(HttpNetworkSession* session) { return session->GetSSLSocketPool(HttpNetworkSession::NORMAL_SOCKET_POOL) ->IdleSocketCount(); } Commit Message: Implicitly bypass localhost when proxying requests. This aligns Chrome's behavior with the Windows and macOS proxy resolver...
0
144,793
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: char *M_fs_path_user_confdir(M_fs_system_t sys_type) { char *out; M_fs_error_t res; #ifdef _WIN32 res = M_fs_path_norm(&out, "%APPDATA%", M_FS_PATH_NORM_NONE, sys_type); #elif defined(__APPLE__) res = M_fs_path_norm(&out, "~/Library/Application Support/", M_FS_PATH_NORM_HOME, sys_type); #else res =...
0
79,654
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 Ins_IDEF( INS_ARG ) { if (CUR.countIDefs >= CUR.numIDefs || args[0] > 255) CUR.error = TT_Err_Storage_Overflow; else { PDefRecord pTDR; CUR.IDefPtr[(Byte)(args[0])] = CUR.countIDefs; pTDR = &CUR.IDefs[CUR.countIDefs++]; pTDR->Opc = (Byte)(...
0
5,394
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 vrend_renderer_resource_destroy(struct vrend_resource *res, bool remove) { if (res->readback_fb_id) glDeleteFramebuffers(1, &res->readback_fb_id); if (res->ptr) free(res->ptr); if (res->id) { if (res->target == GL_ELEMENT_ARRAY_BUFFER_ARB || res->target == GL_ARRAY_BUFFE...
0
8,915
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 snd_sequencer_device_init(void) { int err; snd_device_initialize(&seq_dev, NULL); dev_set_name(&seq_dev, "seq"); if (mutex_lock_interruptible(&register_mutex)) return -ERESTARTSYS; err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0, &snd_seq_f_ops, NULL, &seq_dev); if (err ...
0
54,737
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::OnRegisterProtocolHandler(const std::string& protocol, const GURL& url, const base::string16& title, bool user_gesture) { if (!delegate_) retu...
0
131,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: int module_initialize( YR_MODULE* module) { return ERROR_SUCCESS; } Commit Message: Fix heap overflow (reported by Jurriaan Bremer) When setting a new array item with yr_object_array_set_item() the array size is doubled if the index for the new item is larger than the already allocated ones. No further ch...
0
63,460
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 __init boot_delay_setup(char *str) { unsigned long lpj; lpj = preset_lpj ? preset_lpj : 1000000; /* some guess */ loops_per_msec = (unsigned long long)lpj / 1000 * HZ; get_option(&str, &boot_delay); if (boot_delay > 10 * 1000) boot_delay = 0; pr_debug("boot_delay: %u, preset_lpj: %ld, lpj: %...
0
33,431
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 ovl_open_need_copy_up(int flags, enum ovl_path_type type, struct dentry *realdentry) { if (OVL_TYPE_UPPER(type)) return false; if (special_file(realdentry->d_inode->i_mode)) return false; if (!(OPEN_FMODE(flags) & FMODE_WRITE) && !(flags & O_TRUNC)) return false; return true; } Com...
0
41,432
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: ofputil_decode_ofp15_group_desc_reply(struct ofputil_group_desc *gd, struct ofpbuf *msg, enum ofp_version version) { struct ofp15_group_desc_stats *ogds; uint16_t length, bucket_list_len; int error; if (!msg->header) { ...
0
77,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 PassRefPtr<MockLayerTreeHost> create(TestHooks* testHooks, CCLayerTreeHostClient* client, PassRefPtr<LayerChromium> rootLayer, const CCSettings& settings) { return adoptRef(new MockLayerTreeHost(testHooks, client, rootLayer, settings)); } Commit Message: [chromium] Fix shutdown race wh...
0
97,896
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 V4L2JpegEncodeAccelerator::VideoFrameReady(int32_t task_id, size_t encoded_picture_size) { if (!child_task_runner_->BelongsToCurrentThread()) { child_task_runner_->PostTask( FROM_HERE, base::BindOnce(&V4L2JpegEncodeAccelerator::VideoFrameReady, ...
0
136,071
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::RenderProcessGone(SiteInstanceImpl* site_instance) { DCHECK_EQ(site_instance_.get(), site_instance); if (GetNavigationHandle()) GetNavigationHandle()->set_net_error_code(net::ERR_ABORTED); ResetLoadingState(); set_nav_entry_id(0); if (is_audible_) GetProcess()->OnMed...
0
156,001
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 copy_strings_kernel(int argc, const char *const *__argv, struct linux_binprm *bprm) { int r; mm_segment_t oldfs = get_fs(); struct user_arg_ptr argv = { .ptr.native = (const char __user *const __user *)__argv, }; set_fs(KERNEL_DS); r = copy_strings(argc, argv, bprm); set_fs(oldfs); return r; }...
0
30,892
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 maybe_change_configuration(struct cpu_hw_events *cpuc) { int j; if (cpuc->n_added == 0) return; /* Find counters that are moving to another PMC and update */ for (j = 0; j < cpuc->n_events; j++) { struct perf_event *pe = cpuc->event[j]; if (cpuc->current_idx[j] != PMC_NO_INDEX && cpuc-...
0
25,236
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: resp_get_length(netdissect_options *ndo, register const u_char *bp, int len, const u_char **endp) { int result; u_char c; int saw_digit; int neg; int too_large; if (len == 0) goto trunc; ND_TCHECK(*bp); too_large = 0; neg = 0; if (*bp == '-') { neg = 1; ...
1
167,928
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 char* SegmentInfo::GetMuxingAppAsUTF8() const { return m_pMuxingAppAsUTF8; } 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: 574045edd4ecbeb802ee3f1d214b5510269...
1
174,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: FcDirCacheDisposeUnlocked (FcCache *cache) { FcCacheRemoveUnlocked (cache); switch (cache->magic) { case FC_CACHE_MAGIC_ALLOC: free (cache); break; case FC_CACHE_MAGIC_MMAP: #if defined(HAVE_MMAP) || defined(__CYGWIN__) munmap (cache, cache->size); #elif defined(_WIN32) UnmapViewOfFile (cache...
0
10,399
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_recv_frame(struct l2cap_conn *conn, struct sk_buff *skb) { struct l2cap_hdr *lh = (void *) skb->data; u16 cid, len; __le16 psm; skb_pull(skb, L2CAP_HDR_SIZE); cid = __le16_to_cpu(lh->cid); len = __le16_to_cpu(lh->len); BT_DBG("len %d, cid 0x%4.4x", len, cid); switch (cid) { case L2CA...
0
58,956
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 tg3_phy_probe(struct tg3 *tp) { u32 hw_phy_id_1, hw_phy_id_2; u32 hw_phy_id, hw_phy_id_masked; int err; /* flow control autonegotiation is default behavior */ tg3_flag_set(tp, PAUSE_AUTONEG); tp->link_config.flowctrl = FLOW_CTRL_TX | FLOW_CTRL_RX; if (tg3_flag(tp, ENABLE_APE)) { switch (tp->...
0
32,662
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: bitcat(PG_FUNCTION_ARGS) { VarBit *arg1 = PG_GETARG_VARBIT_P(0); VarBit *arg2 = PG_GETARG_VARBIT_P(1); PG_RETURN_VARBIT_P(bit_catenate(arg1, arg2)); } Commit Message: Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such t...
0
39,075
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 addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exceptionState(ExceptionState::ExecutionContext, "addEventListener", "TestObject", info.Holder(), info.GetIsolate()); EventTarget* impl = V8TestObject::toNative(info.Holder()); if (DOMWindow* window = ...
0
121,557
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::opSetCharSpacing(Object args[], int numArgs) { state->setCharSpace(args[0].getNum()); out->updateCharSpace(state); } Commit Message: CWE ID: CWE-20
0
8,138
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: pubkey_cleanup(Authctxt *authctxt) { Identity *id; if (authctxt->agent_fd != -1) ssh_close_authentication_socket(authctxt->agent_fd); for (id = TAILQ_FIRST(&authctxt->keys); id; id = TAILQ_FIRST(&authctxt->keys)) { TAILQ_REMOVE(&authctxt->keys, id, next); sshkey_free(id->key); free(id->filename);...
0
72,257
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: xfs_attr_node_list(xfs_attr_list_context_t *context) { attrlist_cursor_kern_t *cursor; xfs_attr_leafblock_t *leaf; xfs_da_intnode_t *node; struct xfs_attr3_icleaf_hdr leafhdr; struct xfs_da3_icnode_hdr nodehdr; struct xfs_da_node_entry *btree; int error, i; struct xfs_buf *bp; struct xfs_inode *dp = cont...
0
44,963
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 GLES2Implementation::DrawArrays(GLenum mode, GLint first, GLsizei count) { GPU_CLIENT_SINGLE_THREAD_CHECK(); GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDrawArrays(" << GLES2Util::GetStringDrawMode(mode) << ", " << first << ", " << count << ")"); if (count < 0...
0
140,939
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: launchTests(testDescPtr tst) { int res = 0, err = 0; size_t i; char *result; char *error; int mem; if (tst == NULL) return(-1); if (tst->in != NULL) { glob_t globbuf; globbuf.gl_offs = 0; glob(tst->in, GLOB_DOOFFS, NULL, &globbuf); for (i = 0;i < globbuf.gl_pathc;i++) { if (...
0
59,597
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: XFreeFontPath (char **list) { if (list != NULL) { Xfree (list[0]-1); Xfree (list); } return 1; } Commit Message: CWE ID: CWE-787
0
4,230
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 gdi_Bitmap_Paint(rdpContext* context, rdpBitmap* bitmap) { gdiBitmap* gdi_bitmap = (gdiBitmap*) bitmap; UINT32 width = bitmap->right - bitmap->left + 1; UINT32 height = bitmap->bottom - bitmap->top + 1; return gdi_BitBlt(context->gdi->primary->hdc, bitmap->left, bitmap->top, ...
0
83,537
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 int tty_poll(struct file *filp, poll_table *wait) { struct tty_struct *tty = file_tty(filp); struct tty_ldisc *ld; int ret = 0; if (tty_paranoia_check(tty, file_inode(filp), "tty_poll")) return 0; ld = tty_ldisc_ref_wait(tty); if (ld->ops->poll) ret = ld->ops->poll(tty, filp, wait); t...
0
55,934
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 OomInterventionTabHelper::OnNearOomDetected() { DCHECK(!OomInterventionConfig::GetInstance()->should_detect_in_renderer()); DCHECK_EQ(web_contents()->GetVisibility(), content::Visibility::VISIBLE); DCHECK(!near_oom_detected_time_); subscription_.reset(); StartDetectionInRenderer(); DCHECK(!rende...
0
130,893
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 NavigatorImpl::LogResourceRequestTime( base::TimeTicks timestamp, const GURL& url) { if (navigation_data_ && navigation_data_->url_ == url) { navigation_data_->url_job_start_time_ = timestamp; UMA_HISTOGRAM_TIMES( "Navigation.TimeToURLJobStart", navigation_data_->url_job_start_t...
0
127,701
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_sigreturn_32_address(unsigned int nip, unsigned int fp) { if (nip == fp + offsetof(struct signal_frame_32, mctx.mc_pad)) return 1; if (vdso32_sigtramp && current->mm->context.vdso_base && nip == current->mm->context.vdso_base + vdso32_sigtramp) return 1; return 0; } Commit Message: powe...
0
42,177
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: event_destroy(void *eventhdl) { CloseHandle((HANDLE)eventhdl); } Commit Message: Check length of memcmp CWE ID: CWE-125
0
81,658
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: tt_cmap12_init( TT_CMap12 cmap, FT_Byte* table ) { cmap->cmap.data = table; table += 12; cmap->num_groups = FT_PEEK_ULONG( table ); cmap->valid = 0; return FT_Err_Ok; } Commit Message: CWE ID: CWE-119
0
7,087
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 do_fpu_inst(unsigned short inst, struct pt_regs *regs) { struct task_struct *tsk = current; struct sh_fpu_soft_struct *fpu = &(tsk->thread.xstate->softfpu); perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, 0); if (!(task_thread_info(tsk)->status & TS_USEDFPU)) { /* initialize once. */ ...
1
165,801
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::Handle<v8::Value> V8WebGLRenderingContext::getSupportedExtensionsCallback(const v8::Arguments& args) { INC_STATS("DOM.WebGLRenderingContext.getSupportedExtensionsCallback()"); WebGLRenderingContext* imp = V8WebGLRenderingContext::toNative(args.Holder()); if (imp->isContextLost()) return v8...
0
109,775
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: u64 notrace _paravirt_ident_64(u64 x) { return x; } Commit Message: x86/paravirt: Fix spectre-v2 mitigations for paravirt guests Nadav reported that on guests we're failing to rewrite the indirect calls to CALLEE_SAVE paravirt functions. In particular the pv_queued_spin_unlock() call is left unpatched and that...
0
79,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 void asciiFold(char *aOut, const char *aIn, int nByte){ int i; for(i=0; i<nByte; i++){ char c = aIn[i]; if( c>='A' && c<='Z' ) c += 32; aOut[i] = c; } } Commit Message: sqlite: safely move pointer values through SQL. This lands https://www.sqlite.org/src/timeline?c=d6a44b35 in third_par...
0
136,305
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 __sctp_setsockopt_connectx(struct sock *sk, struct sockaddr __user *addrs, int addrs_size, sctp_assoc_t *assoc_id) { struct sockaddr *kaddrs; gfp_t gfp = GFP_KERNEL; int err = 0; pr_debug("%s: sk:%p addrs:%p addrs_size:%d\n", __func__, sk, addrs, addrs_size); if ...
0
60,645
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 MojoAudioOutputIPC::AuthorizationRequested() { return stream_provider_.is_bound(); } Commit Message: Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which were assuming that the call actually has any control over the memory protection applied to a hand...
0
149,360
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 RemoteFrame::SetWebLayer(WebLayer* web_layer) { if (web_layer_) GraphicsLayer::UnregisterContentsLayer(web_layer_); web_layer_ = web_layer; if (web_layer_) GraphicsLayer::RegisterContentsLayer(web_layer_); DCHECK(Owner()); ToHTMLFrameOwnerElement(Owner())->SetNeedsCompositingUpdate(); } C...
0
152,203
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 ExecuteInsertLineBreak(LocalFrame& frame, Event* event, EditorCommandSource source, const String&) { switch (source) { case kCommandFromMenuOrKeyBinding: return TargetFrame(frame, event...
0
128,533
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: modification_init(png_modification *pmm) { memset(pmm, 0, sizeof *pmm); pmm->next = NULL; pmm->chunk = 0; pmm->modify_fn = NULL; pmm->add = 0; modification_reset(pmm); } Commit Message: DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f3597b691b63bc0bf46084833 (cher...
0
159,995
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* AXObject::parentObjectUnignored() const { AXObject* parent; for (parent = parentObject(); parent && parent->accessibilityIsIgnored(); parent = parent->parentObject()) { } return parent; } Commit Message: Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Revi...
0
127,292
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 v8::Handle<v8::Value> supplementalMethod4Callback(const v8::Arguments& args) { INC_STATS("DOM.TestInterface.supplementalMethod4"); TestSupplemental::supplementalMethod4(); return v8::Handle<v8::Value>(); } Commit Message: [V8] Pass Isolate to throwNotEnoughArgumentsError() https://bugs.webkit....
0
109,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: BOOL ValidateIOBufferSize (PIRP irp, size_t requiredBufferSize, ValidateIOBufferSizeType type) { PIO_STACK_LOCATION irpSp = IoGetCurrentIrpStackLocation (irp); BOOL input = (type == ValidateInput || type == ValidateInputOutput); BOOL output = (type == ValidateOutput || type == ValidateInputOutput); if ((inpu...
0
87,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: MagickExport size_t GetPixelCacheChannels(const Cache cache) { CacheInfo *restrict cache_info; assert(cache != (Cache) NULL); cache_info=(CacheInfo *) cache; assert(cache_info->signature == MagickSignature); if (cache_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(...
0
73,628
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 CNBL::RegisterNB(CNB *NB) { m_Buffers.PushBack(NB); m_BuffersNumber++; } Commit Message: NetKVM: BZ#1169718: Checking the length only on read Signed-off-by: Joseph Hindin <yhindin@rehat.com> CWE ID: CWE-20
0
96,332
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 gf_sys_close() { if (sys_init > 0) { sys_init --; if (sys_init) return; /*prevent any call*/ last_update_time = 0xFFFFFFFF; #if defined(WIN32) && !defined(_WIN32_WCE) timeEndPeriod(1); MyGetSystemTimes = NULL; MyGetProcessMemoryInfo = NULL; MyQuerySystemInfo = NULL; if (psapi_hinst) Free...
0
90,838
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: gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() { return window_->GetToplevelWindow()->GetBoundsInScreen(); } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing the r...
0
114,817
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 *ip6t_alloc_initial_table(const struct xt_table *info) { return xt_alloc_initial_table(ip6t, IP6T); } Commit Message: netfilter: x_tables: make sure e->next_offset covers remaining blob size Otherwise this function may read data beyond the ruleset blob. Signed-off-by: Florian Westphal <fw@strlen.de> Sign...
0
52,364
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 omx_vdec::allocate_color_convert_buf::get_buffer_req (unsigned int &buffer_size) { bool status = true; pthread_mutex_lock(&omx->c_lock); if (!enabled) buffer_size = omx->drv_ctx.op_buf.buffer_size; else { if (!c2d.get_buffer_size(C2D_OUTPUT,buffer_size)) { DEBUG_PRINT_ERROR("Get ...
0
160,277
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: MATCHER_P(Message, type, "") { return arg.type() == static_cast<uint32>(type); } Commit Message: Validate and report peer's PID to WorkerProcessIpcDelegate so it will be able to duplicate handles to and from the worker process. As a side effect WorkerProcessLauncher::Delegate is now responsible for retrieving...
0
118,776
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 btif_config_section_iter_t *btif_config_section_next(const btif_config_section_iter_t *section) { assert(config != NULL); assert(section != NULL); return (const btif_config_section_iter_t *)config_section_next((const config_section_node_t *)section); } Commit Message: Add guest mode functionality (2/3...
0
159,667
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 BluetoothDeviceChromeOS::AuthorizeService( const dbus::ObjectPath& device_path, const std::string& uuid, const ConfirmationCallback& callback) { callback.Run(CANCELLED); } Commit Message: Refactor to support default Bluetooth pairing delegate In order to support a default pairing delegate we ...
1
171,216
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 sched_submit_work(struct task_struct *tsk) { if (!tsk->state || tsk_is_pi_blocked(tsk)) return; /* * If we are going to sleep and we have plugged IO queued, * make sure to submit it to avoid deadlocks. */ if (blk_needs_flush_plug(tsk)) blk_schedule_flush_plug(tsk); } Commit Messag...
0
55,632
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 ssl_check_clienthello_tlsext_late(SSL *s) { int ret = SSL_TLSEXT_ERR_OK; int al; /* * If status request then ask callback what to do. Note: this must be * called after servername callbacks in case the certificate has changed, * and must be called after the cipher has been chosen be...
0
6,137
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 ATSParser::PSISection::isComplete() const { if (mBuffer == NULL || mBuffer->size() < 3) { return false; } unsigned sectionLength = U16_AT(mBuffer->data() + 1) & 0xfff; return mBuffer->size() >= sectionLength + 3; } Commit Message: Check section size when verifying CRC Bug: 28333006 Change-Id: Ief7a2d...
0
160,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: void RenderWidgetHostImpl::SetNeedsBeginFrame(bool needs_begin_frames) { if (needs_begin_frames_ == needs_begin_frames) return; needs_begin_frames_ = needs_begin_frames || browser_fling_needs_begin_frame_; if (view_) view_->SetNeedsBeginFrames(needs_begin_frames_); } Commit Message: Start renderin...
0
145,554
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 au1200fb_setup(struct au1200fb_platdata *pd) { char *options = NULL; char *this_opt, *endptr; int num_panels = ARRAY_SIZE(known_lcd_panels); int panel_idx = -1; fb_get_options(DRIVER_NAME, &options); if (!options) goto out; while ((this_opt = strsep(&options, ",")) != NULL) { /* Panel opt...
0
28,351
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 qeth_hw_trap_cb(struct qeth_card *card, struct qeth_reply *reply, unsigned long data) { struct qeth_ipa_cmd *cmd; __u16 rc; cmd = (struct qeth_ipa_cmd *)data; rc = cmd->hdr.return_code; if (rc) QETH_CARD_TEXT_(card, 2, "trapc:%x", rc); return 0; } Commit Message: qeth: avoid buffer overflow...
0
28,576
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 DevToolsUIBindings::InnerAttach() { DCHECK(agent_host_.get()); agent_host_->AttachClient(this); } Commit Message: Improve sanitization of remoteFrontendUrl in DevTools This change ensures that the decoded remoteFrontendUrl parameter cannot contain any single quote in its value. As of this commit, none ...
0
146,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: int ext4_get_block_unwritten(struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create) { ext4_debug("ext4_get_block_unwritten: inode %lu, create flag %d\n", inode->i_ino, create); return _ext4_get_block(inode, iblock, bh_result, EXT4_GET_BLOCKS_IO_CREATE_EXT); } Co...
0
67,527
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 bool serpent_fpu_begin(bool fpu_enabled, unsigned int nbytes) { return glue_fpu_begin(SERPENT_BLOCK_SIZE, SERPENT_PARALLEL_BLOCKS, NULL, fpu_enabled, nbytes); } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we n...
0
47,011