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: MagickExport MagickBooleanType BlobToFile(char *filename,const void *blob, const size_t length,ExceptionInfo *exception) { int file; register size_t i; ssize_t count; assert(filename != (const char *) NULL); (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename); assert(blo...
0
17,054
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: getname_flags(const char __user *filename, int flags, int *empty) { struct filename *result; char *kname; int len; result = audit_reusename(filename); if (result) return result; result = __getname(); if (unlikely(!result)) return ERR_PTR(-ENOMEM); /* * First, try to embed the struct filename insi...
0
18,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: int Splash::getLineDashLength() { return state->lineDashLength; } Commit Message: CWE ID: CWE-189
0
12,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: bool SerializedScriptValue::extractTransferables(v8::Local<v8::Value> value, int argumentIndex, MessagePortArray& ports, ArrayBufferArray& arrayBuffers, ExceptionState& exceptionState, v8::Isolate* isolate) { if (isUndefinedOrNull(value)) { ports.resize(0); arrayBuffers.resize(0); retu...
0
20,047
Analyze the following 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 icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info, const struct in6_addr *force_saddr) { struct net *net = dev_net(skb->dev); struct inet6_dev *idev = NULL; struct ipv6hdr *hdr = ipv6_hdr(skb); struct sock *sk; struct ipv6_pinfo *np; const struct in6_addr *saddr = NULL; stru...
1
28,624
Analyze the following 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 btif_hl_clean_mdl_cb(btif_hl_mdl_cb_t *p_dcb) { BTIF_TRACE_DEBUG("%s", __FUNCTION__ ); btif_hl_free_buf((void **) &p_dcb->p_rx_pkt); btif_hl_free_buf((void **) &p_dcb->p_tx_pkt); memset(p_dcb, 0 , sizeof(btif_hl_mdl_cb_t)); } Commit Message: DO NOT MERGE Fix potential DoS caused by de...
0
17,123
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static AttrNodeListMap& attrNodeListMap() { DEFINE_STATIC_LOCAL(AttrNodeListMap, map, ()); return map; } Commit Message: Set Attr.ownerDocument in Element#setAttributeNode() Attr objects can move across documents by setAttributeNode(). So It needs to reset ownerDocument through TreeScopeAdoptr::adoptIfN...
0
13,144
Analyze the following 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 em_div_ex(struct x86_emulate_ctxt *ctxt) { u8 de = 0; emulate_1op_rax_rdx(ctxt, "div", de); if (de) return emulate_de(ctxt); return X86EMUL_CONTINUE; } Commit Message: KVM: x86: fix missing checks in syscall emulation On hosts without this patch, 32bit guests will crash (and 64bit guests may b...
0
27,610
Analyze the following 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 jspReplaceWith(JsVar *dst, JsVar *src) { if (jsvIsArrayBufferName(dst)) { size_t idx = (size_t)jsvGetInteger(dst); JsVar *arrayBuffer = jsvLock(jsvGetFirstChild(dst)); jsvArrayBufferSet(arrayBuffer, idx, src); jsvUnLock(arrayBuffer); return; } if (!jsvIsName(dst)) { jsExceptionH...
0
23,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: const AtomicString& VideoKindToString( WebMediaPlayerClient::VideoTrackKind kind) { switch (kind) { case WebMediaPlayerClient::VideoTrackKindNone: return emptyAtom; case WebMediaPlayerClient::VideoTrackKindAlternative: return VideoTrack::alternativeKeyword(); case WebMediaPlayerClien...
0
25,384
Analyze the following 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 uas_suspend(struct usb_interface *intf, pm_message_t message) { struct Scsi_Host *shost = usb_get_intfdata(intf); struct uas_dev_info *devinfo = (struct uas_dev_info *)shost->hostdata; if (uas_wait_for_pending_cmnds(devinfo) != 0) { shost_printk(KERN_ERR, shost, "%s: timed out\n", __func__); re...
0
25,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: void Document::Trace(Visitor* visitor) { visitor->Trace(imports_controller_); visitor->Trace(doc_type_); visitor->Trace(implementation_); visitor->Trace(autofocus_element_); visitor->Trace(focused_element_); visitor->Trace(sequential_focus_navigation_starting_point_); visitor->Trace(hover_element_);...
0
841
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static unsigned char *AcquireCompactPixels(const Image *image, ExceptionInfo *exception) { size_t packet_size; unsigned char *compact_pixels; packet_size=image->depth > 8UL ? 2UL : 1UL; compact_pixels=(unsigned char *) AcquireQuantumMemory((9* image->columns)+1,packet_size*sizeof(*compact_...
0
22,125
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: blink::WebEncryptedMediaClient* RenderFrameImpl::EncryptedMediaClient() { return media_factory_.EncryptedMediaClient(); } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introd...
0
28,158
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: new_decoder_state (void) { DECODER_STATE ds; ds = xmalloc (sizeof (*ds) + 99*sizeof(DECODER_STATE_ITEM)); ds->stacksize = 100; ds->idx = 0; ds->cur.node = NULL; ds->cur.went_up = 0; ds->cur.in_seq_of = 0; ds->cur.in_any = 0; ds->cur.again = 0; ds->cur.next_tag = 0; ds->cur.length = 0; ds-...
0
17,426
Analyze the following 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 bond_set_lockdep_class_one(struct net_device *dev, struct netdev_queue *txq, void *_unused) { lockdep_set_class(&txq->_xmit_lock, &bonding_netdev_xmit_lock_key); } Commit Message: net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch...
0
23,489
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: resolveEmphasisWords(EmphasisInfo *buffer, const EmphasisClass class, const InString *input, unsigned int *wordBuffer) { int in_word = 0, in_emp = 0, word_stop; // booleans int word_start = -1; // input position unsigned int word_whole = 0; // wordBuffer value int i; for (i = 0; i < input->length...
0
7,086
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int devinet_sysctl_register(struct in_device *idev) { return 0; } Commit Message: ipv4: Don't do expensive useless work during inetdev destroy. When an inetdev is destroyed, every address assigned to the interface is removed. And in this scenerio we do two pointless things which can be very expensive i...
0
25,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: int modbus_receive(modbus_t *ctx, uint8_t *req) { if (ctx == NULL) { errno = EINVAL; return -1; } return ctx->backend->receive(ctx, req); } Commit Message: Fix VD-1301 and VD-1302 vulnerabilities This patch was contributed by Maor Vermucht and Or Peles from VDOO Connected Trust. CWE...
0
21,965
Analyze the following 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 sas_scsi_clear_queue_I_T(struct list_head *error_q, struct domain_device *dev) { struct scsi_cmnd *cmd, *n; list_for_each_entry_safe(cmd, n, error_q, eh_entry) { struct domain_device *x = cmd_to_domain_dev(cmd); if (x == dev) sas_eh_finish_cmd(cmd); } } Commit Message: scsi: libs...
0
25,148
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PluginSet& PluginsPendingDispose() { DEFINE_STATIC_LOCAL(PluginSet, set, ()); return set; } Commit Message: Resource Timing: Do not report subsequent navigations within subframes We only want to record resource timing for the load that was initiated by parent document. We filter out subsequent navigations f...
0
335
Analyze the following 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 reuse_swap_page(struct page *page) { int count; VM_BUG_ON(!PageLocked(page)); if (unlikely(PageKsm(page))) return 0; count = page_mapcount(page); if (count <= 1 && PageSwapCache(page)) { count += page_swapcount(page); if (count == 1 && !PageWriteback(page)) { delete_from_swap_cache(page); Se...
0
27,854
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Range::selectNodeContents(Node* refNode, ExceptionCode& ec) { if (!m_start.container()) { ec = INVALID_STATE_ERR; return; } if (!refNode) { ec = NOT_FOUND_ERR; return; } for (Node* n = refNode; n; n = n->parentNode()) { switch (n->nodeType()) { ...
0
22,479
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline bool nested_svm_intr(struct vcpu_svm *svm) { if (!is_guest_mode(&svm->vcpu)) return true; if (!(svm->vcpu.arch.hflags & HF_VINTR_MASK)) return true; if (!(svm->vcpu.arch.hflags & HF_HIF_MASK)) return false; /* * if vmexit was already requested (by intercepted exception * for instanc...
0
29,194
Analyze the following 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 ScopedFrameBlamer::LeaveContext() { LocalFrameClient* client = frame_->Client(); if (!client) return; if (BlameContext* context = client->GetFrameBlameContext()) context->Leave(); } Commit Message: Prevent sandboxed documents from reusing the default window Bug: 377995 Change-Id: Iff66c6d214d...
0
9,451
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ExprCreateFieldRef(xkb_atom_t element, xkb_atom_t field) { EXPR_CREATE(ExprFieldRef, expr, EXPR_FIELD_REF, EXPR_TYPE_UNKNOWN); expr->field_ref.element = element; expr->field_ref.field = field; return expr; } Commit Message: xkbcomp: fix pointer value for FreeStmt Signed-off-by: Peter Hutterer <p...
0
11,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: int kvm_get_dirty_log_protect(struct kvm *kvm, struct kvm_dirty_log *log, bool *flush) { struct kvm_memslots *slots; struct kvm_memory_slot *memslot; int i, as_id, id; unsigned long n; unsigned long *dirty_bitmap; unsigned long *dirty_bitmap_buffer; as_id = log->slot >> 16; id = (u16)log->slot; if (a...
0
20,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: static void _convert_job_mem(slurm_msg_t *msg) { prolog_launch_msg_t *req = (prolog_launch_msg_t *)msg->data; slurm_cred_arg_t arg; hostset_t j_hset = NULL; int rc, hi, host_index, job_cpus; int i, i_first_bit = 0, i_last_bit = 0; rc = slurm_cred_verify(conf->vctx, req->cred, &arg, msg->protocol_...
0
19,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: fst_rx_config(struct fst_port_info *port) { int i; int pi; unsigned int offset; unsigned long flags; struct fst_card_info *card; pi = port->index; card = port->card; spin_lock_irqsave(&card->card_lock, flags); for (i = 0; i < NUM_RX_BUFFER; i++) { offset = BUF_OFFSET(rxBuffer[pi][i][0]); FST_WRW(ca...
0
5,924
Analyze the following 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 Disable() { base::AutoLock lock(enabled_lock_); enabled_ = false; } Commit Message: Switching AudioOutputAuthorizationHandler from using AudioManager interface to AudioSystem one. BUG=672468 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromiu...
0
11,577
Analyze the following 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 BrowserCommandController::AddInterstitialObservers(WebContents* contents) { registrar_.Add(this, content::NOTIFICATION_INTERSTITIAL_ATTACHED, content::Source<WebContents>(contents)); registrar_.Add(this, content::NOTIFICATION_INTERSTITIAL_DETACHED, content::Source<WebCon...
0
22,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: void InspectorPageAgent::setEmulatedMedia(ErrorString*, const String& media) { String currentMedia = m_state->getString(PageAgentState::pageAgentEmulatedMedia); if (media == currentMedia) return; m_state->setString(PageAgentState::pageAgentEmulatedMedia, media); Document* document = 0; ...
0
16,321
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void InstallablePaymentAppCrawler::OnPaymentMethodManifestDownloaded( const GURL& method_manifest_url, const std::string& content) { number_of_payment_method_manifest_to_download_--; if (content.empty()) { FinishCrawlingPaymentAppsIfReady(); return; } number_of_payment_method_manifest_to_...
0
21,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: 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
27,757
Analyze the following 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 do_set_pte(struct vm_area_struct *vma, unsigned long address, struct page *page, pte_t *pte, bool write, bool anon) { pte_t entry; flush_icache_page(vma, page); entry = mk_pte(page, vma->vm_page_prot); if (write) entry = maybe_mkwrite(pte_mkdirty(entry), vma); if (anon) { inc_mm_counter_fast(vma-...
0
27,437
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void LayerTreeCoordinator::attachLayer(CoordinatedGraphicsLayer* layer) { ASSERT(!m_registeredLayers.contains(layer)); m_registeredLayers.add(layer); layer->setContentsScale(m_contentsScale); layer->adjustVisibleRect(); } Commit Message: [WK2] LayerTreeCoordinator should release unused UpdatedAt...
0
7,317
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: writeRandomBytes_getrandom_nonblock(void * target, size_t count) { int success = 0; /* full count bytes written? */ size_t bytesWrittenTotal = 0; const unsigned int getrandomFlags = GRND_NONBLOCK; do { void * const currentTarget = (void*)((char*)target + bytesWrittenTotal); const size_t bytesToW...
0
2,060
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vips_foreign_save_dispose( GObject *gobject ) { VipsForeignSave *save = VIPS_FOREIGN_SAVE( gobject ); VIPS_UNREF( save->ready ); G_OBJECT_CLASS( vips_foreign_save_parent_class )->dispose( gobject ); } Commit Message: fix a crash with delayed load If a delayed load failed, it could leave the pipeline only h...
0
2,334
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OMX_BUFFERHEADERTYPE *OMXNodeInstance::findBufferHeader(OMX::buffer_id buffer) { if (buffer == 0) { return NULL; } Mutex::Autolock autoLock(mBufferIDLock); return mBufferIDToBufferHeader.valueFor(buffer); } Commit Message: IOMX: Enable buffer ptr to buffer id translation for arm32 Bug: 20634516 Change-Id: ...
0
39
Analyze the following 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 ifbw_add(IFBW *ptr) { assert(ptr); if (ifbw != NULL) ptr->next = ifbw; ifbw = ptr; } Commit Message: security fix CWE ID: CWE-269
0
21,610
Analyze the following 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 java_set_function_prototype (RAnal *anal, RAnalFunction *fcn, RBinJavaField *method) { RList *the_list = r_bin_java_extract_type_values (method->descriptor); Sdb *D = anal->sdb_types; Sdb *A = anal->sdb_args; const char *type_fmt = "%08"PFMT64x".arg.%d.type", *namek_fmt = "%08"PFMT64x".var.%...
0
7,097
Analyze the following 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 activityLoggingSetterForAllWorldsLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingSetterForAllWorldsLongAttribute", "TestObjectPython", info.Holder(), info.GetIsolat...
0
190
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void git_delta_index_free(git_delta_index *index) { git__free(index); } Commit Message: delta: fix out-of-bounds read of delta When computing the offset and length of the delta base, we repeatedly increment the `delta` pointer without checking whether we have advanced past its end already, which can thus resul...
0
1,717
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OfflineLoadPage::OfflineLoadPage(TabContents* tab_contents, const GURL& url, Delegate* delegate) : ChromeInterstitialPage(tab_contents, true, url), delegate_(delegate), proceeded_(false), ALLOW_THIS_IN_INITIALIZER_LIST(method_...
0
19,334
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gs_malloc_unwrap(gs_memory_t *wrapped) { #ifdef USE_RETRY_MEMORY_WRAPPER gs_memory_retrying_t *rmem = (gs_memory_retrying_t *)wrapped; gs_memory_t *contents = gs_memory_retrying_target(rmem); gs_free_object(wrapped rmem, "gs_malloc_unwrap(retrying)"); return (gs_malloc_memory_t *)contents; #else ...
0
23,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 MagickBooleanType WriteMVGImage(const ImageInfo *image_info,Image *image) { const char *value; MagickBooleanType status; /* Open output image file. */ assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickSignature); assert(image != (Image *) NULL...
0
29,727
Analyze the following 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::updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks runPostLayoutTasks) { DocumentLifecycle::PreventThrottlingScope preventThrottling(lifecycle()); updateLayoutTreeIgnorePendingStylesheets(); updateLayout(); if (runPostLayoutTasks == RunPostLayoutTasksSynchronously &...
0
13,160
Analyze the following 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_class_initialize(mrb_state *mrb, mrb_value c) { mrb_value a, b; mrb_get_args(mrb, "|C&", &a, &b); if (!mrb_nil_p(b)) { mrb_yield_with_class(mrb, b, 1, &c, c, mrb_class_ptr(c)); } return c; } Commit Message: `mrb_class_real()` did not work for `BasicObject`; fix #4037 CWE ID: CWE-476
0
27,322
Analyze the following 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 open_modern(const gchar *const addr, const gchar *const port, GError **const gerror) { struct addrinfo hints; struct addrinfo* ai = NULL; struct addrinfo* ai_bak; struct sock_flags; int e; int retval = -1; int i=0; int sock = -1; memset(&hints, '\0', sizeof(hints)); hints.ai_...
0
28,114
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int transport_read_layer(rdpTransport* transport, UINT8* data, int bytes) { int read = 0; int status = -1; while (read < bytes) { if (transport->layer == TRANSPORT_LAYER_TLS) status = tls_read(transport->TlsIn, data + read, bytes - read); else if (transport->layer == TRANSPORT_LAYER_TCP) status = t...
0
16,904
Analyze the following 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 RList *r_bin_wasm_get_import_entries (RBinWasmObj *bin, RBinWasmSection *sec) { RList *ret = NULL; RBinWasmImportEntry *ptr = NULL; if (!(ret = r_list_newf ((RListFree)free))) { return NULL; } ut8* buf = bin->buf->buf + (ut32)sec->payload_data; ut32 len = sec->payload_len; ut32 count = sec->cou...
0
19,825
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void t1_subset_end(PDF pdf) { if (t1_synthetic) { /*tex Copy to |dup /FontName get exch definefont pop|. */ while (!strstr(t1_line_array, "definefont")) { t1_getline(); t1_putline(pdf); } while (!t1_end_eexec()) { /*tex Ignore the rest...
0
24,767
Analyze the following 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 svcauth_gss_set_log_badverf_func( auth_gssapi_log_badverf_func func, caddr_t data) { log_badverf = func; log_badverf_data = data; } Commit Message: Fix gssrpc data leakage [CVE-2014-9423] [MITKRB5-SA-2015-001] In svcauth_gss_accept_sec_context(), do not copy bytes from the union context into the handle...
0
17,424
Analyze the following 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 page *read_cache_page_async(struct address_space *mapping, pgoff_t index, int (*filler)(void *,struct page*), void *data) { struct page *page; int err; retry: page = __read_cache_page(mapping, index, filler, data); if (IS_ERR(page)) return page; if (PageUptodate(page)) goto out; loc...
0
10,669
Analyze the following 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 __init void intel_arch_events_quirk(void) { int bit; /* disable event that reported as not presend by cpuid */ for_each_set_bit(bit, x86_pmu.events_mask, ARRAY_SIZE(intel_arch_events_map)) { intel_perfmon_event_map[intel_arch_events_map[bit].id] = 0; pr_warn("CPUID marked event: \'%s\' unavailable\...
0
17,555
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DEFINE_RUN_ONCE_STATIC(ossl_init_add_all_ciphers) { /* * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time * pulling in all the ciphers during static linking */ #ifndef OPENSSL_NO_AUTOALGINIT # ifdef OPENSSL_INIT_DEBUG fprintf(stderr, "OPENSSL_INIT: ossl_init_add_all_cipher...
0
13,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: int Equalizer_getParameter(EffectContext *pContext, void *pParam, uint32_t *pValueSize, void *pValue){ int status = 0; int bMute = 0; int32_t *pParamTemp = (int32_t *)pParam; int32_t param = *pParamTemp++; int32_t param2; char *name; switch (param) { case EQ_PARAM_NUM_BANDS: case EQ_PARAM_CUR_PRESET...
1
3,819
Analyze the following 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_cmap6_validate( FT_Byte* table, FT_Validator valid ) { FT_Byte* p; FT_UInt length, count; if ( table + 10 > valid->limit ) FT_INVALID_TOO_SHORT; p = table + 2; length = TT_NEXT_USHORT( p ); p = table + 8; /* skip language...
0
19,004
Analyze the following 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 ExtensionService::UpdateExtension( const std::string& id, const FilePath& extension_path, const GURL& download_url, CrxInstaller** out_crx_installer) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); PendingExtensionInfo pending_extension_info; bool is_pending_extension = pending...
0
26,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: CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer( int32 surface_id, CommandBufferProxy* share_group, const std::string& allowed_extensions, const std::vector<int32>& attribs, const GURL& active_url, gfx::GpuPreference gpu_preference) { #if defined(ENABLE_GPU) AutoLock lock(con...
0
12,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: void FS_ClearPakReferences( int flags ) { searchpath_t *search; if ( !flags ) { flags = -1; } for ( search = fs_searchpaths; search; search = search->next ) { if ( search->pack ) { search->pack->referenced &= ~flags; } } } Commit Message: All: Don't load .pk3s as .dlls, and don't load user config ...
0
26,908
Analyze the following 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 DelegatedFrameHost::OnFirstSurfaceActivation( const viz::SurfaceInfo& surface_info) { } Commit Message: mac: Make RWHVMac::ClearCompositorFrame clear locks Ensure that the BrowserCompositorMac not hold on to a compositor lock when requested to clear its compositor frame. This lock may be held indefinit...
0
24,933
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_FUNCTION(mcrypt_list_modes) { char **modules; char *lib_dir = MCG(modes_dir); int lib_dir_len; int i, count; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &lib_dir, &lib_dir_len) == FAILURE) { return; } array_init(return_value); modules = mcrypt_list_modes(lib_dir, &count); if...
0
21,933
Analyze the following 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 xfrm_send_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c) { switch (c->event) { case XFRM_MSG_NEWPOLICY: case XFRM_MSG_UPDPOLICY: case XFRM_MSG_DELPOLICY: return xfrm_notify_policy(xp, dir, c); case XFRM_MSG_FLUSHPOLICY: return xfrm_notify_policy_flush(c); case XFRM_...
0
14,617
Analyze the following 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 handle_id3(AVIOContext *pb, struct playlist *pls) { AVDictionary *metadata = NULL; ID3v2ExtraMetaAPIC *apic = NULL; ID3v2ExtraMeta *extra_meta = NULL; int64_t timestamp = AV_NOPTS_VALUE; parse_id3(pls->ctx, pb, &metadata, &timestamp, &apic, &extra_meta); if (timestamp != AV_N...
0
12,306
Analyze the following 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 Parcel::write(const FlattenableHelperInterface& val) { status_t err; const size_t len = val.getFlattenedSize(); const size_t fd_count = val.getFdCount(); if ((len > INT32_MAX) || (fd_count >= gMaxFds)) { return BAD_VALUE; } err = this->writeInt32(len); if (err) return err; err = this->...
0
6,747
Analyze the following 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 mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *zone) { unsigned long inactive_ratio; int nid = zone_to_nid(zone); int zid = zone_idx(zone); unsigned long inactive; unsigned long active; unsigned long gb; inactive = mem_cgroup_zone_nr_lru_pages(memcg, nid, zid, BIT(LRU_INA...
0
29,925
Analyze the following 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 _remove_job_running_prolog(uint32_t job_id) { ListIterator iter; uint32_t *job_running_prolog; bool found = false; slurm_mutex_lock(&conf->prolog_running_lock); iter = list_iterator_create(conf->prolog_running_jobs); while ((job_running_prolog = list_next(iter))) { if (*job_running_prolog =...
0
8,544
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void HTMLCanvasElement::RegisterRenderingContextFactory( std::unique_ptr<CanvasRenderingContextFactory> rendering_context_factory) { CanvasRenderingContext::ContextType type = rendering_context_factory->GetContextType(); DCHECK_LE(type, CanvasRenderingContext::kMaxValue); DCHECK(!RenderingContextF...
0
3,755
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: exsltDateDateTime (void) { xmlChar *ret = NULL; #ifdef WITH_TIME exsltDateValPtr cur; cur = exsltDateCurrent(); if (cur != NULL) { ret = exsltDateFormatDateTime(&(cur->value.date)); exsltDateFreeDate(cur); } #endif return ret; } Commit Message: Roll libxslt to 891681e3e948f31732229f53...
0
24,977
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TabLifecycleUnitSource::TabLifecycleUnit::TabLifecycleUnit( base::ObserverList<TabLifecycleObserver>* observers, content::WebContents* web_contents, TabStripModel* tab_strip_model) : LifecycleUnitBase(web_contents->GetVisibility()), content::WebContentsObserver(web_contents), observer...
0
24,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 CommandBufferProxyImpl::DestroyTransferBuffer(int32_t id) { CheckLock(); base::AutoLock lock(last_state_lock_); if (last_state_.error != gpu::error::kNoError) return; Send(new GpuCommandBufferMsg_DestroyTransferBuffer(route_id_, id)); } Commit Message: Correct mojo::WrapSharedMemoryHandle usage...
0
24,355
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode, kuid_t uid, kgid_t gid) { int rc = 0; int aclflag = CIFS_ACL_DACL; /* default flag to set */ __u32 secdesclen = 0; struct cifs_ntsd *pntsd = NULL; /* acl obtained from server */ struct cifs_ntsd *pnntsd = NULL; /* modified acl to be s...
0
10,475
Analyze the following 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 BaseMultipleFieldsDateAndTimeInputType::blur() { if (DateTimeEditElement* edit = dateTimeEditElement()) edit->blurByOwner(); } Commit Message: Fix reentrance of BaseMultipleFieldsDateAndTimeInputType::destroyShadowSubtree. destroyShadowSubtree could dispatch 'blur' event unexpectedly because el...
0
21,452
Analyze the following 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::InstallCreateHook( CreateRenderFrameImplFunction create_frame) { DCHECK(!g_create_render_frame_impl); g_create_render_frame_impl = create_frame; } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.Dis...
0
14,197
Analyze the following 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 megasas_register_types(void) { int i; type_register_static(&megasas_info); for (i = 0; i < ARRAY_SIZE(megasas_devices); i++) { const MegasasInfo *info = &megasas_devices[i]; TypeInfo type_info = {}; type_info.name = info->name; type_info.parent = TYPE_MEGA...
0
27,000
Analyze the following 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 CreateMediaPlayerRenderer(int process_id, int routing_id, RenderFrameHostDelegate* delegate, media::mojom::RendererRequest request) { std::unique_ptr<MediaPlayerRenderer> renderer = std::make_unique<MediaPlay...
0
46
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Ins_RCVT( TT_ExecContext exc, FT_Long* args ) { FT_ULong I = (FT_ULong)args[0]; if ( BOUNDSL( I, exc->cvtSize ) ) { if ( exc->pedantic_hinting ) ARRAY_BOUND_ERROR; else args[0] = 0; } else args[0] = exc->func_read_cvt( exc, I ); } ...
0
6,206
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void tcp_new_space(struct sock *sk) { struct tcp_sock *tp = tcp_sk(sk); if (tcp_should_expand_sndbuf(sk)) { tcp_sndbuf_expand(sk); tp->snd_cwnd_stamp = tcp_time_stamp; } sk->sk_write_space(sk); } Commit Message: tcp: make challenge acks less predictable Yue Cao claims that current host rate lim...
0
29,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: png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) { png_byte buf[32]; #ifdef PNG_FLOATING_POINT_SUPPORTED float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; #endif png_fixed_point int_x_white, int_y_white, int_x_red, int_y_red, int_x_green, int_y_gree...
0
8,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: long Segment::DoParseNext( const Cluster*& pResult, long long& pos, long& len) { long long total, avail; long status = m_pReader->Length(&total, &avail); if (status < 0) //error return status; assert((total < 0) || (avail <= total)); const long long segment_stop = ...
1
19,066
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void V8TestObject::LimitedWithEmptyMissingInvalidAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_limitedWithEmptyMissingInvalidAttribute_Getter"); test_object_v8_internal::LimitedWithEmptyMis...
0
24,752
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IntRect WebGLRenderingContextBase::SafeGetImageSize(Image* image) { if (!image) return IntRect(); return GetTextureSourceSize(image); } Commit Message: Reset ES3 pixel pack parameters and PIXEL_PACK_BUFFER binding in DrawingBuffer before ReadPixels() and recover them later. BUG=740603 TEST=new conforma...
0
25,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 inline int xstate_sigframe_size(void) { return use_xsave() ? fpu_user_xstate_size + FP_XSTATE_MAGIC2_SIZE : fpu_user_xstate_size; } Commit Message: x86/fpu: Don't let userspace set bogus xcomp_bv On x86, userspace can use the ptrace() or rt_sigreturn() system calls to set a task's extended state (xst...
0
9,066
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void perf_group_attach(struct perf_event *event) { struct perf_event *group_leader = event->group_leader, *pos; /* * We can have double attach due to group movement in perf_event_open. */ if (event->attach_state & PERF_ATTACH_GROUP) return; event->attach_state |= PERF_ATTACH_GROUP; if (group_...
0
24,871
Analyze the following 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 DOMWindow::CrossDomainAccessErrorMessage( const LocalDOMWindow* calling_window) const { if (!calling_window || !calling_window->document() || !GetFrame()) return String(); const KURL& calling_window_url = calling_window->document()->Url(); if (calling_window_url.IsNull()) return String()...
0
11,023
Analyze the following 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 sctp_v6_del_protocol(void) { inet6_del_protocol(&sctpv6_protocol, IPPROTO_SCTP); unregister_inet6addr_notifier(&sctp_inet6addr_notifier); } Commit Message: net: sctp: fix ipv6 ipsec encryption bug in sctp_v6_xmit Alan Chester reported an issue with IPv6 on SCTP that IPsec traffic is not being encrypted, ...
0
20,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: bool ContentSecurityPolicy::shouldSendViolationReport( const String& report) const { return !m_violationReportsSent.contains(report.impl()->hash()); } Commit Message: CSP: Strip the fragment from reported URLs. We should have been stripping the fragment from the URL we report for CSP violations, but we we...
0
17,115
Analyze the following 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 PVDecodeVopHeader(VideoDecControls *decCtrl, uint8 *buffer[], uint32 timestamp[], int32 buffer_size[], VopHeaderInfo *header_info, uint use_ext_timestamp [], uint8 *currYUV) { VideoDecData *video = (VideoDecData *) decCtrl->videoDecoderData; Vol *currVol; Vop *currVop = video->currVop; Vop **vopHeader =...
0
13,225
Analyze the following 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::DoPauseTransformFeedback() { api()->glPauseTransformFeedbackFn(); return error::kNoError; } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thr...
0
6,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: Document::~Document() { ASSERT(!layoutView()); ASSERT(!parentTreeScope()); ASSERT(!m_axObjectCache); #if !ENABLE(OILPAN) ASSERT(m_ranges.isEmpty()); ASSERT(!hasGuardRefCount()); ASSERT(!m_importsController); ASSERT(m_visibilityObservers.isEmpty()); if (m_templateDocument) ...
0
6,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: encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp) { struct dentry *dentry = fhp->fh_dentry; if (dentry && d_really_is_positive(dentry)) { __be32 err; struct kstat stat; err = fh_getattr(fhp, &stat); if (!err) { *p++ = xdr_one; /* attributes follow */ lease_get_mti...
0
28,076
Analyze the following 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 *ReadMNGImage(const ImageInfo *image_info, ExceptionInfo *exception) { Image *image; MagickBooleanType logging, status; MngInfo *mng_info; /* Open image file. */ assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickCoreSignature);...
0
29,602
Analyze the following 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 udf_translate_to_linux(uint8_t *newName, uint8_t *udfName, int udfLen, uint8_t *fidName, int fidNameLen) { int index, newIndex = 0, needsCRC = 0; int extIndex = 0, newExtIndex = 0, hasExt = 0; unsigned short valueCRC; uint8_t curr; if (udfName[0] == '.' && (udfLen == 1 || (udf...
1
1,310
Analyze the following 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 HTMLSelectElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const { if (!HTMLFormControlElementWithState::childShouldCreateRenderer(childContext)) return false; if (!usesMenuList()) return childContext.node()->hasTagName(HTMLNames::optionTag) || isHTMLOptGro...
0
9,433
Analyze the following 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 retrieveResourcesForElement(Element* element, Vector<LocalFrame*>* visitedFrames, Vector<LocalFrame*>* framesToVisit, Vector<KURL>* frameURLs, Vector<KURL>* resourceURLs) { ...
0
21,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: android::SoftOMXComponent *createSoftOMXComponent( const char *name, const OMX_CALLBACKTYPE *callbacks, OMX_PTR appData, OMX_COMPONENTTYPE **component) { return new android::SoftAMR(name, callbacks, appData, component); } Commit Message: SoftAMR: check output buffer size to avoid overflow. Bug: 276623...
0
25,767
Analyze the following 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 ntlm_write_message_fields_buffer(wStream* s, NTLM_MESSAGE_FIELDS* fields) { if (fields->Len > 0) { Stream_SetPosition(s, fields->BufferOffset); Stream_Write(s, fields->Buffer, fields->Len); } } Commit Message: Fixed CVE-2018-8789 Thanks to Eyal Itkin from Check Point Software Technologies. CWE ...
1
9,729
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SPL_METHOD(SplObjectStorage, key) { spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); if (zend_parse_parameters_none() == FAILURE) { return; } RETURN_LONG(intern->index); } /* }}} */ /* {{{ proto mixed SplObjectStorage::current() Commit Message: ...
0
28,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: void sysctl_head_finish(struct ctl_table_header *head) { if (!head) return; spin_lock(&sysctl_lock); unuse_table(head); spin_unlock(&sysctl_lock); } Commit Message: sysctl: restrict write access to dmesg_restrict When dmesg_restrict is set to 1 CAP_SYS_ADMIN is needed to read the kernel ring buffer. But ...
0
21,659