instruction
stringclasses
1 value
input
stringlengths
64
129k
output
int64
0
1
__index_level_0__
int64
0
30k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct dentry *lookup_one_len(const char *name, struct dentry *base, int len) { int err; struct qstr this; WARN_ON_ONCE(!mutex_is_locked(&base->d_inode->i_mutex)); err = __lookup_one_len(name, &this, base, len); if (err) return ERR_PTR(err); err = exec_permission(base->d_inode); if (err) return ERR_...
0
200
Analyze the following 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 veth_dev_free(struct net_device *dev) { struct veth_priv *priv; priv = netdev_priv(dev); free_percpu(priv->stats); free_netdev(dev); } Commit Message: net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calli...
0
17,256
Analyze the following 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::SystemDragEnded() { if (GetRenderViewHost()) GetRenderViewHost()->DragSourceSystemDragEnded(); if (browser_plugin_embedder_.get()) browser_plugin_embedder_->SystemDragEnded(); } Commit Message: Don't call WebContents::DownloadImage() callback if the WebContents were deleted BUG...
0
10,864
Analyze the following 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 voidMethodOctetArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::voidMethodOctetArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: document.location bi...
0
13,914
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: base::SequencedTaskRunner& RenderProcessHostImpl::GetAecDumpFileTaskRunner() { if (!audio_debug_recordings_file_task_runner_) { audio_debug_recordings_file_task_runner_ = base::CreateSequencedTaskRunnerWithTraits( {base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN, ...
0
17,134
Analyze the following 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::opEOFillStroke(Object args[], int numArgs) { if (!state->isCurPt()) { return; } if (state->isPath() && !contentIsHidden()) { if (state->getFillColorSpace()->getMode() == csPattern) { doPatternFill(gTrue); } else { out->eoFill(state); } if (state->getStrokeColorSpace...
0
23,607
Analyze the following 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 GetDataSaverEnabledPref(const PrefService* prefs) { return prefs->GetBoolean(prefs::kDataSaverEnabled) && base::FieldTrialList::FindFullName("SaveDataHeader") .compare("Disabled"); } Commit Message: [GuestView] - Introduce MimeHandlerViewAttachHelper This CL is for the most part a m...
0
5,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: Profile* ExtensionBrowserTest::profile() { if (!profile_) { if (browser()) profile_ = browser()->profile(); else profile_ = ProfileManager::GetActiveUserProfile(); } return profile_; } Commit Message: [Extensions] Update navigations across hypothetical extension extents Update code to ...
0
14,386
Analyze the following 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 vrend_decode_begin_query(struct vrend_decode_ctx *ctx, int length) { if (length != 1) return EINVAL; uint32_t handle = get_buf_entry(ctx, VIRGL_QUERY_BEGIN_HANDLE); vrend_begin_query(ctx->grctx, handle); return 0; } Commit Message: CWE ID: CWE-476
0
19,171
Analyze the following 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 camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) { u32 dw, tl, tr; u32 kw4l, kw4r; /* absorb kw2 to other subkeys */ /* round 2 */ subL[3] ^= subL[1]; subR[3] ^= subR[1]; /* round 4 */ subL[5] ^= subL[1]; subR[5] ^= subR[1]; /* round 6 */ subL[7] ^= subL[1]; subR[7] ^= subR[1]...
0
7,907
Analyze the following 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 Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType has_merged_image, skip_layers; MagickOffsetType offset; MagickSizeType length; MagickBooleanType status; PSDInfo psd_info; register ssize_t i; s...
1
17,174
Analyze the following 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 int64_t default_reload_interval(struct playlist *pls) { return pls->n_segments > 0 ? pls->segments[pls->n_segments - 1]->duration : pls->target_duration; } Commit Message: avformat/hls: Fix DoS due to infinite loop Fixes: loop.m3u The default max i...
0
6,410
Analyze the following 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_filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) { struct inode *inode = file_inode(vma->vm_file); int err; down_read(&EXT4_I(inode)->i_mmap_sem); err = filemap_fault(vma, vmf); up_read(&EXT4_I(inode)->i_mmap_sem); return err; } Commit Message: ext4: fix data exposure after a cras...
0
21,187
Analyze the following 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 SyncManager::SyncInternal::HandleCalculateChangesChangeEventFromSyncApi( const ImmutableWriteTransactionInfo& write_transaction_info, syncable::BaseTransaction* trans) { if (!scheduler()) { return; } LOG_IF(WARNING, !ChangeBuffersAreEmpty()) << "CALCULATE_CHANGES called with unapplie...
0
6,017
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: handle_bundle_control(struct ofconn *ofconn, const struct ofp_header *oh) { struct ofputil_bundle_ctrl_msg bctrl; struct ofputil_bundle_ctrl_msg reply; struct ofpbuf *buf; enum ofperr error; error = reject_slave_controller(ofconn); if (error) { return error; } error = ofp...
0
1,711
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual void DecompressedFrameHook(const vpx_image_t &img, const unsigned int frame_number) { ASSERT_TRUE(md5_file_ != NULL); char expected_md5[33]; char junk[128]; const int res = fscanf(md5_file_, "%s %s", expected_md5, junk); ASSERT_NE(EOF, res) << "Read md5 data failed"; expected_md5[32] = ...
0
13,888
Analyze the following 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 aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) { const struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); const __le32 *src = (const __le32 *)in; __le32 *dst = (__le32 *)out; u32 b0[4], b1[4]; const u32 *kp = ctx->key_enc + 4; const int key_len = ctx->key_length; b0[0] = le32_to_cpu...
0
6,716
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: fm_mgr_get_error_str ( IN fm_mgr_config_errno_t err ) { switch(err){ case FM_CONF_ERR_LEN: return "Response data legth invalid"; case FM_CONF_ERR_VERSION: return "Client/Server version mismatch"; case FM_CONF_ERR_DISC: return "Not connected"; case FM_CONF_TEST: return "Test message"; case...
0
10,962
Analyze the following 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 t1_subset_ascii_part(void) { int i, j; t1_getline(); while (!t1_prefix("/Encoding")) { t1_scan_param(); if (!(t1_prefix("/UniqueID") && !strncmp(t1_line_array + strlen(t1_line_array) -4, "def", 3))) t1_putline(); t1_getline(); } if ...
0
25,443
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: EntryInfoResult::~EntryInfoResult() { } Commit Message: Remove parent* arg from GDataEntry ctor. * Remove static FromDocumentEntry from GDataEntry, GDataFile, GDataDirectory. Replace with InitFromDocumentEntry. * Move common code from GDataFile::InitFromDocumentEntry and GDataDirectory::InitFromDocumentEntry to...
0
152
Analyze the following 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 blit_region_is_unsafe(struct CirrusVGAState *s, int32_t pitch, int32_t addr) { if (!pitch) { return true; } if (pitch < 0) { int64_t min = addr + ((int64_t)s->cirrus_blt_height-1) * pitch; int32_t max = addr ...
0
22,261
Analyze the following 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 const void *AcquirePixelCachePixels(const Image *image, MagickSizeType *length,ExceptionInfo *exception) { CacheInfo *restrict cache_info; assert(image != (const Image *) NULL); assert(image->signature == MagickSignature); assert(exception != (ExceptionInfo *) NULL); assert(exception...
0
5,129
Analyze the following 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 hub_disconnect(struct usb_interface *intf) { struct usb_hub *hub = usb_get_intfdata(intf); struct usb_device *hdev = interface_to_usbdev(intf); int port1; /* * Stop adding new hub events. We do not want to block here and thus * will not try to remove any pending work item. */ hub->disconne...
0
28,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: void SVGStyleElement::setType(const AtomicString& type) { setAttribute(SVGNames::typeAttr, type); } Commit Message: Do not crash while reentrantly appending to style element. When a node is inserted into a container, it is notified via ::InsertedInto. However, a node may request a second notification via DidN...
0
4,711
Analyze the following 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 WebGLImageConversion::ExtractImageData( const uint8_t* image_data, DataFormat source_data_format, const IntSize& image_data_size, const IntRect& source_image_sub_rectangle, int depth, int unpack_image_height, GLenum format, GLenum type, bool flip_y, bool premultiply_al...
0
20,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: void GLES2DecoderImpl::DoUniform1iv( GLint fake_location, GLsizei count, const GLint *value) { GLenum type = 0; GLint real_location = -1; if (!PrepForSetUniformByLocation( fake_location, "glUniform1iv", &real_location, &type, &count)) { return; } if (type == GL_SAMPLER_2D || type == GL_SAM...
0
17,651
Analyze the following 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 ssl_get_bytes_avail( const ssl_context *ssl ) { return( ssl->in_offt == NULL ? 0 : ssl->in_msglen ); } Commit Message: ssl_parse_certificate() now calls x509parse_crt_der() directly CWE ID: CWE-20
0
11,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: content::BrowserContext* DownloadItemImpl::GetBrowserContext() const { return delegate_->GetBrowserContext(); } Commit Message: Refactors to simplify rename pathway in DownloadFileManager. This is https://chromiumcodereview.appspot.com/10668004 / r144817 (reverted due to CrOS failure) with the completion log...
0
4,876
Analyze the following 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 MdmEnrollmentEnabled() { base::string16 mdm_url = GetMdmUrl(); return !mdm_url.empty(); } Commit Message: [GCPW] Disallow sign in of consumer accounts when mdm is enabled. Unless the registry key "mdm_aca" is explicitly set to 1, always fail sign in of consumer accounts when mdm enrollment is enabled. ...
0
29,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: void AddCookie() { scoped_refptr<content::MessageLoopRunner> message_loop_runner = new content::MessageLoopRunner; quit_closure_ = message_loop_runner->QuitClosure(); cookie_store_->SetCookieWithOptionsAsync( kOrigin1, "A=1", net::CookieOptions(), base::BindOnce(&RemoveCookie...
0
12,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: MagickExport VirtualPixelMethod SetPixelCacheVirtualMethod(const Image *image, const VirtualPixelMethod virtual_pixel_method) { CacheInfo *restrict cache_info; VirtualPixelMethod method; assert(image != (Image *) NULL); assert(image->signature == MagickSignature); if (image->debug != MagickF...
0
13,626
Analyze the following 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 RebindCurrentFramebuffer( GLenum target, Framebuffer* framebuffer, GLuint back_buffer_service_id) { GLuint framebuffer_id = framebuffer ? framebuffer->service_id() : 0; if (framebuffer_id == 0) { framebuffer_id = back_buffer_service_id; } glBindFramebufferEXT(target, framebuf...
0
22,972
Analyze the following 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 AutomationProviderSearchEngineObserver::OnTemplateURLServiceChanged() { if (provider_) { TemplateURLService* url_service = TemplateURLServiceFactory::GetForProfile(profile_); url_service->RemoveObserver(this); AutomationJSONReply(provider_, reply_message_.release()).SendSuccess(NULL); ...
0
2,961
Analyze the following 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 nf_bridge_push_encap_header(struct sk_buff *skb) { unsigned int len = nf_bridge_encap_header_len(skb); skb_push(skb, len); skb->network_header -= len; } Commit Message: bridge: reset IPCB in br_parse_ip_options Commit 462fb2af9788a82 (bridge : Sanitize skb before it enters the IP stack), ...
0
650
Analyze the following 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 XfrmController::fillNlAttrXfrmAlgoEnc(const XfrmAlgo& inAlgo, nlattr_algo_crypt* algo) { if (inAlgo.name.empty()) { // Do not fill anything if algorithm not provided return 0; } int len = NLA_HDRLEN + sizeof(xfrm_algo); strncpy(algo->crypt.alg_name, inAlgo.name.c_str(), sizeof(algo->crypt.alg_name));...
0
26,927
Analyze the following 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 rmd320_update(struct shash_desc *desc, const u8 *data, unsigned int len) { struct rmd320_ctx *rctx = shash_desc_ctx(desc); const u32 avail = sizeof(rctx->buffer) - (rctx->byte_count & 0x3f); rctx->byte_count += len; /* Enough space in buffer? If so copy and we're done */ if (avail > len) { ...
0
6,238
Analyze the following 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 FrameLoader::numPendingOrLoadingRequests(bool recurse) const { if (!recurse) return m_frame->document()->fetcher()->requestCount(); int count = 0; for (Frame* frame = m_frame; frame; frame = frame->tree()->traverseNext(m_frame)) count += frame->document()->fetcher()->requestCount(...
0
28,028
Analyze the following 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 PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebLocalFrame* frame, const blink::WebNode& node, int expected_pages_count, bool is_scripted) { PrintHost...
0
10,337
Analyze the following 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 CameraDeviceClient::cancelRequest(int requestId) { ATRACE_CALL(); ALOGV("%s, requestId = %d", __FUNCTION__, requestId); status_t res; if ( (res = checkPid(__FUNCTION__) ) != OK) return res; Mutex::Autolock icl(mBinderSerializationLock); if (!mDevice.get()) return DEAD_OBJECT; Vector<int...
0
13,535
Analyze the following 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 buf_to_pages_noslab(const void *buf, size_t buflen, struct page **pages, unsigned int *pgbase) { struct page *newpage, **spages; int rc = 0; size_t len; spages = pages; do { len = min_t(size_t, PAGE_SIZE, buflen); newpage = alloc_page(GFP_KERNEL); if (newpage == NULL) goto unwind; m...
0
14,119
Analyze the following 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 ext4_block_to_path(struct inode *inode, ext4_lblk_t i_block, ext4_lblk_t offsets[4], int *boundary) { int ptrs = EXT4_ADDR_PER_BLOCK(inode->i_sb); int ptrs_bits = EXT4_ADDR_PER_BLOCK_BITS(inode->i_sb); const long direct_blocks = EXT4_NDIR_BLOCKS, indirect_blocks = ptrs, double_...
0
5,214
Analyze the following 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 *pool_calloc(size_t count, size_t size) { size_t len = count * size; void *r = pool_alloc(len); memset(r, 0, len); return r; } Commit Message: prefer memcpy to strcpy When we already know the length of a string (e.g., because we just malloc'd to fit it), it's nicer to use memcpy than strcpy, as ...
0
15,102
Analyze the following 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 Browser::VisibleSecurityStateChanged(WebContents* source) { DCHECK(source); if (tab_strip_model_->GetActiveWebContents() == source) { UpdateToolbar(false); if (hosted_app_controller_) hosted_app_controller_->UpdateLocationBarVisibility(true); } } Commit Message: If a dialog is shown, dr...
0
28,997
Analyze the following 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 hns_gmac_get_link_status(void *mac_drv, u32 *link_stat) { struct mac_driver *drv = (struct mac_driver *)mac_drv; *link_stat = dsaf_get_dev_bit(drv, GMAC_AN_NEG_STATE_REG, GMAC_AN_NEG_STAT_RX_SYNC_OK_B); } Commit Message: net: hns: fix ethtool_get_strings overflow in hns driver hns_get_s...
0
28,200
Analyze the following 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 BaseRenderingContext2D::setLineWidth(double width) { if (!std::isfinite(width) || width <= 0) return; if (GetState().LineWidth() == width) return; ModifiableState().SetLineWidth(width); } Commit Message: [PE] Distinguish between tainting due to canvas content and filter. A filter on a canvas ...
0
8,419
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DECLARE_INTERFACE_(my_ITaskbarList3, IUnknown) { STDMETHOD (QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; STDMETHOD (HrInit) (THIS) PURE; STDMETHOD (AddTab) (THIS_ HWND hwnd) PURE; STDMETHOD (DeleteTab) (THIS_ HWND hw...
0
9,453
Analyze the following 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::OnDestructionImminent(AppCacheHost* host) { PendingMasters::iterator found = pending_master_entries_.find(host->pending_master_entry_url()); CHECK(found != pending_master_entries_.end()); PendingHosts& hosts = found->second; PendingHosts::iterator it = std::find(hosts.begin()...
0
16,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 Ins_SFVTL( INS_ARG ) { if ( INS_SxVTL( (Int)(args[1]), (Int)(args[0]), CUR.opcode, &CUR.GS.freeVector) == FAILURE ) return; COMPUTE_Funcs(); } Commit Message: CWE ID: CWE-125
0
18,308
Analyze the following 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 bochs_probe(const uint8_t *buf, int buf_size, const char *filename) { const struct bochs_header *bochs = (const void *)buf; if (buf_size < HEADER_SIZE) return 0; if (!strcmp(bochs->magic, HEADER_MAGIC) && !strcmp(bochs->type, REDOLOG_TYPE) && !strcmp(bochs->subtype, GROWING_TYPE) && (...
0
28,905
Analyze the following 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 asymmetric_keyid_match(const char *kid, const char *id) { size_t idlen, kidlen; if (!kid || !id) return 0; /* make it possible to use id as in the request: "id:<id>" */ if (strncmp(id, "id:", 3) == 0) id += 3; /* Anything after here requires a partial match on the ID string */ idlen = strlen(id);...
0
15,007
Analyze the following 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 mailimf_group_parse(const char * message, size_t length, size_t * indx, struct mailimf_group ** result) { size_t cur_token; char * display_name; struct mailimf_mailbox_list * mailbox_list; struct mailimf_group * group; int r; int res; cur_token = * indx; mail...
1
26,984
Analyze the following 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 __sock_create(struct net *net, int family, int type, int protocol, struct socket **res, int kern) { int err; struct socket *sock; const struct net_proto_family *pf; /* * Check protocol is in range */ if (family < 0 || family >= NPROTO) return -EAFNOSUPPORT; if (type < 0 || type >= SOCK_M...
0
10,186
Analyze the following 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 php_snmp_getvalue(struct variable_list *vars, zval *snmpval, int valueretrieval) { zval val; char sbuf[512]; char *buf = &(sbuf[0]); char *dbuf = (char *)NULL; int buflen = sizeof(sbuf) - 1; int val_len = vars->val_len; /* use emalloc() for large values, use static array otherwize */ /* Ther...
0
16,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: static int tm_cgpr_active(struct task_struct *target, const struct user_regset *regset) { if (!cpu_has_feature(CPU_FTR_TM)) return -ENODEV; if (!MSR_TM_ACTIVE(target->thread.regs->msr)) return 0; return regset->n; } Commit Message: powerpc/tm: Flush TM only if CPU has TM feature Commit cd63f3c ("p...
0
7,992
Analyze the following 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 SetLengthImpl(Isolate* isolate, Handle<JSArray> array, uint32_t length, Handle<FixedArrayBase> backing_store) { Handle<SeededNumberDictionary> dict = Handle<SeededNumberDictionary>::cast(backing_store); int capacity = dict->Capacity(); uint32_t old_length = 0; CHECK(array->length()->ToArray...
0
9,070
Analyze the following 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 megasas_init_ctrl_params(struct megasas_instance *instance) { instance->fw_crash_state = UNAVAILABLE; megasas_poll_wait_aen = 0; instance->issuepend_done = 1; atomic_set(&instance->adprecovery, MEGASAS_HBA_OPERATIONAL); /* * Initialize locks and queues */ INIT_LIST_HEAD(&instance->c...
0
28,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: int sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, int flags) { struct kiocb iocb; int ret; init_sync_kiocb(&iocb, NULL); ret = __sock_recvmsg(&iocb, sock, msg, size, flags); if (-EIOCBQUEUED == ret) ret = wait_on_sync_kiocb(&iocb); return ret; } Commit Message: net: validate the ...
0
16,872
Analyze the following 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 MediaPlayerService::Client::getDuration(int *msec) { ALOGV("getDuration"); sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; status_t ret = p->getDuration(msec); if (ret == NO_ERROR) { ALOGV("[%d] getDuration = %d", mConnId, *msec); } else { ALOGE("getDura...
0
14,804
Analyze the following 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 ohci_read_ed(OHCIState *ohci, dma_addr_t addr, struct ohci_ed *ed) { return get_dwords(ohci, addr, (uint32_t *)ed, sizeof(*ed) >> 2); } Commit Message: CWE ID: CWE-835
0
27,600
Analyze the following 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 perf_event_exec(void) { struct perf_event_context *ctx; int ctxn; rcu_read_lock(); for_each_task_context_nr(ctxn) { ctx = current->perf_event_ctxp[ctxn]; if (!ctx) continue; perf_event_enable_on_exec(ctxn); perf_iterate_ctx(ctx, perf_event_addr_filters_exec, NULL, true); } rcu_read...
0
20,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: int btrfs_prealloc_file_range(struct inode *inode, int mode, u64 start, u64 num_bytes, u64 min_size, loff_t actual_len, u64 *alloc_hint) { return __btrfs_prealloc_file_range(inode, mode, start, num_bytes, min_size, actual_len, alloc_hint, NULL); } Commit Message: Btrfs: fix has...
0
598
Analyze the following 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 V8TestObject::ByteStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_byteStringAttribute_Getter"); test_object_v8_internal::ByteStringAttributeAttributeGetter(info); } Commit Message...
0
7,263
Analyze the following 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 OneClickSigninHelper::LogConfirmHistogramValue(int action) { UMA_HISTOGRAM_ENUMERATION("Signin.OneClickConfirmation", action, one_click_signin::HISTOGRAM_CONFIRM_MAX); } Commit Message: During redirects in the one click sign in flow, check the current URL instead of original UR...
0
24,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: void SoftAACEncoder2::onQueueFilled(OMX_U32 /* portIndex */) { if (mSignalledError) { return; } List<BufferInfo *> &inQueue = getPortQueue(0); List<BufferInfo *> &outQueue = getPortQueue(1); if (!mSentCodecSpecificData) { if (outQueue.empty()) { return; } if (AACENC_OK != aacEncEncode(mAACEncoder, N...
0
10,199
Analyze the following 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 filename_lookup(int dfd, struct filename *name, unsigned int flags, struct nameidata *nd) { int retval = path_lookupat(dfd, name, flags | LOOKUP_RCU, nd); if (unlikely(retval == -ECHILD)) retval = path_lookupat(dfd, name, flags, nd); if (unlikely(retval == -ESTALE)) retval = path_lookupat(df...
0
12,056
Analyze the following 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 pmcraid_send_hcam_cmd(struct pmcraid_cmd *cmd) { if (cmd->ioa_cb->ioarcb.cdb[1] == PMCRAID_HCAM_CODE_CONFIG_CHANGE) atomic_set(&(cmd->drv_inst->ccn.ignore), 0); else atomic_set(&(cmd->drv_inst->ldn.ignore), 0); pmcraid_send_cmd(cmd, cmd->cmd_done, 0, NULL); } Commit Message: [SCSI] pmcraid: r...
0
3,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: exsltDateFormatDate (const exsltDateValDatePtr dt) { xmlChar buf[100], *cur = buf; if ((dt == NULL) || !VALID_DATETIME(dt)) return NULL; FORMAT_DATE(dt, cur); if (dt->tz_flag || (dt->tzo != 0)) { FORMAT_TZ(dt->tzo, cur); } *cur = 0; return xmlStrdup(buf); } Commit Message: Roll l...
0
29,260
Analyze the following 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 GLSurfaceEGLOzoneX11::Resize(const gfx::Size& size, float scale_factor, bool has_alpha) { if (size == GetSize()) return true; size_ = size; eglWaitGL(); XResizeWindow(gfx::GetXDisplay(), window_, size.width(), size.height()); ...
0
29,382
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nsPluginInstance::setupProxy(const std::string& url) { #if NPAPI_VERSION != 190 if (!NPNFuncs.getvalueforurl) return; #endif char *proxy = 0; uint32_t length = 0; #if NPAPI_VERSION != 190 NPN_GetValueForURL(_instance, NPNURLVProxy, url.c_str(), &proxy, &length); #endif ...
0
18,320
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: NavigationPolicy EffectiveNavigationPolicy(NavigationPolicy policy, const WebInputEvent* current_event, const WebWindowFeatures& features) { if (policy == kNavigationPolicyIgnore) return GetNavigationPolicy(current_event, ...
1
24,094
Analyze the following 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 StopChildProcess(base::ProcessHandle handle) { DCHECK(CurrentlyOnProcessLauncherTaskRunner()); JNIEnv* env = AttachCurrentThread(); DCHECK(env); Java_ChildProcessLauncherHelperImpl_stop(env, static_cast<jint>(handle)); } Commit Message: android: Stop child process in GetTerminationInfo Android curr...
0
4,569
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::string AXTree::ToString() const { return "AXTree" + data_.ToString() + "\n" + TreeToStringHelper(root_, 0); } Commit Message: Position info (item n of m) incorrect if hidden focusable items in list Bug: 836997 Change-Id: I971fa7076f72d51829b36af8e379260d48ca25ec Reviewed-on: https://chromium-review.googl...
0
27,740
Analyze the following 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 HTMLMediaElement::exitPictureInPicture( WebMediaPlayer::PipWindowClosedCallback callback) { if (GetWebMediaPlayer()) GetWebMediaPlayer()->ExitPictureInPicture(std::move(callback)); } Commit Message: defeat cors attacks on audio/video tags Neutralize error messages and fire no progress events unti...
0
10,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: static int igmpv3_sendpack(struct sk_buff *skb) { struct igmphdr *pig = igmp_hdr(skb); const int igmplen = skb->tail - skb->transport_header; pig->csum = ip_compute_csum(igmp_hdr(skb), igmplen); return ip_local_out(skb); } Commit Message: igmp: Avoid zero delay when receiving odd mixture of IGMP queries C...
0
24,146
Analyze the following 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 ALWAYS_INLINE char jslNextCh() { return (char)(lex->it.ptr ? READ_FLASH_UINT8(&lex->it.ptr[lex->it.charIdx]) : 0); } Commit Message: Fix strncat/cpy bounding issues (fix #1425) CWE ID: CWE-119
0
18,783
Analyze the following 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 BindImageAnnotator(image_annotation::mojom::AnnotatorRequest request, RenderFrameHost* const frame_host) { content::BrowserContext::GetConnectorFor( frame_host->GetProcess()->GetBrowserContext()) ->BindInterface(image_annotation::mojom::kServiceName, ...
0
24,782
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xps_decode_font_char_imp(xps_font_t *font, int code) { byte *table; /* no cmap selected: return identity */ if (font->cmapsubtable <= 0) return code; table = font->data + font->cmapsubtable; switch (u16(table)) { case 0: /* Apple standard 1-to-1 mapping. */ {...
0
1,368
Analyze the following 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 DecodeRational ( const char * ratio, XMP_Uns32 * num, XMP_Uns32 * denom ) { unsigned long locNum, locDenom; char nextChar; // Used to make sure sscanf consumes all of the string. int items = sscanf ( ratio, "%lu/%lu%c", &locNum, &locDenom, &nextChar ); // AUDIT: This is safe, check the calls. i...
0
12,910
Analyze the following 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 jpc_dec_process_siz(jpc_dec_t *dec, jpc_ms_t *ms) { jpc_siz_t *siz = &ms->parms.siz; int compno; int tileno; jpc_dec_tile_t *tile; jpc_dec_tcomp_t *tcomp; int htileno; int vtileno; jpc_dec_cmpt_t *cmpt; size_t size; size_t num_samples; size_t num_samples_delta; dec->xstart = siz->xoff; de...
0
141
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PasswordManagerClient* CredentialManagerImpl::client() const { return client_; } Commit Message: Fix Credential Management API Store() for existing Credentials This changes fixes the Credential Management API to correctly handle storing of already existing credentials. In the previous version `preferred_match...
0
19,766
Analyze the following 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 HTMLMediaElement::loadInternal() { m_textTracksWhenResourceSelectionBegan.clear(); if (m_textTracks) { for (unsigned i = 0; i < m_textTracks->length(); ++i) { TextTrack* track = m_textTracks->anonymousIndexedGetter(i); if (track->mode() != TextTrack::disabledKeyword()) m_textTrack...
0
22,718
Analyze the following 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 serpent_init(void) { u64 xcr0; if (!cpu_has_avx || !cpu_has_osxsave) { printk(KERN_INFO "AVX instructions are not detected.\n"); return -ENODEV; } xcr0 = xgetbv(XCR_XFEATURE_ENABLED_MASK); if ((xcr0 & (XSTATE_SSE | XSTATE_YMM)) != (XSTATE_SSE | XSTATE_YMM)) { printk(KERN_INFO "AVX d...
0
22,220
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: scoped_refptr<ComputedStyle> Document::StyleForPage(int page_index) { UpdateDistribution(); return EnsureStyleResolver().StyleForPage(page_index); } Commit Message: Fixed bug where PlzNavigate CSP in a iframe did not get the inherited CSP When inheriting the CSP from a parent document to a local-scheme CSP,...
0
1,229
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LayoutRect RenderBox::clipRect(const LayoutPoint& location) { LayoutRect borderBoxRect = this->borderBoxRect(); LayoutRect clipRect = LayoutRect(borderBoxRect.location() + location, borderBoxRect.size()); if (!style()->clipLeft().isAuto()) { LayoutUnit c = valueForLength(style()->clipLeft(), ...
0
9,161
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, u64 volatile_fid, int level) { struct smb2_query_info_rsp *rsp = NULL; struct kvec iov; int rc = 0; int resp_buftype, max_len, min_len; struct cifs_ses *ses = tcon->ses; unsigned int rsp_len, offset; if (level == FS_D...
0
22,823
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BrowserNonClientFrameViewAura::GetThemeFrameOverlayBitmap() const { ui::ThemeProvider* tp = GetThemeProvider(); if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && browser_view()->IsBrowserTypeNormal() && !browser_view()->IsOffTheRecord()) { return tp->GetBitmapNamed(ShouldPaintAsActive() ? ...
0
20,314
Analyze the following 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_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr, png_unknown_chunkpp unknowns) { if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL) { *unknowns = info_ptr->unknown_chunks; return ((png_uint_32)info_ptr->unknown_chunks_num); } return (0); } Commit Messag...
0
8,260
Analyze the following 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 vfs_unlink(struct inode *dir, struct dentry *dentry, struct inode **delegated_inode) { struct inode *target = dentry->d_inode; int error = may_delete(dir, dentry, 0); if (error) return error; if (!dir->i_op->unlink) return -EPERM; mutex_lock(&target->i_mutex); if (is_local_mountpoint(dentry)) e...
0
180
Analyze the following 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_data_region (struct tar_sparse_file *file, size_t i) { off_t size_left; if (!lseek_or_error (file, file->stat_info->sparse_map[i].offset)) return false; size_left = file->stat_info->sparse_map[i].numbytes; mv_size_left (file->stat_info->archive_file_size - file->dumped_size); while (size_lef...
0
27,081
Analyze the following 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 ubifs_invalidatepage(struct page *page, unsigned int offset, unsigned int length) { struct inode *inode = page->mapping->host; struct ubifs_info *c = inode->i_sb->s_fs_info; ubifs_assert(PagePrivate(page)); if (offset || length < PAGE_CACHE_SIZE) /* Partial page remains dirty */ return; ...
0
2,765
Analyze the following 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_da_compname( struct xfs_da_args *args, const unsigned char *name, int len) { return (args->namelen == len && memcmp(args->name, name, len) == 0) ? XFS_CMP_EXACT : XFS_CMP_DIFFERENT; } Commit Message: xfs: fix directory hash ordering bug Commit f5ea1100 ("xfs: add CRCs to dir2/da node blocks") intr...
0
1,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: void hash_save_key(char *key, void *value, GSList **list) { *list = g_slist_append(*list, key); } Commit Message: Merge branch 'security' into 'master' Security Closes #10 See merge request !17 CWE ID: CWE-416
0
4,938
Analyze the following 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 ColorChooserWin::OnColorChooserDialogClosed() { if (color_chooser_dialog_.get()) { color_chooser_dialog_->ListenerDestroyed(); color_chooser_dialog_ = NULL; } DCHECK(current_color_chooser_ == this); current_color_chooser_ = NULL; if (web_contents_) web_contents_->DidEndColorChooser(); }...
0
28,212
Analyze the following 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 RightAlignedView::ChildPreferredSizeChanged(View* child) { Layout(); } Commit Message: [cros] Allow media streaming for OOBE WebUI. BUG=122764 TEST=Manual with --enable-html5-camera Review URL: https://chromiumcodereview.appspot.com/10693027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144899 ...
0
26,611
Analyze the following 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 long compute_finetune(unsigned long base_freq, int bend, int range, int vibrato_cents) { unsigned long amount; int negative, semitones, cents, multiplier = 1; if (!bend) return base_freq; if (!range) return base_freq; if (!base_freq) return base_freq; if (range >= 8192) range = 8192; ...
0
24,090
Analyze the following 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 InspectorPageAgent::navigate(ErrorString*, const String& url) { UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture); Frame* frame = m_page->mainFrame(); FrameLoadRequest request(frame->document(), ResourceRequest(frame->document()->completeURL(url))); frame->loader().load(reque...
0
9,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: dissect_common_outer_loop_power_control(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info _U_) { return dissect_dch_outer_loop_power_control(tree, pinfo, tvb, offset); } Commit Message: UMTS_FP: fix handling reserved C/T value ...
0
26,951
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _polkit_subject_get_cmdline (PolkitSubject *subject, gint *pid, gint *uid) { PolkitSubject *process; gchar *ret; gchar *filename; gchar *contents; gsize contents_len; GError *error; guint n; g_return_val_if_fail (subject != NULL, NULL); error = NULL; ret = NULL; process = NULL; filename...
0
29,098
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: compute_nhash (uschar *subject, int value1, int value2, int *len) { uschar *s = subject; int i = 0; unsigned long int total = 0; /* no overflow */ while (*s != 0) { if (i == 0) i = sizeof(prime)/sizeof(int) - 1; total += prime[i--] * (unsigned int)(*s++); } /* If value2 is unset, just compute one number...
0
19,329
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _rpc_reboot(slurm_msg_t *msg) { char *reboot_program, *cmd = NULL, *sp; reboot_msg_t *reboot_msg; slurm_ctl_conf_t *cfg; uid_t req_uid = g_slurm_auth_get_uid(msg->auth_cred, conf->auth_info); int exit_code; if (!_slurm_authorized_user(req_uid)) error("Security violation, reboot RPC from uid %d"...
0
12,157