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: int ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) { long l; if (p != NULL) { l = c->id; if ((l & 0xff000000) != 0x03000000) return (0); p[0] = ((unsigned char)(l >> 8L)) & 0xFF; p[1] = ((unsigned char)(l)) & 0xFF; } return (2); } Commi...
0
3,600
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void V8TestObject::SVGAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_svgAttribute_Getter"); test_object_v8_internal::SVGAttributeAttributeGetter(info); } Commit Message: bindings: Support "...
0
5,753
Analyze the following 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 restore_sigs(sigset_t *oldset) { sigprocmask(SIG_SETMASK, oldset, NULL); } Commit Message: fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message FUSE_NOTIFY_INVAL_ENTRY didn't check the length of the write so the message processing could overrun and result in a "kernel BUG at fs/fuse/dev.c:629!" Rep...
0
3,566
Analyze the following 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 reference2_16x16_idct_2d(double *input, double *output) { double x; for (int l = 0; l < 16; ++l) { for (int k = 0; k < 16; ++k) { double s = 0; for (int i = 0; i < 16; ++i) { for (int j = 0; j < 16; ++j) { x = cos(PI * j * (l + 0.5) / 16.0) * cos(PI * i * (k + 0.5) / 16.0) * ...
0
24,112
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize) { size_t i; if (table->size == 0) { size_t tsize; if (! createSize) return NULL; table->power = INIT_POWER; /* table->size is a power of 2 */ table->size = (size_t)1 << INIT_POWER; tsize = table->size * siz...
0
1,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: __xmlPedanticParserDefaultValue(void) { if (IS_MAIN_THREAD) return (&xmlPedanticParserDefaultValue); else return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue); } Commit Message: Attempt to address libxml crash. BUG=129930 Review URL: https://chromiumcodereview.appspot.com/10458051 git-svn-id:...
0
2,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: MouseEventWithHitTestResults Document::PerformMouseEventHitTest( const HitTestRequest& request, const LayoutPoint& document_point, const WebMouseEvent& event) { DCHECK(GetLayoutViewItem().IsNull() || GetLayoutViewItem().IsLayoutView()); if (GetLayoutViewItem().IsNull() || !View() || !View()->DidF...
0
1,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 MagickStatusType CorrectPSDOpacity(LayerInfo* layer_info, ExceptionInfo *exception) { register PixelPacket *q; register ssize_t x; ssize_t y; if (layer_info->opacity == OpaqueOpacity) return(MagickTrue); layer_info->image->matte=MagickTrue; for (y=0; y < (ssize_t) layer_in...
0
9,882
Analyze the following 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 ip6_frag_expire(unsigned long data) { struct frag_queue *fq; struct net_device *dev = NULL; struct net *net; fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q); spin_lock(&fq->q.lock); if (fq->q.last_in & INET_FRAG_COMPLETE) goto out; fq_kill(fq); net = container_of...
0
4,248
Analyze the following 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_METHOD(Phar, isValidPharFilename) { char *fname; const char *ext_str; int fname_len, ext_len, is_executable; zend_bool executable = 1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &fname, &fname_len, &executable) == FAILURE) { return; } is_executable = executable; RETVAL_BOOL(phar_d...
0
7,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: gfx::Size TaskManagerView::GetPreferredSize() { return gfx::Size(kDefaultWidth, kDefaultHeight); } Commit Message: accelerators: Remove deprecated Accelerator ctor that takes booleans. BUG=128242 R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10399085 git-svn-id: svn://svn.chromium.or...
0
150
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: uint8_t ndp_msg_opt_route_prefix_len(struct ndp_msg *msg, int offset) { struct __nd_opt_route_info *ri = ndp_msg_payload_opts_offset(msg, offset); return ri->nd_opt_ri_prefix_len; } Commit Message: libndp: validate the IPv6 hop limit None of the NDP messages should ever come from a non-local network; as s...
0
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: bool QueryManager::AddPendingTransferQuery( Query* query, base::subtle::Atomic32 submit_count) { DCHECK(query); DCHECK(!query->IsDeleted()); if (!RemovePendingQuery(query)) { return false; } query->MarkAsPending(submit_count); pending_transfer_queries_.push_back(query); return true; } C...
0
10,960
Analyze the following 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 DatabaseMessageFilter::OverrideThreadForMessage( const IPC::Message& message, BrowserThread::ID* thread) { if (message.type() == DatabaseHostMsg_GetSpaceAvailable::ID) *thread = BrowserThread::IO; else if (IPC_MESSAGE_CLASS(message) == DatabaseMsgStart) *thread = BrowserThread::FILE; i...
0
1,546
Analyze the following 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_defined_under(mrb_state *mrb, struct RClass *outer, const char *name) { mrb_value sym = mrb_check_intern_cstr(mrb, name); if (mrb_nil_p(sym)) { return FALSE; } return mrb_const_defined_at(mrb, mrb_obj_value(outer), mrb_symbol(sym)); } Commit Message: `mrb_class_real()` did not work for `Bas...
0
16,173
Analyze the following 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 ImportAlphaQuantum(const Image *image,QuantumInfo *quantum_info, const MagickSizeType number_pixels,const unsigned char *magick_restrict p, Quantum *magick_restrict q,ExceptionInfo *exception) { QuantumAny range; register ssize_t x; unsigned int pixel; assert(image != (Image...
0
10,806
Analyze the following 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 ext4_da_release_space(struct inode *inode, int to_free) { struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); struct ext4_inode_info *ei = EXT4_I(inode); if (!to_free) return; /* Nothing to release, exit */ spin_lock(&EXT4_I(inode)->i_block_reservation_lock); trace_ext4_da_release_space(inode,...
0
6,588
Analyze the following 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 rt_scope(int ifa_scope) { if (ifa_scope & IFA_HOST) return RT_SCOPE_HOST; else if (ifa_scope & IFA_LINK) return RT_SCOPE_LINK; else if (ifa_scope & IFA_SITE) return RT_SCOPE_SITE; else return RT_SCOPE_UNIVERSE; } Commit Message: ipv6: addrconf: validate new MTU before applying it C...
0
13,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: static int xsetbv_interception(struct vcpu_svm *svm) { u64 new_bv = kvm_read_edx_eax(&svm->vcpu); u32 index = kvm_register_read(&svm->vcpu, VCPU_REGS_RCX); if (kvm_set_xcr(&svm->vcpu, index, new_bv) == 0) { svm->next_rip = kvm_rip_read(&svm->vcpu) + 3; skip_emulated_instruction(&svm->vcpu); } return 1;...
0
19,619
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: f2flac8_clip_array (const float *src, int32_t *dest, int count, int normalize) { float normfact, scaled_value ; normfact = normalize ? (8.0 * 0x10) : 1.0 ; while (--count >= 0) { scaled_value = src [count] * normfact ; if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7F)) { dest [count] = 0x7F ; ...
0
2,761
Analyze the following 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 is_bool(const char *s) { return !strcasecmp ("true", s) || !strcasecmp ("false", s); } Commit Message: Fix #7698 - UAF in r_config_set when loading a dex CWE ID: CWE-416
0
24,889
Analyze the following 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 SharedMemory::IsHandleValid(const SharedMemoryHandle& handle) { return handle.fd >= 0; } Commit Message: Posix: fix named SHM mappings permissions. Make sure that named mappings in /dev/shm/ aren't created with broad permissions. BUG=254159 R=mark@chromium.org, markus@chromium.org Review URL: https://c...
0
16,944
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void HTMLMediaElement::parseAttribute( const AttributeModificationParams& params) { const QualifiedName& name = params.name; if (name == srcAttr) { BLINK_MEDIA_LOG << "parseAttribute(" << (void*)this << ", srcAttr, old=" << params.oldValue << ", new=" << params....
0
291
Analyze the following 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 WebGLRenderingContextBase::ValidateCapability(const char* function_name, GLenum cap) { switch (cap) { case GL_BLEND: case GL_CULL_FACE: case GL_DEPTH_TEST: case GL_DITHER: case GL_POLYGON_OFFSET_FILL: case GL_SAMPLE_ALPHA_TO_COVERAG...
0
5,618
Analyze the following 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 mbedtls_x509_crt_verify( mbedtls_x509_crt *crt, mbedtls_x509_crt *trust_ca, mbedtls_x509_crl *ca_crl, const char *cn, uint32_t *flags, int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *), void *p_vr...
0
17,843
Analyze the following 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 AXNodeObject::textAlternative(bool recursive, bool inAriaLabelledByTraversal, AXObjectSet& visited, AXNameFrom& nameFrom, AXRelatedObjectVector* relatedObjects...
0
18,387
Analyze the following 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 void Splash::drawPixel(SplashPipe *pipe, int x, int y, GBool noClip) { if (unlikely(y < 0)) return; if (noClip || state->clip->test(x, y)) { pipeSetXY(pipe, x, y); (this->*pipe->run)(pipe); updateModX(x); updateModY(y); } } Commit Message: CWE ID:
0
6,590
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Browser::MarkHomePageAsChanged(PrefService* pref_service) { pref_service->SetBoolean(prefs::kHomePageChanged, true); pref_service->ScheduleSavePersistentPrefs(); } Commit Message: Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode via webkitRequestFullScreen(), t...
0
18,692
Analyze the following 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 unsignedLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::unsignedLongMethodMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: document.location bi...
0
8,634
Analyze the following 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 AXLayoutObject::addRemoteSVGChildren() { AXSVGRoot* root = remoteSVGRootElement(); if (!root) return; root->setParent(this); if (root->accessibilityIsIgnored()) { for (const auto& child : root->children()) m_children.push_back(child); } else { m_children.push_back(root); } } ...
0
4,363
Analyze the following 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 rfcomm_sock_setsockopt_old(struct socket *sock, int optname, char __user *optval, unsigned int optlen) { struct sock *sk = sock->sk; int err = 0; u32 opt; BT_DBG("sk %p", sk); lock_sock(sk); switch (optname) { case RFCOMM_LM: if (get_user(opt, (u32 __user *) optval)) { err = -EFAULT; ...
0
10,661
Analyze the following 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 DevToolsWindow::DocumentOnLoadCompletedInMainFrame() { is_loaded_ = true; UpdateTheme(); DoAction(); AddDevToolsExtensionsToClient(); } Commit Message: DevTools: handle devtools renderer unresponsiveness during beforeunload event interception This patch fixes the crash which happenes under the foll...
0
5,502
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: string16 AutocompleteEditModel::DisplayTextFromUserText( const string16& text) const { return KeywordIsSelected() ? KeywordProvider::SplitReplacementStringFromInput(text, false) : text; } Commit Message: Adds per-provider information to omnibox UMA logs. Adds a fairly general structure to omnibox lo...
0
6,758
Analyze the following 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::HandleDrawArrays(uint32_t immediate_data_size, const volatile void* cmd_data) { const volatile cmds::DrawArrays& c = *static_cast<const volatile cmds::DrawArrays*>(cmd_data); return DoDrawArrays("glDrawArrays", ...
0
19,851
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: osi_print_cksum(netdissect_options *ndo, const uint8_t *pptr, uint16_t checksum, int checksum_offset, u_int length) { uint16_t calculated_checksum; /* do not attempt to verify the checksum if it is zero, * if the offset is nonsense, * or the base pointer is not sane ...
0
15,692
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Browser::ExitTabbedFullscreenModeIfNecessary() { if (tab_caused_fullscreen_) ToggleFullscreenMode(); else NotifyTabOfFullscreenExitIfNecessary(); } Commit Message: Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode via webkitRequestFullScreen(), telling t...
0
23,558
Analyze the following 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 authentication_success(void) { int r; struct mboxevent *mboxevent; /* authstate already created by mysasl_proxy_policy() */ imapd_userisadmin = global_authisa(imapd_authstate, IMAPOPT_ADMINS); /* Create telemetry log */ imapd_logfd = telemetry_log(imapd_userid, imapd_in, imap...
0
7,556
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon, const FILE_BASIC_INFO *data, __u16 fid, __u32 pid_of_opener) { struct smb_com_transaction2_sfi_req *pSMB = NULL; char *data_offset; int rc = 0; __u16 params, param_offset, offset, byte_count, count; cFYI(1, "Set Times (via SetFileInfo)"); rc ...
0
28,380
Analyze the following 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 wrmsr_interception(struct vcpu_svm *svm) { struct msr_data msr; u32 ecx = kvm_register_read(&svm->vcpu, VCPU_REGS_RCX); u64 data = kvm_read_edx_eax(&svm->vcpu); msr.data = data; msr.index = ecx; msr.host_initiated = false; svm->next_rip = kvm_rip_read(&svm->vcpu) + 2; if (kvm_set_msr(&svm->vc...
0
21,811
Analyze the following 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 coroutine_fn v9fs_stat(void *opaque) { int32_t fid; V9fsStat v9stat; ssize_t err = 0; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; err = pdu_unmarshal(pdu, offset, "d", &fid); if (err < 0) { goto out_nofid; } trac...
0
10,542
Analyze the following 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 DocumentLoader::DetachFromFrame(bool flush_microtask_queue) { DCHECK(frame_); StopLoading(); if (flush_microtask_queue) { Microtask::PerformCheckpoint(V8PerIsolateData::MainThreadIsolate()); } ScriptForbiddenScope forbid_scripts; fetcher_->ClearContext(); if (!frame_) return; applic...
0
10,091
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: handle_deauth(netdissect_options *ndo, const uint8_t *src, const u_char *p, u_int length) { struct mgmt_body_t pbody; const char *reason = NULL; memset(&pbody, 0, sizeof(pbody)); if (!ND_TTEST2(*p, IEEE802_11_REASON_LEN)) return 0; if (length < IEEE802_11_REASON_LEN) return 0; pbody.rea...
0
27,090
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ManagementPolicy* ExtensionSystemImpl::Shared::management_policy() { return management_policy_.get(); } Commit Message: Check prefs before allowing extension file access in the permissions API. R=mpcomplete@chromium.org BUG=169632 Review URL: https://chromiumcodereview.appspot.com/11884008 git-svn-id: svn...
0
6,172
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void sc_asn1_print_utf8string(const u8 * buf, size_t buflen) { /* FIXME UTF-8 is not ASCII */ print_ascii(buf, buflen); } 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
2,591
Analyze the following 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 perWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); TestObjectPythonV8Internal::perWorldBindingsLongAttributeAttributeGetterForMainWorld(info); TRACE...
0
21,244
Analyze the following 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 smp_proc_enc_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { uint8_t* p = (uint8_t*)p_data; SMP_TRACE_DEBUG("%s", __func__); STREAM_TO_ARRAY(p_cb->ltk, p, BT_OCTET16_LEN); smp_key_distribution(p_cb, NULL); } Commit Message: DO NOT MERGE Fix OOB read before buffer length check Bug: 111936834 Test: man...
0
11,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: gs_setsrcgtagicc(const gs_gstate * pgs, gs_param_string * pval) { int code; char *pname; int namelen = (pval->size)+1; gs_memory_t *mem = pgs->memory; if (pval->size == 0) return 0; pname = (char *)gs_alloc_bytes(mem, namelen, "set_srcgtag_icc"); if (pname == NULL) return_erro...
0
23,143
Analyze the following 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::UpdateStateForTextChange( const WebInputElement& element) { if (!element.IsTextField()) return; WebInputElement mutable_element = element; // We need a non-const. const base::string16 element_value = element.Value().Utf16(); field_data_manager_.UpdateFieldDataMap(elem...
0
3,640
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: network::ResourceRequest CreateXHRRequestWithOrigin(const char* origin) { network::ResourceRequest request = CreateXHRRequest("http://bar.com/simple_page.html"); request.site_for_cookies = GURL(origin); request.headers.SetHeader(net::HttpRequestHeaders::kOrigin, origin); return request; } Commit Me...
0
23,986
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ExtensionService::ExtensionService(Profile* profile, const CommandLine* command_line, const FilePath& install_directory, ExtensionPrefs* extension_prefs, ExtensionSettings* e...
0
12,802
Analyze the following 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_rd_ip (u_char *pnt, struct rd_ip *rd_ip) { memcpy (&rd_ip->ip, pnt, 4); pnt += 4; rd_ip->val = ((u_int16_t) *pnt++ << 8); rd_ip->val |= (u_int16_t) *pnt; } Commit Message: CWE ID: CWE-119
0
15,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: static inline bool __force_buffered_io(struct inode *inode, int rw) { return ((f2fs_encrypted_inode(inode) && S_ISREG(inode->i_mode)) || (rw == WRITE && test_opt(F2FS_I_SB(inode), LFS)) || F2FS_I_SB(inode)->s_ndevs); } Commit Message: f2fs: fix a dead loop in f2fs_fiemap() A dead loop can be triggered in...
0
4,724
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HandleInterpBody(CompatInfo *info, VarDef *def, SymInterpInfo *si) { bool ok = true; const char *elem, *field; ExprDef *arrayNdx; for (; def; def = (VarDef *) def->common.next) { if (def->name && def->name->expr.op == EXPR_FIELD_REF) { log_err(info->ctx, "C...
0
19,465
Analyze the following 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 kvmclock_cpufreq_notifier(struct notifier_block *nb, unsigned long val, void *data) { struct cpufreq_freqs *freq = data; struct kvm *kvm; struct kvm_vcpu *vcpu; int i, send_ipi = 0; /* * We allow guests to temporarily run on slowing clocks, * provided we notify them after, or to run ...
0
1,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: void AppListControllerDelegateImpl::PinApp(const std::string& extension_id) { NOTREACHED(); } Commit Message: [Extensions] Add GetInstalledExtension() method to ExtensionRegistry This CL adds GetInstalledExtension() method to ExtensionRegistry and uses it instead of deprecated ExtensionService::GetInstalledEx...
0
23,800
Analyze the following 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 UnacceleratedStaticBitmapImage::IsPremultiplied() const { return paint_image_.GetSkImage()->alphaType() == SkAlphaType::kPremul_SkAlphaType; } Commit Message: Fix *StaticBitmapImage ThreadChecker and unaccelerated SkImage destroy - AcceleratedStaticBitmapImage was misusing ThreadChecker by havin...
0
4,510
Analyze the following 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 TaskService::IsOnTaskRunner(RunnerId runner_id) { base::AutoLock lock(lock_); if (bound_instance_id_ == kInvalidInstanceId) return false; if (runner_id == kDefaultRunnerId) return default_task_runner_->BelongsToCurrentThread(); size_t thread = runner_id - 1; if (threads_.size() <= thread ...
0
15,890
Analyze the following 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 migrate_page_move_mapping(struct address_space *mapping, struct page *newpage, struct page *page, struct buffer_head *head, enum migrate_mode mode, int extra_count) { int expected_count = 1 + extra_count; void **pslot; if (!mapping) { /* Anonymous page without mapping */ if (page_count(pag...
1
14,143
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SyncServerStatusChecker() : running_(false) {} Commit Message: Use URLFetcher::Create instead of new in http_bridge.cc. This change modified http_bridge so that it uses a factory to construct the URLFetcher. Moreover, it modified sync_backend_host_unittest.cc to use an URLFetcher factory which will prevent a...
0
29,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: static int generate(struct crypto_rng *tfm, const u8 *src, unsigned int slen, u8 *dst, unsigned int dlen) { return crypto_old_rng_alg(tfm)->rng_make_random(tfm, dst, dlen); } Commit Message: crypto: rng - Remove old low-level rng interface Now that all rng implementations have switched over to the new in...
1
6,049
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Cluster::Cluster() : m_pSegment(NULL), m_element_start(0), m_index(0), m_pos(0), m_element_size(0), m_timecode(0), m_entries(NULL), m_entries_size(0), m_entries_count(0) // means "no entries" {} Commit Message: external/libvpx/libwebm: Update snapshot Update libw...
0
26,222
Analyze the following 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 CreateUnifiedStream(const url::Origin& security_origin) { std::string output_id = GetNondefaultIdExpectedToPassPermissionsCheck(); std::string input_id = GetNondefaultInputId(); std::string hashed_output_id = MediaStreamManager::GetHMACForMediaDeviceID( kSalt, url::Origin(GURL(kSecurity...
0
4,883
Analyze the following 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 smaps_open(struct inode *inode, struct file *file) { return do_maps_open(inode, file, &proc_pid_smaps_op); } Commit Message: mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode commit 1a5a9906d4e8d1976b701f889d8f35d54b928f25 upstream. In some cases it may happen that pmd_none...
0
13,942
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sc_get_driver(void) { struct sc_card_driver *iso_drv = sc_get_iso7816_driver(); if (!iso_ops) iso_ops = iso_drv->ops; iasecc_ops = *iso_ops; iasecc_ops.match_card = iasecc_match_card; iasecc_ops.init = iasecc_init; iasecc_ops.finish = iasecc_finish; iasecc_ops.read_binary = iasecc_read_binary; /* wri...
0
4,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: void ReleasePermanentXIDDispatcher(gfx::PluginWindowHandle surface) { GtkNativeViewManager* manager = GtkNativeViewManager::GetInstance(); manager->ReleasePermanentXID(surface); } Commit Message: Revert 137988 - VAVDA is the hardware video decode accelerator for Chrome on Linux and ChromeOS for Intel CPUs (S...
0
5,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 int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags) { vm_flags_t vm_flags = vma->vm_flags; int write = (gup_flags & FOLL_WRITE); int foreign = (gup_flags & FOLL_REMOTE); if (vm_flags & (VM_IO | VM_PFNMAP)) return -EFAULT; if (write) { if (!(vm_flags & VM_WRITE)) { if (!(g...
0
6,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: static long read_events(struct kioctx *ctx, long min_nr, long nr, struct io_event __user *event, struct timespec __user *timeout) { ktime_t until = { .tv64 = KTIME_MAX }; long ret = 0; if (timeout) { struct timespec ts; if (unlikely(copy_from_user(&ts, timeout, sizeof(ts)))) return -EFAULT; u...
0
28,605
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xps_parse_digits(char *s, int *digit) { *digit = 0; while (*s >= '0' && *s <= '9') { *digit = *digit * 10 + (*s - '0'); s ++; } return s; } Commit Message: CWE ID: CWE-125
0
9,608
Analyze the following 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 key_seal(struct trusted_key_payload *p, struct trusted_key_options *o) { struct tpm_buf *tb; int ret; tb = kzalloc(sizeof *tb, GFP_KERNEL); if (!tb) return -ENOMEM; /* include migratable flag at end of sealed key */ p->key[p->key_len] = p->migratable; ret = tpm_seal(tb, o->keytype, o-...
0
26,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: struct kvm_device *kvm_device_from_filp(struct file *filp) { if (filp->f_op != &kvm_device_fops) return NULL; return filp->private_data; } Commit Message: KVM: Improve create VCPU parameter (CVE-2013-4587) In multiple functions the vcpu_id is used as an offset into a bitfield. Ag malicious user could spec...
0
21,290
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: internal::LauncherView* Launcher::GetLauncherViewForTest() { return launcher_view_; } Commit Message: ash: Add launcher overflow bubble. - Host a LauncherView in bubble to display overflown items; - Mouse wheel and two-finger scroll to scroll the LauncherView in bubble in case overflow bubble is overflown; - ...
0
8,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: void Splash::scaleImageYuXu(SplashImageSource src, void *srcData, SplashColorMode srcMode, int nComps, GBool srcAlpha, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, SplashBitmap *dest) { Guchar *lineBuf, *alphaLineBuf; Guint pix[splashMaxColorComps]; Guint alpha...
0
6,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: int av_codec_get_max_lowres(const AVCodec *codec) { return codec->max_lowres; } Commit Message: avcodec/utils: correct align value for interplay Fixes out of array access Fixes: 452/fuzz-1-ffmpeg_VIDEO_AV_CODEC_ID_INTERPLAY_VIDEO_fuzzer Found-by: continuous fuzzing process https://github.com/google/oss-fuz...
0
2,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 int rfcomm_sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) { struct sock *sk = sock->sk; struct rfcomm_dlc *d = rfcomm_pi(sk)->dlc; struct sk_buff *skb; int sent; if (test_bit(RFCOMM_DEFER_SETUP, &d->flags)) return -ENOTCONN; if (msg->msg_flags & MSG_OOB) return -EOP...
0
21,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: status_t IGraphicBufferConsumer::BufferItem::flatten( void*& buffer, size_t& size, int*& fds, size_t& count) const { if (size < BufferItem::getFlattenedSize()) { return NO_MEMORY; } uint32_t& flags = *static_cast<uint32_t*>(buffer); FlattenableUtils::advance(buffer, size, sizeof(uint32_t)); flags = ...
0
14,590
Analyze the following 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 free_sched_groups(struct sched_group *sg, int free_sgc) { struct sched_group *tmp, *first; if (!sg) return; first = sg; do { tmp = sg->next; if (free_sgc && atomic_dec_and_test(&sg->sgc->ref)) kfree(sg->sgc); kfree(sg); sg = tmp; } while (sg != first); } Commit Message: Merge br...
0
24,307
Analyze the following 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 IsValidElementName(Document* document, const String& name) { bool is_valid_dom_name = Document::IsValidName(name); bool is_valid_html_name = IsValidElementNamePerHTMLParser(name); if (UNLIKELY(is_valid_html_name != is_valid_dom_name)) { UseCounter::Count(document, is_va...
0
18,252
Analyze the following 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 crc32_update(struct shash_desc *desc, const u8 *data, unsigned int len) { u32 *crcp = shash_desc_ctx(desc); *crcp = __crc32_le(*crcp, data, len); return 0; } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run ...
0
17,744
Analyze the following 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 irq_time_write_end(void) { smp_wmb(); __this_cpu_inc(irq_time_seq.sequence); } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and...
0
10,089
Analyze the following 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 LayerTreeHost::ApplyPageScaleDeltaFromImplSide(float page_scale_delta) { DCHECK(CommitRequested()); page_scale_factor_ *= page_scale_delta; } Commit Message: Removed pinch viewport scroll offset distribution The associated change in Blink makes the pinch viewport a proper ScrollableArea meaning the nor...
0
29,668
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RuntimeConfigItem() : admin(NULL), config(NULL) { } Commit Message: CWE ID: CWE-134
0
4,496
Analyze the following 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 OggExtractor::countTracks() { return mInitCheck != OK ? 0 : 1; } Commit Message: Fix memory leak in OggExtractor Test: added a temporal log and run poc Bug: 63581671 Change-Id: I436a08e54d5e831f9fbdb33c26d15397ce1fbeba (cherry picked from commit 63079e7c8e12cda4eb124fbe565213d30b9ea34c) CWE ID: CWE-772
0
6,813
Analyze the following 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 VerifyNoDownloads() const { DownloadManager::DownloadVector items; GetDownloads(browser(), &items); return items.empty(); } Commit Message: When turning a download into a navigation, navigate the right frame Code changes from Nate Chapin <japhet@chromium.org> Bug: 926105 Change-Id: I098599...
0
6,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: virtual void SetUp() { svc_.encoding_mode = INTER_LAYER_PREDICTION_IP; svc_.log_level = SVC_LOG_DEBUG; svc_.log_print = 0; codec_iface_ = vpx_codec_vp9_cx(); const vpx_codec_err_t res = vpx_codec_enc_config_default(codec_iface_, &codec_enc_, 0); EXPECT_EQ(VPX_CODEC_OK, res); ...
1
28,375
Analyze the following 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 PerformXhrInFrame(content::RenderFrameHost* frame, const std::string& host, int port, const std::string& page) { bool success = false; EXPECT_TRUE(ExecuteScriptAndExtractBool( frame, base::StringPrintf(kPerformXhrJs, host.c_str...
0
27,135
Analyze the following 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 ZIPARCHIVE_METHOD(getStream) { struct zip *intern; zval *this = getThis(); struct zip_stat sb; char *filename; int filename_len; char *mode = "rb"; php_stream *stream; ze_zip_object *obj; if (!this) { RETURN_FALSE; } ZIP_FROM_OBJECT(intern, this); if (zend_parse_parameters(ZEND_NUM_ARGS() ...
0
5,088
Analyze the following 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 WebGLRenderingContextBase::SupportOwnOffscreenSurface( ExecutionContext* execution_context) { return false; } 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 thread. Bug: 881152...
0
14,911
Analyze the following 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 readSsidRid(struct airo_info*ai, SsidRid *ssidr) { return PC4500_readrid(ai, RID_SSID, ssidr, sizeof(*ssidr), 1); } Commit Message: net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_...
0
23,710
Analyze the following 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 AudioFlinger::EffectHandle::disable() { ALOGV("disable %p", this); if (!mHasControl) { return INVALID_OPERATION; } if (mEffect == 0) { return DEAD_OBJECT; } if (!mEnabled) { return NO_ERROR; } mEnabled = false; if (mEffect->suspended()) { return NO_ERROR; } status_t status = mEffe...
0
4,961
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void CompositorImpl::OnFirstSurfaceActivation(const viz::SurfaceInfo& info) { NOTREACHED(); } Commit Message: gpu/android : Add support for partial swap with surface control. Add support for PostSubBuffer to GLSurfaceEGLSurfaceControl. This should allow the display compositor to draw the minimum sub-rect nece...
0
15,957
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: iasecc_sdo_get_tagged_data(struct sc_card *card, int sdo_tag, struct iasecc_sdo *sdo) { struct sc_context *ctx = card->ctx; struct sc_apdu apdu; unsigned char sbuf[0x100]; size_t offs = sizeof(sbuf) - 1; unsigned char rbuf[0x400]; int rv; LOG_FUNC_CALLED(ctx); sbuf[offs--] = 0x80; sbuf[offs--] = sdo_ta...
0
28,779
Analyze the following 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 ip_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_buff *skb) { struct rtable *rt; struct flowi4 fl4; const struct iphdr *iph = (const struct iphdr *) skb->data; int oif = skb->dev->ifindex; u8 tos = RT_TOS(iph->tos); u8 prot = iph->protocol; u32 mark = skb->mark; rt = (struct r...
0
8,675
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::string DownloadResourceHandler::DebugString() const { const ResourceRequestInfoImpl* info = GetRequestInfo(); return base::StringPrintf("{" " url_ = " "\"%s\"" " info = {" " child_id = " "%d" "...
0
2,311
Analyze the following 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 ResourceMetadataDB::Clear() { level_db_.reset(); leveldb::DestroyDB(db_path_.value(), leveldb::Options()); Init(); } Commit Message: Remove parent* arg from GDataEntry ctor. * Remove static FromDocumentEntry from GDataEntry, GDataFile, GDataDirectory. Replace with InitFromDocumentEntry. * Move common...
0
19,088
Analyze the following 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 inet_peer *lookup_rcu(const struct inetpeer_addr *daddr, struct inet_peer_base *base) { struct inet_peer *u = rcu_dereference(base->root); int count = 0; while (u != peer_avl_empty) { int cmp = addr_compare(daddr, &u->daddr); if (cmp == 0) { /* Before taking a reference, check if ...
0
5,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: void RunInvTxfm(const int16_t *out, uint8_t *dst, int stride) { inv_txfm_(out, dst, stride); } Commit Message: Merge Conflict Fix CL to lmp-mr1-release for ag/849478 DO NOT MERGE - libvpx: Pull from upstream Current HEAD: 7105df53d7dc13d5e575bc8df714ec8d1da36b06 BUG=23452792 Change-Id: Ic78176fc369...
1
11,349
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _archive_write_disk_close(struct archive *_a) { struct archive_write_disk *a = (struct archive_write_disk *)_a; struct fixup_entry *next, *p; int ret; archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA, "archive_write_disk_close"); ret = _archive_w...
0
21,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: ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht) { Bucket *p, *end; IS_CONSISTENT(ht); HT_ASSERT(GC_REFCOUNT(ht) <= 1); if (ht->nNumUsed) { p = ht->arData; end = p + ht->nNumUsed; if (ht->pDestructor) { SET_INCONSISTENT(HT_IS_DESTROYING); if (ht->u.flags & (HASH_FLAG_PACKED|HASH_FLA...
0
24,813
Analyze the following 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 cac_find_and_initialize(sc_card_t *card, int initialize) { int r, index; cac_private_data_t *priv = NULL; /* already initialized? */ if (card->drv_data) { return SC_SUCCESS; } /* is this a CAC-2 specified in NIST Interagency Report 6887 - * "Government Smart Card Interoperability Specificat...
0
161
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport void DestroyImageProperties(Image *image) { assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); if (image->properties != (void *) NULL) image->prope...
0
18,793