instruction
stringclasses
1 value
input
stringlengths
56
241k
output
int64
0
1
__index_level_0__
int64
0
175k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int btrfs_find_actor(struct inode *inode, void *opaque) { struct btrfs_iget_args *args = opaque; return args->location->objectid == BTRFS_I(inode)->location.objectid && args->root == BTRFS_I(inode)->root; } Commit Message: Btrfs: fix truncation of compressed and inlined extents When truncating a file...
0
41,635
Analyze the following 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 GLES2DecoderImpl::HandleGetShaderSource( uint32_t immediate_data_size, const volatile void* cmd_data) { const volatile gles2::cmds::GetShaderSource& c = *static_cast<const volatile gles2::cmds::GetShaderSource*>(cmd_data); GLuint shader_id = c.shader; uint32_t bucket_id = static_c...
0
141,548
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gsf_infile_tar_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params) { GsfInfileTar *tar = (GsfInfileTar *) (parent_class->constructor (type, n_construct_properties, construct_params)); if (tar->source)...
0
47,703
Analyze the following 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& TextTrack::ChaptersKeyword() { DEFINE_STATIC_LOCAL(const AtomicString, chapters, ("chapters")); return chapters; } Commit Message: Support negative timestamps of TextTrackCue Ensure proper behaviour for negative timestamps of TextTrackCue. 1. Cues with negative startTime should become ac...
0
124,999
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: decode_address_from_payload(tor_addr_t *addr_out, const uint8_t *payload, int payload_len) { if (payload_len < 2) return NULL; if (payload_len < 2+payload[1]) return NULL; switch (payload[0]) { case RESOLVED_TYPE_IPV4: if (payload[1] != 4) return NULL; to...
0
69,856
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: keepalived_running(unsigned long mode) { if (process_running(main_pidfile)) return true; #ifdef _WITH_VRRP_ if (__test_bit(DAEMON_VRRP, &mode) && process_running(vrrp_pidfile)) return true; #endif #ifdef _WITH_LVS_ if (__test_bit(DAEMON_CHECKERS, &mode) && process_running(checkers_pidfile)) return true; ...
0
75,917
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool is_device_path(const char *path) { /* Returns true on paths that refer to a device, either in * sysfs or in /dev */ return path_startswith(path, "/dev/") || path_startswith(path, "/sys/"); } Commit Message: CWE ID: CWE-362
0
11,547
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebLocalFrameImpl::WebLocalFrameImpl( WebRemoteFrame* old_web_frame, WebLocalFrameClient* client, blink::InterfaceRegistry* interface_registry) : WebLocalFrameImpl(old_web_frame->InShadowTree() ? WebTreeScopeType::kShadow : WebTreeScopeType::...
0
145,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: store_read_imp(png_store *ps, png_bytep pb, png_size_t st) { if (ps->current == NULL || ps->next == NULL) png_error(ps->pread, "store state damaged"); while (st > 0) { size_t cbAvail = store_read_buffer_size(ps) - ps->readpos; if (cbAvail > 0) { if (cbAvail > st) cbAvail = st; memcpy(pb, p...
0
160,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 void ReadonlyEventTargetOrNullAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); V8SetReturnValueFast(info, WTF::GetPtr(impl->readonlyEventTargetOrNullAttribute()), impl); } Comm...
0
135,068
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: flatpak_proxy_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { FlatpakProxy *proxy = FLATPAK_PROXY (object); switch (prop_id) { case PROP_DBUS_ADDRESS: proxy...
0
84,389
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlStringDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int what, xmlChar end, xmlChar end2, xmlChar end3) { if ((ctxt == NULL) || (str == NULL)) return(NULL); return(xmlStringLenDecodeEntities(ctxt, str, xmlStrlen(str), what, end, end2, end3)); } Commit Message: DO NOT MERGE: ...
0
163,533
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int jpc_dec_cp_prepare(jpc_dec_cp_t *cp) { jpc_dec_ccp_t *ccp; int compno; int i; for (compno = 0, ccp = cp->ccps; compno < cp->numcomps; ++compno, ++ccp) { if (!(ccp->csty & JPC_COX_PRT)) { for (i = 0; i < JPC_MAXRLVLS; ++i) { ccp->prcwidthexpns[i] = 15; ccp->prcheightexpns[i] = 15; ...
0
70,409
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ssize_t btrfs_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size) { /* * If this is a request for a synthetic attribute in the system.* * namespace use the generic infrastructure to resolve a handler * for it via sb->s_xattr. */ if (!strncmp(name, XATTR_SYSTEM_PREFIX, X...
0
45,392
Analyze the following 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 ExtensionRegistry::AddDisabled( const scoped_refptr<const Extension>& extension) { return disabled_extensions_.Insert(extension); } Commit Message: [Extensions] Add GetInstalledExtension() method to ExtensionRegistry This CL adds GetInstalledExtension() method to ExtensionRegistry and uses it instead...
0
123,987
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const char *table, const char *achtung_wild TSRMLS_DC) { size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, list_fields); /* db + \0 + wild + \0 (for wild) */ zend_uchar buff[MYSQLND_MAX_ALLOWED_DB_LEN * 2 + 1 + 1], *p;...
0
14,276
Analyze the following 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 status_t useGraphicBuffer( node_id node, OMX_U32 port_index, const sp<GraphicBuffer> &graphicBuffer, buffer_id *buffer) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeInt32((int32_t)node); data.writeInt32(port_index); ...
0
160,698
Analyze the following 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 kind_Size(GF_Box *s) { GF_KindBox *ptr = (GF_KindBox *)s; ptr->size += strlen(ptr->schemeURI) + 1; if (ptr->value) { ptr->size += strlen(ptr->value) + 1; } return GF_OK; } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
80,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: STDMETHODIMP UrlmonUrlRequest::Authenticate(HWND* parent_window, LPWSTR* user_name, LPWSTR* password) { if (!parent_window) return E_INVALIDARG; if (privileged_mode_) return E_ACCESSDENIED; DCHECK(::IsWindow(pa...
0
100,939
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: update_zfs_share(sa_share_impl_t impl_share, const char *proto) { sa_handle_impl_t impl_handle = impl_share->handle; zfs_handle_t *zhp; update_cookie_t udata; if (impl_handle->zfs_libhandle == NULL) return (SA_SYSTEM_ERR); assert(impl_share->dataset != NULL); zhp = zfs_open(impl_share->handle->zfs_lib...
0
96,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: static long kvm_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { struct kvm *kvm = filp->private_data; void __user *argp = (void __user *)arg; int r; if (kvm->mm != current->mm) return -EIO; switch (ioctl) { case KVM_CREATE_VCPU: r = kvm_vm_ioctl_create_vcpu(kvm, arg); break...
0
71,268
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void* GLES2Implementation::MapBufferCHROMIUM(GLuint target, GLenum access) { GPU_CLIENT_SINGLE_THREAD_CHECK(); GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapBufferCHROMIUM(" << target << ", " << GLES2Util::GetStringEnum(access) << ")"); switch (target) { case GL_PIXEL_PACK_TRANSFE...
0
141,074
Analyze the following 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 SocketStreamDispatcherHost::OnSSLCertificateError( net::SocketStream* socket, const net::SSLInfo& ssl_info, bool fatal) { int socket_id = SocketStreamHost::SocketIdFromSocketStream(socket); DVLOG(1) << "SocketStreamDispatcherHost::OnSSLCertificateError socket_id=" << socket_id; if (socke...
1
170,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 int write_pipe_buf(struct pipe_inode_info *pipe, struct pipe_buffer *buf, struct splice_desc *sd) { int ret; void *data; loff_t tmp = sd->pos; data = kmap(buf->page); ret = __kernel_write(sd->u.file, data + buf->offset, sd->len, &tmp); kunmap(buf->page); return ret; } Commit Message: ->sp...
0
46,402
Analyze the following 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 OMX::CallbackDispatcher::dispatch(std::list<omx_message> &messages) { if (mOwner == NULL) { ALOGV("Would have dispatched a message to a node that's already gone."); return; } mOwner->onMessages(messages); } Commit Message: Add VPX output buffer size check and handle dead observers more grace...
0
160,969
Analyze the following 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 __page_check_anon_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address) { #ifdef CONFIG_DEBUG_VM /* * The page's anon-rmap details (mapping and index) are guaranteed to * be set up correctly at this point. * * We have exclusion against page_add_anon_rmap because the call...
0
38,281
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: lmp_print_data_link_subobjs(netdissect_options *ndo, const u_char *obj_tptr, int total_subobj_len, int offset) { int hexdump = FALSE; int subobj_type, subobj_len; union { /* int to float conversion buffer */ float f; uint32_t i; } bw; while (tot...
1
169,538
Analyze the following 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 copy_huge_page(struct page *dst, struct page *src) { int i; struct hstate *h = page_hstate(src); if (unlikely(pages_per_huge_page(h) > MAX_ORDER_NR_PAGES)) { copy_gigantic_page(dst, src); return; } might_sleep(); for (i = 0; i < pages_per_huge_page(h); i++) { cond_resched(); copy_highpage(dst...
0
19,670
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static unsigned int n_tty_poll(struct tty_struct *tty, struct file *file, poll_table *wait) { struct n_tty_data *ldata = tty->disc_data; unsigned int mask = 0; poll_wait(file, &tty->read_wait, wait); poll_wait(file, &tty->write_wait, wait); if (input_available_p(tty, 1)) mask |= POLLIN | POLLRDNORM...
0
39,809
Analyze the following 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 TRBCCode xhci_configure_slot(XHCIState *xhci, unsigned int slotid, uint64_t pictx, bool dc) { dma_addr_t ictx, octx; uint32_t ictl_ctx[2]; uint32_t slot_ctx[4]; uint32_t islot_ctx[4]; uint32_t ep_ctx[5]; int i; TRBCCode res; trace_usb_xhci_...
0
5,691
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Plugin::LengthComputable length_computable() const { return length_computable_; } Commit Message: Revert 143656 - Add an IPC channel between the NaCl loader process and the renderer. BUG=116317 TEST=ppapi, nacl tests, manual testing for experimental IPC proxy. Review URL: https://chromiumcodereview.appsp...
0
103,409
Analyze the following 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 NTPResourceCache::CreateNewTabIncognitoHTML() { base::DictionaryValue localized_strings; localized_strings.SetString("title", l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); int new_tab_description_ids = IDS_NEW_TAB_OTR_DESCRIPTION; int new_tab_heading_ids = IDS_NEW_TAB_OTR_HEADING; int new_ta...
0
110,358
Analyze the following 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 CL_Clientinfo_f( void ) { Com_Printf( "--------- Client Information ---------\n" ); Com_Printf( "state: %i\n", clc.state ); Com_Printf( "Server: %s\n", clc.servername ); Com_Printf( "User info settings:\n" ); Info_Print( Cvar_InfoString( CVAR_USERINFO ) ); Com_Printf( "---------------------------------...
0
95,658
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebPageSerializerImpl::buildContentForNode(Node* node, SerializeDomParam* param) { switch (node->nodeType()) { case Node::ELEMENT_NODE: openTagToString(toElement(node), param); for (Node *child = node->firstChild(); child; child = child-...
0
124,012
Analyze the following 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 cifs_stats_fail_inc(struct cifs_tcon *tcon, uint16_t code) { cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_failed[code]); } Commit Message: [CIFS] Possible null ptr deref in SMB2_tcon As Raphael Geissert pointed out, tcon_error_exit can dereference tcon and there is one path in which tcon ...
0
35,995
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static bool isValidMIMEType(const String& type) { size_t slashPosition = type.find('/'); if (slashPosition == notFound || !slashPosition || slashPosition == type.length() - 1) return false; for (size_t i = 0; i < type.length(); ++i) { if (!isRFC2616TokenCharacter(type[i]) && i != slash...
0
112,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: bool Layer::Update(ResourceUpdateQueue* queue, const OcclusionTracker<Layer>* occlusion) { DCHECK(layer_tree_host_); DCHECK_EQ(layer_tree_host_->source_frame_number(), paint_properties_.source_frame_number) << "SavePaintProperties must be called for any layer that is paint...
0
111,940
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags) { return do_pipe2(fildes, flags); } Commit Message: Merge branch 'page-refs' (page ref overflow) Merge page ref overflow branch. Jann Horn reported that he can overflow the page ref count with sufficient memory (and a filesystem that is intentionally ex...
0
96,848
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ResourceDispatcherHostImpl::BeginRequest( ResourceRequesterInfo* requester_info, int request_id, const network::ResourceRequest& request_data, bool is_sync_load, int route_id, uint32_t url_loader_options, network::mojom::URLLoaderRequest mojo_request, network::mojom::URLLoader...
0
151,991
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void adjust_tsc_offset_guest(struct kvm_vcpu *vcpu, s64 adjustment) { kvm_x86_ops->adjust_tsc_offset_guest(vcpu, adjustment); } Commit Message: KVM: x86: Reload pit counters for all channels when restoring state Currently if userspace restores the pit counters with a count of 0 on channel...
0
57,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: void PasswordAutofillAgent::LogFirstFillingResult( const PasswordFormFillData& form_data, FillingResult result) { if (recorded_first_filling_result_) return; UMA_HISTOGRAM_ENUMERATION("PasswordManager.FirstRendererFillingResult", result); DCHECK(form_data.has_renderer...
0
137,636
Analyze the following 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::writeChar(char16_t val) { return writeInt32(int32_t(val)); } Commit Message: Add bound checks to utf16_to_utf8 Bug: 29250543 Change-Id: I518e7b2fe10aaa3f1c1987586a09b1110aff7e1a (cherry picked from commit 7e93b2ddcb49b5365fbe1dab134ffb38e6f1c719) CWE ID: CWE-119
0
163,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 AwContents::InsertVisualStateCallback( JNIEnv* env, jobject obj, jlong request_id, jobject callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>(); j_callback->Reset(env, callback); web_contents_->GetMainFrame()->InsertVisu...
0
119,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: keepalived_realloc(void *buffer, size_t size, const char *file, const char *function, int line) { return keepalived_free_realloc_common(buffer, size, file, function, line, true); } Commit Message: When opening files for write, ensure they aren't symbolic links Issue #1048 identified that if, for example, ...
0
76,109
Analyze the following 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::OnAbstractTextureDestroyed( ValidatingAbstractTextureImpl* abstract_texture, scoped_refptr<TextureRef> texture_ref) { DCHECK(texture_ref); abstract_textures_.erase(abstract_texture); if (context_->IsCurrent(nullptr)) texture_refs_pending_destruction_.clear(); else te...
0
141,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 int yyinput (yyscan_t yyscanner) #else static int input (yyscan_t yyscanner) #endif { int c; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; *yyg->yy_c_buf_p = yyg->yy_hold_char; if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want...
1
168,487
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vmxnet3_physical_memory_writev(const struct iovec *iov, size_t start_iov_off, hwaddr target_addr, size_t bytes_to_copy) { size_t curr_off = 0; size_t copied = 0; while (bytes_to_copy) { if (start_iov_...
0
15,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 RenderProcessHostImpl::AppendRendererCommandLine( base::CommandLine* command_line) { command_line->AppendSwitchASCII(switches::kProcessType, switches::kRendererProcess); #if defined(OS_WIN) command_line->AppendArg(switches::kPrefetchArgumentRenderer); #endif // def...
0
149,237
Analyze the following 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 put_int8(QEMUFile *f, void *pv, size_t size) { int8_t *v = pv; qemu_put_s8s(f, v); } Commit Message: CWE ID: CWE-119
0
15,723
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void BluetoothDeviceChooserController::OnStartDiscoverySessionFailed() { if (chooser_.get()) { chooser_->ShowDiscoveryState( BluetoothChooser::DiscoveryState::FAILED_TO_START); } } Commit Message: bluetooth: Implement getAvailability() This change implements the getAvailability() method for navi...
0
138,078
Analyze the following 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::OnRenderFrameProxyVisibilityChanged(bool visible) { if (visible) WasShown(); else WasHidden(); } Commit Message: Don't call WebContents::DownloadImage() callback if the WebContents were deleted BUG=583718 Review URL: https://codereview.chromium.org/1685343004 Cr-Commit-Positi...
0
131,937
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: put_param_pdf14_spot_names(gx_device * pdev, gs_separations * pseparations, gs_param_list * plist) { int code, num_spot_colors, i; gs_param_string str; /* Check if the given keyname is present. */ code = param_read_int(plist, PDF14NumSpotColorsParamName, ...
0
13,341
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: krb5_gss_unwrap(minor_status, context_handle, input_message_buffer, output_message_buffer, conf_state, qop_state) OM_uint32 *minor_status; gss_ctx_id_t context_handle; gss_buffer_t input_message_buffer; gss_buffer_t output_message_buff...
0
36,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: void WebRuntimeFeatures::enableWebGLDraftExtensions(bool enable) { RuntimeEnabledFeatures::setWebGLDraftExtensionsEnabled(enable); } Commit Message: Remove SpeechSynthesis runtime flag (status=stable) BUG=402536 Review URL: https://codereview.chromium.org/482273005 git-svn-id: svn://svn.chromium.org/blink...
0
116,111
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: NodeIterator::NodePointer::NodePointer() { } Commit Message: Fix detached Attr nodes interaction with NodeIterator - Don't register NodeIterator to document when attaching to Attr node. -- NodeIterator is registered to its document to receive updateForNodeRemoval notifications. -- However it wouldn't make sense...
0
131,185
Analyze the following 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 release_existing_page_budget(struct ubifs_info *c) { struct ubifs_budget_req req = { .dd_growth = c->bi.page_budget}; ubifs_release_budget(c, &req); } Commit Message: ->splice_write() via ->write_iter() iter_file_splice_write() - a ->splice_write() instance that gathers the pipe buffers, builds a...
0
46,413
Analyze the following 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 spl_array_rewind_ex(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */ { zend_hash_internal_pointer_reset_ex(aht, &intern->pos); spl_array_update_pos(intern); spl_array_skip_protected(intern, aht TSRMLS_CC); } /* }}} */ Commit Message: CWE ID:
0
12,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 char *print_object( cJSON *item, int depth, int fmt ) { char **entries = 0, **names = 0; char *out = 0, *ptr, *ret, *str; int len = 7, i = 0, j; cJSON *child = item->child; int numentries = 0, fail = 0; /* Count the number of entries. */ while ( child ) { ++numentries; child = child->next; } ...
1
167,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: ip_rfc1001_connect(struct TCP_Server_Info *server) { int rc = 0; /* * some servers require RFC1001 sessinit before sending * negprot - BB check reconnection in case where second * sessinit is sent but no second negprot */ struct rfc1002_session_packet *ses_init_buf; struct smb_hdr *smb_buf; ses_init_...
0
24,512
Analyze the following 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_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, int swap, uint32_t namesz, uint32_t descsz, size_t noff, size_t doff, int *flags, size_t size, int clazz) { #ifdef ELFCORE int os_style = -1; /* * Sigh. The 2.0.36 kernel in Debian 2.1, at * least, doesn't correctly implement na...
0
58,982
Analyze the following 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 PrintRenderFrameHelper::CopyMetafileDataToSharedMem( const PdfMetafileSkia& metafile, base::SharedMemoryHandle* shared_mem_handle) { uint32_t buf_size = metafile.GetDataSize(); if (buf_size == 0) return false; std::unique_ptr<base::SharedMemory> shared_buf( content::RenderThread::Get...
0
149,794
Analyze the following 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 update_write_bitmap_update(rdpUpdate* update, wStream* s, const BITMAP_UPDATE* bitmapUpdate) { int i; if (!Stream_EnsureRemainingCapacity(s, 32)) return FALSE; Stream_Write_UINT16(s, UPDATE_TYPE_BITMAP); /* updateType */ Stream_Write_UINT16(s, bitmapUpdat...
0
83,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 update_perf_cpu_limits(void) { u64 tmp = perf_sample_period_ns; tmp *= sysctl_perf_cpu_time_max_percent; do_div(tmp, 100); ACCESS_ONCE(perf_sample_allowed_ns) = tmp; } Commit Message: perf: Fix race in swevent hash There's a race on CPU unplug where we free the swevent hash array while it can s...
0
56,154
Analyze the following 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::WebString MediaRecorderHandler::ActualMimeType() { DCHECK(main_render_thread_checker_.CalledOnValidThread()); DCHECK(client_) << __func__ << " should be called after Initialize()"; const bool has_video_tracks = !media_stream_.VideoTracks().empty(); const bool has_audio_tracks = !media_stream_.Audi...
0
143,503
Analyze the following 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 WebMediaPlayerImpl::SetIsEffectivelyFullscreen( blink::WebFullscreenVideoStatus fullscreen_video_status) { delegate_->SetIsEffectivelyFullscreen(delegate_id_, fullscreen_video_status); } Commit Message: Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: ...
0
144,505
Analyze the following 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 Editor::Command::IdForHistogram() const { return IsSupported() ? static_cast<int>(command_->command_type) : 0; } Commit Message: Move Editor::Transpose() out of Editor class This patch moves |Editor::Transpose()| out of |Editor| class as preparation of expanding it into |ExecutTranspose()| in "EditorComma...
0
128,632
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Layer::Layer() : needs_push_properties_(false), num_dependents_need_push_properties_(false), stacking_order_changed_(false), layer_id_(s_next_layer_id++), ignore_set_needs_commit_(false), parent_(NULL), layer_tree_host_(NULL), scroll_clip_layer_id_(INVALID_ID), ...
0
111,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 void get_openreq4(const struct request_sock *req, struct seq_file *f, int i) { const struct inet_request_sock *ireq = inet_rsk(req); long delta = req->rsk_timer.expires - jiffies; seq_printf(f, "%4d: %08X:%04X %08X:%04X" " %02X %08X:%08X %02X:%08lX %08X %5u %8d %u %d %pK", i, ireq->ir_loc_add...
0
49,234
Analyze the following 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_shrink_inode( xfs_da_args_t *args, xfs_dablk_t dead_blkno, struct xfs_buf *dead_buf) { xfs_inode_t *dp; int done, error, w, count; xfs_trans_t *tp; xfs_mount_t *mp; trace_xfs_da_shrink_inode(args); dp = args->dp; w = args->whichfork; tp = args->trans; mp = dp->i_mount; if (w == XFS_DATA_FORK...
0
35,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: bool did_trigger_history_navigation() const { return did_trigger_history_navigation_; } Commit Message: Abort navigations on 304 responses. A recent change (https://chromium-review.googlesource.com/1161479) accidentally resulted in treating 304 responses as downloads. This CL treats them as ERR_ABORTED ...
0
145,348
Analyze the following 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 WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, GLint drawbuffer, const Vector<GLint>& value, GLuint src_offset) { if (isContextLost() || !ValidateClea...
0
153,574
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: base::string16 AuthenticatorSelectAccountSheetModel::GetAcceptButtonLabel() const { return l10n_util::GetStringUTF16(IDS_WEBAUTHN_WELCOME_SCREEN_NEXT); } Commit Message: chrome/browser/ui/webauthn: long domains may cause a line break. As requested by UX in [1], allow long host names to split a title into ...
0
142,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: void ContentSecurityPolicy::ReportViolation( const String& directive_text, const DirectiveType& effective_type, const String& console_message, const KURL& blocked_url, const Vector<String>& report_endpoints, bool use_reporting_api, const String& header, ContentSecurityPolicyHeaderT...
0
152,522
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int btreeCursor( Btree *p, /* The btree */ int iTable, /* Root page of table to open */ int wrFlag, /* 1 to write. 0 read-only */ struct KeyInfo *pKeyInfo, /* First arg to comparison function */ BtCurs...
0
136,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: bool Document::importContainerNodeChildren(ContainerNode* oldContainerNode, PassRefPtrWillBeRawPtr<ContainerNode> newContainerNode, ExceptionState& exceptionState) { for (Node& oldChild : NodeTraversal::childrenOf(*oldContainerNode)) { RefPtrWillBeRawPtr<Node> newChild = importNode(&oldChild, true, ex...
0
124,406
Analyze the following 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 mdiobus_unregister_device(struct mdio_device *mdiodev) { if (mdiodev->bus->mdio_map[mdiodev->addr] != mdiodev) return -EINVAL; mdiodev->bus->mdio_map[mdiodev->addr] = NULL; return 0; } Commit Message: mdio_bus: Fix use-after-free on device_register fails KASAN has found use-after-free in fixed_mdio_b...
0
89,653
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ExtensionsAPIClient::ExtensionsAPIClient() { g_instance = this; } Commit Message: Hide DevTools frontend from webRequest API Prevent extensions from observing requests for remote DevTools frontends and add regression tests. And update ExtensionTestApi to support initializing the embedded test server and port f...
0
146,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: static void mmtimer_tasklet(unsigned long data) { int nodeid = data; struct mmtimer_node *mn = &timers[nodeid]; struct mmtimer *x = rb_entry(mn->next, struct mmtimer, list); struct k_itimer *t; unsigned long flags; /* Send signal and deal with periodic signals */ spin_lock_irqsave(&mn->lock, flags); if (...
0
24,659
Analyze the following 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::UpdateMaxPageIDForSiteInstance( SiteInstance* site_instance, int32 page_id) { if (GetMaxPageIDForSiteInstance(site_instance) < page_id) max_page_ids_[site_instance->GetId()] = page_id; } Commit Message: Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See b...
0
110,801
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int tcm_loop_driver_probe(struct device *dev) { struct tcm_loop_hba *tl_hba; struct Scsi_Host *sh; int error; tl_hba = to_tcm_loop_hba(dev); sh = scsi_host_alloc(&tcm_loop_driver_template, sizeof(struct tcm_loop_hba)); if (!sh) { printk(KERN_ERR "Unable to allocate struct scsi_host\n"); retu...
0
94,121
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderViewHostManager::~RenderViewHostManager() { if (pending_render_view_host_) CancelPending(); RenderViewHostImpl* render_view_host = render_view_host_; render_view_host_ = NULL; if (render_view_host) render_view_host->Shutdown(); for (RenderViewHostMap::iterator iter = swapped_out_hosts_.b...
0
115,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: inline static char xml_decode_us_ascii(unsigned short c) { return (char)(c > 0x7f ? '?' : c); } Commit Message: CWE ID: CWE-119
0
11,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: e1000e_set_vet(E1000ECore *core, int index, uint32_t val) { core->mac[VET] = val & 0xffff; core->vet = le16_to_cpu(core->mac[VET]); trace_e1000e_vlan_vet(core->vet); } Commit Message: CWE ID: CWE-835
0
6,084
Analyze the following 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_main_run_string_with_length(gs_main_instance * minst, const char *str, uint length, int user_errors, int *pexit_code, ref * perror_object) { int code; code = gs_main_run_string_begin(minst, user_errors, pexit_code, perror_object); if (code < 0) ...
0
2,909
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virDomainSetUserPassword(virDomainPtr dom, const char *user, const char *password, unsigned int flags) { VIR_DOMAIN_DEBUG(dom, "user=%s, password=%s, flags=%x", NULLSTR(user), NULLSTR(password), flags); virRes...
0
93,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: pdf_set_color(fz_context *ctx, pdf_run_processor *pr, int what, float *v) { pdf_gstate *gstate = pr->gstate + pr->gtop; pdf_material *mat; gstate = pdf_flush_text(ctx, pr); mat = what == PDF_FILL ? &gstate->fill : &gstate->stroke; switch (mat->kind) { case PDF_MAT_PATTERN: case PDF_MAT_COLOR: fz_clam...
0
552
Analyze the following 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 X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, int nid) { ASN1_TYPE *at = NULL; X509_ATTRIBUTE *attr = NULL; if (!(at = ASN1_TYPE_new()) || !(at->value.sequence = ASN1_STRING_new())) goto err; at->type = V_ASN1_SEQUENCE; ...
0
6,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: status_t SampleIterator::seekTo(uint32_t sampleIndex) { ALOGV("seekTo(%d)", sampleIndex); if (sampleIndex >= mTable->mNumSampleSizes) { return ERROR_END_OF_STREAM; } if (mTable->mSampleToChunkOffset < 0 || mTable->mChunkOffsetOffset < 0 || mTable->mSampleSizeOffset < 0 || mTable->mTimeToSampleCount =...
1
173,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: static void do_release_file_info(struct file_info *f) { if (!f) return; free(f->controller); free(f->cgroup); free(f->file); free(f->buf); free(f); } Commit Message: Implement privilege check when moving tasks When writing pids to a tasks file in lxcfs, lxcfs was checking for privilege over the tasks fi...
0
44,389
Analyze the following 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 WebMediaPlayerImpl::OnMemoryPressure( base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { DVLOG(2) << __func__ << " memory_pressure_level=" << memory_pressure_level; DCHECK(main_task_runner_->BelongsToCurrentThread()); DCHECK(base::FeatureList::IsEnabled(kMemoryPressureBasedS...
0
154,438
Analyze the following 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 hash_dma_done(struct hash_ctx *ctx) { struct dma_chan *chan; chan = ctx->device->dma.chan_mem2hash; dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); dma_unmap_sg(chan->device->dev, ctx->device->dma.sg, ctx->device->dma.sg_len, DMA_TO_DEVICE); } Commit Message: crypto: prefix module a...
0
47,531
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bitfromint8(PG_FUNCTION_ARGS) { int64 a = PG_GETARG_INT64(0); int32 typmod = PG_GETARG_INT32(1); VarBit *result; bits8 *r; int rlen; int destbitsleft, srcbitsleft; if (typmod <= 0) typmod = 1; /* default bit length */ rlen = VARBITTOTALLEN(typmod); result = (VarBit *) palloc(rlen);...
0
39,079
Analyze the following 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(radius_add_server) { char *hostname, *secret; int hostname_len, secret_len; long port, timeout, maxtries; radius_descriptor *raddesc; zval *z_radh; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rslsll", &z_radh, &hostname, &hostname_len, &port, &secret, &secret_len, &timeout, ...
0
31,498
Analyze the following 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(const DocumentInit& initializer, DocumentClassFlags document_classes) : ContainerNode(0, kCreateDocument), TreeScope(*this), has_nodes_with_placeholder_style_(false), evaluate_media_queries_on_style_recalc_(false), pending_sheet_layout_(kNoLayoutWi...
0
134,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: void BrowserView::OnBoundsChanged(const gfx::Rect& previous_bounds) { if (!interactive_resize_) return; auto now = base::TimeTicks::Now(); if (!interactive_resize_->last_resize_timestamp.is_null()) { const auto& current_size = size(); if (current_size == previous_bounds.size()) return; ...
0
155,233
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int lua_map_to_storage_harness(request_rec *r) { return lua_request_rec_hook_harness(r, "map_to_storage", APR_HOOK_MIDDLE); } Commit Message: Merge r1642499 from trunk: *) SECURITY: CVE-2014-8109 (cve.mitre.org) mod_lua: Fix handling of the Require line when a LuaAuthzProvider is used in ...
0
35,699
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: fbFetch_x4a4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed) { const CARD8 *pixel = (const CARD8 *)bits + x; const CARD8 *end = pixel + width; while (pixel < end) { CARD8 p = READ(pixel++) & 0xf; WRITE(buffer++, (p | (p << 4)) << 24); } } Commit Message: CWE...
0
11,461
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cleanup_exit(int i) { cleanup_socket(); _exit(i); } Commit Message: add a whitelist of paths from which ssh-agent will load (via ssh-pkcs11-helper) a PKCS#11 module; ok markus@ CWE ID: CWE-426
0
72,339
Analyze the following 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 Notification::maxActions() { if (!notificationManager()) return 2; return notificationManager()->maxActions(); } Commit Message: Notification actions may have an icon url. This is behind a runtime flag for two reasons: * The implementation is incomplete. * We're still evaluating the API ...
0
119,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: reverse(u8 *out, size_t outlen, const u8 *in, size_t inlen) { if (inlen > outlen) return SC_ERROR_BUFFER_TOO_SMALL; outlen = inlen; while (inlen--) *out++ = in[inlen]; return outlen; } Commit Message: fixed out of bounds reads Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting se...
0
78,465