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: GF_Err def_cont_box_Read(GF_Box *s, GF_BitStream *bs) { return gf_isom_box_array_read(s, bs, gf_isom_box_add_default); } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
25,886
Analyze the following 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_shading_path_add_box(gx_path *ppath, const gx_device_color * pdevc) { gs_pattern2_instance_t *pinst = (gs_pattern2_instance_t *)pdevc->ccolor.pattern; const gs_shading_t *psh = pinst->templat.Shading; if (!psh->params.have_BBox) return_error(gs_error_unregistered); /* Do not call in thi...
0
4,226
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PluginInfoMessageFilter::Context::Context(int render_process_id, Profile* profile) : render_process_id_(render_process_id), resource_context_(profile->GetResourceContext()), host_content_settings_map_(profile->GetHostContentSettingsMap()) { allow_outdate...
0
3,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: static int snd_interval_refine_first(struct snd_interval *i) { if (snd_BUG_ON(snd_interval_empty(i))) return -EINVAL; if (snd_interval_single(i)) return 0; i->max = i->min; i->openmax = i->openmin; if (i->openmax) i->max++; return 1; } Commit Message: ALSA: pcm : Call kill_fasync() in stream lock Cu...
0
21,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: PassRefPtr<Element> Document::createElement(const AtomicString& name, ExceptionCode& ec) { if (!isValidName(name)) { ec = INVALID_CHARACTER_ERR; return 0; } if (m_isXHTML) return HTMLElementFactory::createHTMLElement(QualifiedName(nullAtom, name, xhtmlNamespaceURI), this, 0, f...
0
20,516
Analyze the following 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 copy_sighand(unsigned long clone_flags, struct task_struct *tsk) { struct sighand_struct *sig; if (clone_flags & (CLONE_SIGHAND | CLONE_THREAD)) { atomic_inc(&current->sighand->count); return 0; } sig = kmem_cache_alloc(sighand_cachep, GFP_KERNEL); rcu_assign_pointer(tsk->sighand, sig); if (...
0
5,814
Analyze the following 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 PaintController::UseCachedDrawingIfPossible( const DisplayItemClient& client, DisplayItem::Type type) { DCHECK(DisplayItem::IsDrawingType(type)); if (DisplayItemConstructionIsDisabled()) return false; if (!ClientCacheIsValid(client)) return false; if (RuntimeEnabledFeatures::PaintU...
0
19,278
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlElementContentPtr *result) { xmlElementContentPtr tree = NULL; int inputid = ctxt->input->id; int res; *result = NULL; if (RAW != '(') { xmlFatalErrMsgStr(ctxt, XML_ERR_ELEMCONTENT_NOT_STAR...
1
10,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 char** WM_LC_Tokenize_Line(char *line_data) { int line_length = (int) strlen(line_data); int token_data_length = 0; int line_ofs = 0; int token_start = 0; char **token_data = NULL; int token_count = 0; if (!line_length) return (NULL); do { /* ignore everything afte...
0
28,660
Analyze the following 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 RTCPeerConnectionHandler::ReportICEState( webrtc::PeerConnectionInterface::IceConnectionState new_state) { DCHECK(task_runner_->RunsTasksInCurrentSequence()); if (ice_state_seen_[new_state]) return; ice_state_seen_[new_state] = true; UMA_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.Connection...
0
21,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: static uint8_t dynamic_range_info(bitfile *ld, drc_info *drc) { uint8_t i, n = 1; uint8_t band_incr; drc->num_bands = 1; if (faad_get1bit(ld DEBUGVAR(1,90,"dynamic_range_info(): has instance_tag")) & 1) { drc->pce_instance_tag = (uint8_t)faad_getbits(ld, 4 DEBUGVA...
0
27,379
Analyze the following 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 ToColor_SI8_Raw(SkColor dst[], const void* src, int width, SkColorTable* ctable) { SkASSERT(width > 0); const uint8_t* s = (const uint8_t*)src; const SkPMColor* colors = ctable->lockColors(); do { SkPMColor c = colors[*s++]; *dst++ = SkColorSetARGB(SkGetPackedA32(c), SkGetPackedR32(c), SkGetPa...
0
15,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: PassRefPtr<Attr> Document::createAttributeNS(const String& namespaceURI, const String& qualifiedName, ExceptionState& es, bool shouldIgnoreNamespaceChecks) { String prefix, localName; if (!parseQualifiedName(qualifiedName, prefix, localName, es)) return 0; QualifiedName qName(prefix, localNam...
0
29,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: JsVar *jsvAsArrayIndexAndUnLock(JsVar *a) { JsVar *b = jsvAsArrayIndex(a); jsvUnLock(a); return b; } Commit Message: fix jsvGetString regression CWE ID: CWE-119
0
24,974
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: perf_event_exit_event(struct perf_event *child_event, struct perf_event_context *child_ctx, struct task_struct *child) { struct perf_event *parent_event = child_event->parent; /* * Do not destroy the 'original' grouping; because of the context * switch optimization the original events could...
0
10,500
Analyze the following 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 CallWithExecutionContextRaisesExceptionVoidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "callWithExecutionContextRaisesExceptionVoidMethodLongArg"); TestObject* impl = V8Te...
0
16,834
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mask_PaintProc(const gs_client_color * pcolor, gs_gstate * pgs) { const pixmap_info *ppmap = gs_getpattern(pcolor)->client_data; const gs_depth_bitmap *pbitmap = &(ppmap->bitmap); gs_image_enum *pen = gs_image_enum_alloc(gs_gstate_memory(pgs), "mask_PaintProc"); gs_image1_t mask; if (pen ...
0
15,193
Analyze the following 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 HTMLLinkElement::NotifyLoadedSheetAndAllCriticalSubresources( LoadedSheetErrorStatus error_status) { DCHECK(GetLinkStyle()); GetLinkStyle()->NotifyLoadedSheetAndAllCriticalSubresources(error_status); } Commit Message: Avoid crash when setting rel=stylesheet on <link> in shadow root. Link elements i...
0
17,184
Analyze the following 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 BOOLEAN btm_sec_set_security_level (CONNECTION_TYPE conn_type, char *p_name, UINT8 service_id, UINT16 sec_level, UINT16 psm, UINT32 mx_proto_id, UINT32 mx_chan_id) { tBTM_SEC_SERV_REC *p_srec; UINT16 ...
0
23,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: status_t MediaRecorder::setAudioEncoder(int ae) { ALOGV("setAudioEncoder(%d)", ae); if (mMediaRecorder == NULL) { ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (!mIsAudioSourceSet) { ALOGE("try to set the audio encoder without setting the audio source first...
0
24,795
Analyze the following 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 phar_spl_foreign_clone(spl_filesystem_object *src, spl_filesystem_object *dst) /* {{{ */ { phar_archive_data *phar_data = (phar_archive_data *) dst->oth; if (!phar_data->is_persistent) { ++(phar_data->refcount); } } /* }}} */ Commit Message: CWE ID: CWE-20
0
2,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 PageHandler::CaptureScreenshot( Maybe<std::string> format, Maybe<int> quality, Maybe<Page::Viewport> clip, Maybe<bool> from_surface, std::unique_ptr<CaptureScreenshotCallback> callback) { if (!host_ || !host_->GetRenderWidgetHost() || !host_->GetRenderWidgetHost()->GetView()) { ...
0
2,906
Analyze the following 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 usb_sg_cancel(struct usb_sg_request *io) { unsigned long flags; int i, retval; spin_lock_irqsave(&io->lock, flags); if (io->status) { spin_unlock_irqrestore(&io->lock, flags); return; } /* shut everything down */ io->status = -ECONNRESET; spin_unlock_irqrestore(&io->lock, flags); for (i = io->...
0
24,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: 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
27,373
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Browser* BrowserInit::LaunchWithProfile::OpenURLsInBrowser( Browser* browser, bool process_startup, const std::vector<GURL>& urls) { std::vector<Tab> tabs; UrlsToTabs(urls, &tabs); return OpenTabsInBrowser(browser, process_startup, tabs); } Commit Message: chromeos: Move audio, power, and UI fi...
0
2,998
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebPresentationClient* presentationClient(ExecutionContext* executionContext) { ASSERT(executionContext && executionContext->isDocument()); Document* document = toDocument(executionContext); if (!document->frame()) return nullptr; PresentationController* controller = PresentationController::fro...
0
1,435
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void tg3_carrier_off(struct tg3 *tp) { netif_carrier_off(tp->dev); tp->link_up = false; } Commit Message: tg3: fix length overflow in VPD firmware parsing Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version when present") introduced VPD parsing that contained a potential length ov...
0
21,377
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: String Document::outgoingOrigin() const { return securityOrigin()->toString(); } Commit Message: Change Document::detach() to RELEASE_ASSERT all subframes are gone. BUG=556724,577105 Review URL: https://codereview.chromium.org/1667573002 Cr-Commit-Position: refs/heads/master@{#373642} CWE ID: CWE-264
0
9,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 void _ewk_frame_smart_resize(Evas_Object* ewkFrame, Evas_Coord width, Evas_Coord height) { EWK_FRAME_SD_GET(ewkFrame, smartData); evas_object_resize(smartData->base.clipper, width, height); #ifdef EWK_FRAME_DEBUG evas_object_resize(smartData->region, width, height); Evas_Coord x, y; ev...
0
14,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 uint32_t luminocity(uint32_t x) { int r = (x >> 16) & 0xff; int g = (x >> 8) & 0xff; int b = (x >> 0) & 0xff; int y = (r*19661+g*38666+b*7209 + 32829)>>16; return y << 24; } Commit Message: CWE ID: CWE-189
0
6,666
Analyze the following 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 ktime_t common_hrtimer_remaining(struct k_itimer *timr, ktime_t now) { struct hrtimer *timer = &timr->it.real.timer; return __hrtimer_expires_remaining_adjusted(timer, now); } Commit Message: posix-timers: Sanitize overrun handling The posix timer overrun handling is broken because the forwarding func...
0
17,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: int kvm_arch_hardware_enable(void *garbage) { struct kvm *kvm; struct kvm_vcpu *vcpu; int i; kvm_shared_msr_cpu_online(); list_for_each_entry(kvm, &vm_list, vm_list) kvm_for_each_vcpu(i, vcpu, kvm) if (vcpu->cpu == smp_processor_id()) kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); return kvm_x86_op...
0
15,254
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static zend_always_inline int zend_mm_bitset_find_zero(zend_mm_bitset *bitset, int size) { int i = 0; do { zend_mm_bitset tmp = bitset[i]; if (tmp != (zend_mm_bitset)-1) { return i * ZEND_MM_BITSET_LEN + zend_mm_bitset_nts(tmp); } i++; } while (i < size); return -1; } Commit Message: Fix bug #727...
0
18,663
Analyze the following 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 MagickOffsetType TIFFSeekCustomStream(const MagickOffsetType offset, const int whence,void *user_data) { PhotoshopProfile *profile; profile=(PhotoshopProfile *) user_data; switch (whence) { case SEEK_SET: default: { if (offset < 0) return(-1); profile->offset=...
1
2,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: static uint32_t GetEntryForIndexImpl(Isolate* isolate, JSObject* holder, FixedArrayBase* store, uint32_t index, PropertyFilter filter) { DisallowHeapAllocation no_gc; SeededNumberDictionary* dictionary = SeededNumberDictionary::cast(store); int entry = dictionary->FindEntry(isolate, index); if (entry == Se...
0
26,011
Analyze the following 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 RTCPeerConnectionHandler::GetStats( std::unique_ptr<blink::WebRTCStatsReportCallback> callback, blink::RTCStatsFilter filter) { DCHECK(task_runner_->RunsTasksInCurrentSequence()); signaling_thread()->PostTask( FROM_HERE, base::BindOnce(&GetRTCStatsOnSignalingThread, task_runner_, ...
0
4,366
Analyze the following 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::vector<uint32_t> GetPageNumbersFromPrintPageNumberRange( const PP_PrintPageNumberRange_Dev* page_ranges, uint32_t page_range_count) { std::vector<uint32_t> page_numbers; for (uint32_t index = 0; index < page_range_count; ++index) { for (uint32_t page_number = page_ranges[index].first_page_num...
0
20,714
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: do_des(uint32_t l_in, uint32_t r_in, uint32_t *l_out, uint32_t *r_out, int count, struct php_crypt_extended_data *data) { /* * l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format. */ uint32_t l, r, *kl, *kr, *kl1, *kr1; uint32_t f, r48l, r48r, saltbits; int round; if (count == 0) { return(...
0
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: void Document::NavigateLocalAdsFrames() { DCHECK(frame_); for (Frame* child = frame_->Tree().FirstChild(); child; child = child->Tree().TraverseNext(frame_)) { if (child->IsLocalFrame()) { if (ToLocalFrame(child)->IsAdSubframe()) { ToLocalFrame(child)->Navigate( FrameLoadR...
0
16,700
Analyze the following 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::ScrollFocusedEditableElementIntoRect( const gfx::Rect& rect) { blink::WebAutofillClient* autofill_client = frame_->AutofillClient(); if (has_scrolled_focused_editable_node_into_rect_ && rect == rect_for_scrolled_focused_editable_node_ && autofill_client) { autofill_client->...
0
25,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: namespace_ipsets_handler(vector_t *strvec) { if (!strvec) return; global_data->namespace_with_ipsets = true; } Commit Message: Add command line and configuration option to set umask Issue #1048 identified that files created by keepalived are created with mode 0666. This commit changes the default to 0644, ...
0
18,014
Analyze the following 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 DownloadManagerImpl::AddObserver(Observer* observer) { observers_.AddObserver(observer); } Commit Message: Downloads : Fixed an issue of opening incorrect download file When one download overwrites another completed download, calling download.open in the old download causes the new download to open, whic...
0
18,993
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: apr_status_t h2_stream_write_data(h2_stream *stream, const char *data, size_t len, int eos) { conn_rec *c = stream->session->c; apr_status_t status = APR_SUCCESS; apr_bucket_brigade *tmp; ap_assert(stream); if (!stream->input) { return APR_EOF; ...
0
25,749
Analyze the following 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 long get_memlimit(const char *cgroup) { char *memlimit_str = NULL; unsigned long memlimit = -1; if (cgfs_get_value("memory", cgroup, "memory.limit_in_bytes", &memlimit_str)) memlimit = strtoul(memlimit_str, NULL, 10); free(memlimit_str); return memlimit; } Commit Message: Implement priv...
0
22,998
Analyze the following 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::Size AutofillDialogViews::SuggestionView::GetPreferredSize() const { return gfx::Size(); } Commit Message: Clear out some minor TODOs. BUG=none Review URL: https://codereview.chromium.org/1047063002 Cr-Commit-Position: refs/heads/master@{#322959} CWE ID: CWE-20
0
7,309
Analyze the following 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 sha512_neon_export(struct shash_desc *desc, void *out) { struct sha512_state *sctx = shash_desc_ctx(desc); memcpy(out, sctx, sizeof(*sctx)); return 0; } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the ris...
0
18,773
Analyze the following 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 *crypto_default_geniv(const struct crypto_alg *alg) { if (((alg->cra_flags & CRYPTO_ALG_TYPE_MASK) == CRYPTO_ALG_TYPE_BLKCIPHER ? alg->cra_blkcipher.ivsize : alg->cra_ablkcipher.ivsize) != alg->cra_blocksize) return "chainiv"; return alg->cra_flags & CRYPTO_ALG_ASYNC ? "es...
0
11,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: void hsr_addr_subst_dest(struct hsr_node *node_src, struct sk_buff *skb, struct hsr_port *port) { struct hsr_node *node_dst; if (!skb_mac_header_was_set(skb)) { WARN_ONCE(1, "%s: Mac header not set\n", __func__); return; } if (!is_unicast_ether_addr(eth_hdr(skb)->h_dest)) return; node_dst = find...
0
5,385
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: float _WM_GetSamplesPerTick(uint32_t divisions, uint32_t tempo) { float microseconds_per_tick; float secs_per_tick; float samples_per_tick; /* Slow but needed for accuracy */ microseconds_per_tick = (float) tempo / (float) divisions; secs_per_tick = microseconds_per_tick / 1000000.0f; ...
0
19,338
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pdf14_pop_parent_color(gx_device *dev, const gs_gstate *pgs) { pdf14_device *pdev = (pdf14_device *)dev; pdf14_parent_color_t *old_parent_color_info = pdev->trans_group_parent_cmap_procs; if_debug0m('v', dev->memory, "[v]pdf14_pop_parent_color\n"); /* We need to compliment pdf14_push_parent color...
0
24,036
Analyze the following 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 FrameLoader::LoadInSameDocument( const KURL& url, scoped_refptr<SerializedScriptValue> state_object, FrameLoadType frame_load_type, HistoryItem* history_item, ClientRedirectPolicy client_redirect, Document* initiating_document) { DCHECK(!state_object || frame_load_type == kFrameLoad...
0
20,319
Analyze the following 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 ccid3_hc_tx_init(struct ccid *ccid, struct sock *sk) { struct ccid3_hc_tx_sock *hc = ccid_priv(ccid); hc->tx_state = TFRC_SSTATE_NO_SENT; hc->tx_hist = NULL; setup_timer(&hc->tx_no_feedback_timer, ccid3_hc_tx_no_feedback_timer, (unsigned long)sk); return 0; } Commit Message: dccp: fix info l...
0
15,366
Analyze the following 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 FrameView::addWidgetToUpdate(RenderEmbeddedObject& object) { ASSERT(isInPerformLayout()); Node* node = object.node(); ASSERT(node); if (isHTMLObjectElement(*node) || isHTMLEmbedElement(*node)) toHTMLPlugInElement(node)->setNeedsWidgetUpdate(true); m_widgetUpdateSet.add(&object); ...
0
22,863
Analyze the following 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 armv8pmu_has_overflowed(u32 pmovsr) { return pmovsr & ARMV8_OVERFLOWED_MASK; } Commit Message: arm64: perf: reject groups spanning multiple HW PMUs The perf core implicitly rejects events spanning multiple HW PMUs, as in these cases the event->ctx will differ. However this validation is perfo...
0
25,508
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XineramaChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { Xinerama_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); Xinerama_GC_FUNC_EPILOGUE(pGC); } Commit Message: CWE ID: CWE-20
0
5,288
Analyze the following 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 CairoOutputDev::drawImageMaskRegular(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg) { unsigned char *buffer; unsigned char *dest; cairo_surface_t *image; cairo_pattern_t *pattern; int x, y; ImageStream *imgStr; Guchar *pix; cai...
0
24,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: static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */ { long val; char *endptr = NULL; #if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH) PS(hash_ops) = NULL; #endif val = strtol(new_value, &endptr, 10); if (endptr && (*endptr == '\0')) { /* Numeric value */ PS(hash_func) = val ? 1 : 0; return SUCCESS;...
0
21,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: dissect_dch_dl_node_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { return dissect_common_dl_node_synchronisation(pinfo, tree, tvb, offset); } Commit Message: UMTS_FP: fix handling reserved C/T value The spec puts the reserved value at 0xf but our internal table has 'unkno...
0
16,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 inline int cmp_addr(struct pppoe_addr *a, __be16 sid, char *addr) { return a->sid == sid && !memcmp(a->remote, addr, ETH_ALEN); } Commit Message: net: rework recvmsg handler msg_name and msg_namelen logic This patch now always passes msg->msg_namelen as 0. recvmsg handlers must set msg_namelen to the pr...
0
23,354
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OVS_REQUIRES(ofproto_mutex) { enum ofperr error; if (ofproto_group_exists(ofproto, ogm->gm.group_id)) { return OFPERR_OFPGMFC_GROUP_EXISTS; } if (ofproto->n_groups[ogm->gm.type] >= ofproto->ogf.max_groups[ogm->gm.type]) { return OFPERR_OFPGMFC_OUT_OF_GROUPS; } ...
0
13,295
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pdf14_determine_default_blend_cs(gx_device * pdev, bool use_pdf14_accum, bool *using_blend_cs) { /* If a blend color space was specified, then go ahead and use that to define the default color space for the blend modes. Only Gray, RGB or CMYK blend color spaces ...
0
4,798
Analyze the following 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 PassOwnPtr<ImageBufferSurface> createSurface(const IntSize& size, OpacityMode opacityMode) { m_createSurfaceCount++; return adoptPtr(new UnacceleratedImageBufferSurface(size, opacityMode)); } Commit Message: Add assertions that the empty Platform::cryptographicallyRandomValues...
0
14,567
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: addresses_are_duplicate (const NMPlatformIP4Address *a, const NMPlatformIP4Address *b, gboolean consider_plen) { return a->address == b->address && (!consider_plen || a->plen == b->plen); } Commit Message: CWE ID: CWE-20
0
27,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: static int pf_interception(struct vcpu_svm *svm) { u64 fault_address = svm->vmcb->control.exit_info_2; u32 error_code; int r = 1; switch (svm->apf_reason) { default: error_code = svm->vmcb->control.exit_info_1; trace_kvm_page_fault(fault_address, error_code); if (!npt_enabled && kvm_event_needs_reinj...
0
29,315
Analyze the following 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 CWebServer::RType_Devices(WebEmSession & session, const request& req, Json::Value &root) { std::string rfilter = request::findValue(&req, "filter"); std::string order = request::findValue(&req, "order"); std::string rused = request::findValue(&req, "used"); std::string rid = request::findValu...
0
9,441
Analyze the following 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 StubOfflinePageModel::SavePage( const SavePageParams& save_page_params, std::unique_ptr<OfflinePageArchiver> archiver, const SavePageCallback& callback) {} Commit Message: Add the method to check if offline archive is in internal dir Bug: 758690 Change-Id: I8bb4283fc40a87fa7a87df2c7e513e2e16903...
0
20,898
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: http_copyh(const struct http *to, const struct http *fm, unsigned n) { assert(n < HTTP_HDR_FIRST); Tcheck(fm->hd[n]); to->hd[n] = fm->hd[n]; to->hdf[n] = fm->hdf[n]; } Commit Message: Check for duplicate Content-Length headers in requests If a duplicate CL header is in the request, we fail the request with...
0
57
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AP_DECLARE(void **) ap_get_request_note(request_rec *r, apr_size_t note_num) { core_request_config *req_cfg; if (note_num >= num_request_notes) { return NULL; } req_cfg = (core_request_config *) ap_get_core_module_config(r->request_config); if (!req_cfg) { return NUL...
0
10,553
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: iperf_get_verbose(struct iperf_test *ipt) { return ipt->verbose; } Commit Message: Fix a buffer overflow / heap corruption issue that could occur if a malformed JSON string was passed on the control channel. This issue, present in the cJSON library, was already fixed upstream, so was addressed here in iperf...
0
1,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: void RenderView::logCrossFramePropertyAccess(WebFrame* frame, WebFrame* target, bool cross_origin, const WebString& property_name, uns...
0
11,730
Analyze the following 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 pin_request_callback(bt_bdaddr_t *bd_addr, bt_bdname_t *bdname, uint32_t cod, bool min_16_digits) { jbyteArray addr, devname; if (!checkCallbackThread()) { ALOGE("Callback: '%s' is not called on the correct thread", __FUNCTION__); return; } if (!bd_addr) { ALOGE("Address is nul...
0
19,046
Analyze the following 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 acpi_resources_are_enforced(void) { return acpi_enforce_resources == ENFORCE_RESOURCES_STRICT; } 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 option is true, it is possible t...
0
295
Analyze the following 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 stringArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::stringArrayMethodMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: document.location bind...
0
13,468
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gst_asf_demux_push_obj (GstASFDemux * demux, guint32 obj_id) { const gchar *nick; nick = gst_asf_get_guid_nick (asf_object_guids, obj_id); if (g_str_has_prefix (nick, "ASF_OBJ_")) nick += strlen ("ASF_OBJ_"); if (demux->objpath == NULL) { demux->objpath = g_strdup (nick); } else { gchar *n...
0
26,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: void MockDownloadController::StartContextMenuDownload( const content::ContextMenuParams& params, content::WebContents* web_contents, bool is_link, const std::string& extra_headers) { } Commit Message: Clean up Android DownloadManager code as most download now go through Chrome Network stack The only...
0
21,852
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: evdns_base_clear_nameservers_and_suspend(struct evdns_base *base) { struct nameserver *server, *started_at; int i; EVDNS_LOCK(base); server = base->server_head; started_at = base->server_head; if (!server) { EVDNS_UNLOCK(base); return 0; } while (1) { struct nameserver *next = server->next; (void...
0
12,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: epass2003_finish(sc_card_t *card) { epass2003_exdata *exdata = (epass2003_exdata *)card->drv_data; if (exdata) free(exdata); return SC_SUCCESS; } 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
21,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: __releases(ptl) { pte_t entry; /* * Clear the pages cpupid information as the existing * information potentially belongs to a now completely * unrelated process. */ if (page) page_cpupid_xchg_last(page, (1 << LAST_CPUPID_SHIFT) - 1); flush_cache_page(vma, address, pte_pfn(orig_pte)); entry = pte_...
0
21,769
Analyze the following 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 KioskNextHomeInterfaceBrokerImpl::GetAppController( mojom::AppControllerRequest request) { app_controller_->BindRequest(std::move(request)); } Commit Message: Refactor the AppController implementation into a KeyedService. This is necessary to guarantee that the AppController will not outlive the A...
1
15,732
Analyze the following 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 ras_puthdr(jas_stream_t *out, ras_hdr_t *hdr) { if (ras_putint(out, RAS_MAGIC) || ras_putint(out, hdr->width) || ras_putint(out, hdr->height) || ras_putint(out, hdr->depth) || ras_putint(out, hdr->length) || ras_putint(out, hdr->type) || ras_putint(out, hdr->maptype) || ras_putint(out, hdr->...
0
29,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: ofputil_append_port_desc_stats_reply(const struct ofputil_phy_port *pp, struct ovs_list *replies) { struct ofpbuf *reply = ofpbuf_from_list(ovs_list_back(replies)); size_t start_ofs = reply->size; ofputil_put_phy_port(ofpmp_version(replies), pp, reply); ofpmp_...
0
8,862
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int jffs2_acl_count(size_t size) { size_t s; size -= sizeof(struct jffs2_acl_header); s = size - 4 * sizeof(struct jffs2_acl_entry_short); if (s < 0) { if (size % sizeof(struct jffs2_acl_entry_short)) return -1; return size / sizeof(struct jffs2_acl_entry_short); } else { if (s % sizeof(stru...
0
4,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: static inline bool isalarm(struct timerfd_ctx *ctx) { return ctx->clockid == CLOCK_REALTIME_ALARM || ctx->clockid == CLOCK_BOOTTIME_ALARM; } Commit Message: timerfd: Protect the might cancel mechanism proper The handling of the might_cancel queueing is not properly protected, so parallel operations on the fi...
0
26,398
Analyze the following 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 OxideQQuickWebView::hoverLeaveEvent(QHoverEvent* event) { Q_D(OxideQQuickWebView); QQuickItem::hoverLeaveEvent(event); d->contents_view_->handleHoverLeaveEvent(event); } Commit Message: CWE ID: CWE-20
0
23,516
Analyze the following 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 crypt(struct blkcipher_desc *d, struct blkcipher_walk *w, struct priv *ctx, void (*tw)(struct crypto_tfm *, u8 *, const u8 *), void (*fn)(struct crypto_tfm *, u8 *, const u8 *)) { int err; unsigned int avail; const int bs = XTS_BLOCK_SIZE; struct sinfo s = { .tfm = crypto_cipher_tfm(ctx-...
0
22,361
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: daemon_msg_open_req(uint8 ver, struct daemon_slpars *pars, uint32 plen, char *source, size_t sourcelen) { char errbuf[PCAP_ERRBUF_SIZE]; // buffer for network errors char errmsgbuf[PCAP_ERRBUF_SIZE]; // buffer for errors to send to the client pcap_t *fp; // pcap_t main variable int nread; char sendbu...
0
11,188
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mrb_gc_mark(mrb_state *mrb, struct RBasic *obj) { if (obj == 0) return; if (!is_white(obj)) return; mrb_assert((obj)->tt != MRB_TT_FREE); add_gray_list(mrb, &mrb->gc, obj); } Commit Message: Clear unused stack region that may refer freed objects; fix #3596 CWE ID: CWE-416
0
16,155
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: download::DownloadItemImpl* DownloadManagerImpl::CreateActiveItem( uint32_t id, const download::DownloadCreateInfo& info) { DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(!base::ContainsKey(downloads_, id)); download::DownloadItemImpl* download = item_factory_->CreateActiveItem(this, id, ...
1
13,730
Analyze the following 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 hadamard8_diff8x8_c(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){ int i; int temp[64]; int sum=0; av_assert2(h==8); for(i=0; i<8; i++){ BUTTERFLY2(temp[8*i+0], temp[8*i+1], src[stride*i+0]-dst[stride*i+0],src[stride*i+1]-dst[stride*i+1]); ...
0
22,929
Analyze the following 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 mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom) { AVStream *st; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; if ((uint64_t)atom.size > (1<<30)) return AVERROR_INVALIDDATA; if (st->codec->codec_id == CODEC_ID_QDM2 || st...
0
11,218
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: explicit MockScreenshotManager(content::NavigationControllerImpl* owner) : content::NavigationEntryScreenshotManager(owner), encoding_screenshot_in_progress_(false) { } Commit Message: Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigatio...
0
5,361
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct sit_entry_set *grab_sit_entry_set(void) { struct sit_entry_set *ses = f2fs_kmem_cache_alloc(sit_entry_set_slab, GFP_NOFS); ses->entry_cnt = 0; INIT_LIST_HEAD(&ses->set_list); return ses; } Commit Message: f2fs: fix a panic caused by NULL flush_cmd_control Mount fs with option noflush_merge...
0
17,085
Analyze the following 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 GPUInfo& GpuDataManager::gpu_info() const { base::AutoLock auto_lock(gpu_info_lock_); return gpu_info_; } Commit Message: Fixing Coverity bugs (DEAD_CODE and PASS_BY_VALUE) CIDs 16230, 16439, 16610, 16635 BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/7215029 git-svn-id: svn://svn.ch...
0
20,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: status_t SoftMPEG2::setParams(size_t stride) { ivd_ctl_set_config_ip_t s_ctl_ip; ivd_ctl_set_config_op_t s_ctl_op; IV_API_CALL_STATUS_T status; s_ctl_ip.u4_disp_wd = (UWORD32)stride; s_ctl_ip.e_frm_skip_mode = IVD_SKIP_NONE; s_ctl_ip.e_frm_out_mode = IVD_DISPLAY_FRAME_OUT; s_ctl_ip.e_vid_de...
0
10,564
Analyze the following 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_status(const char *s) { s = imap_next_word((char *) s); if (mutt_str_strncasecmp("OK", s, 2) == 0) return IMAP_CMD_OK; if (mutt_str_strncasecmp("NO", s, 2) == 0) return IMAP_CMD_NO; return IMAP_CMD_BAD; } Commit Message: quote imap strings more carefully Co-authored-by: JerikoOn...
0
20,968
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: authentic_init_oberthur_authentic_3_2(struct sc_card *card) { struct sc_context *ctx = card->ctx; unsigned int flags; int rv = 0; LOG_FUNC_CALLED(ctx); flags = AUTHENTIC_CARD_DEFAULT_FLAGS; _sc_card_add_rsa_alg(card, 1024, flags, 0x10001); _sc_card_add_rsa_alg(card, 2048, flags, 0x10001); card->caps =...
0
25,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: int vmci_transport_send_read(struct sock *sk) { return vmci_transport_send_control_pkt( sk, VMCI_TRANSPORT_PACKET_TYPE_READ, 0, 0, NULL, VSOCK_PROTO_INVALID, VMCI_INVALID_HANDLE); } Commit Message: VSOCK: vmci - fix possible info leak in vmci_transport_dgram_dequeue() In case we received no data...
0
13,275
Analyze the following 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 RendererSchedulerImpl::TaskQueuePolicy::AsValueInto( base::trace_event::TracedValue* state) const { state->SetBoolean("is_enabled", is_enabled); state->SetBoolean("is_paused", is_paused); state->SetBoolean("is_throttled", is_throttled); state->SetBoolean("is_blocked", is_blocked); state->SetBoo...
0
22,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 void tcm_loop_fall_back_to_erl0(struct se_session *se_sess) { return; } Commit Message: loopback: off by one in tcm_loop_make_naa_tpg() This is an off by one 'tgpt' check in tcm_loop_make_naa_tpg() that could result in memory corruption. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: N...
0
25,839
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct task_struct *find_alive_thread(struct task_struct *p) { struct task_struct *t; for_each_thread(p, t) { if (!(t->flags & PF_EXITING)) return t; } return NULL; } Commit Message: fix infoleak in waitid(2) kernel_waitid() can return a PID, an error or 0. rusage is filled in the first case a...
0
20,115