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: rad_init_send_request(struct rad_handle *h, int *fd, struct timeval *tv) { int srv; /* Make sure we have a socket to use */ if (h->fd == -1) { struct sockaddr_in sin; if ((h->fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { #ifdef PHP_WIN32 generr(h, "Cannot create socket: %d", WSAGetLastError(...
0
31,539
Analyze the following 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 CheckSecurityForNodeVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::ToImpl(info.Holder()); ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "checkSecurityForNodeVoidMethod"); if (!BindingSecur...
0
134,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: XMPChunk::XMPChunk( ContainerChunk* parent ) : Chunk( parent, chunk_XMP , kChunk_XMP ) { } Commit Message: CWE ID: CWE-190
0
16,069
Analyze the following 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 LayoutBlockFlow::checkForPaginationLogicalHeightChange(LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight) { if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { LayoutUnit columnHeight; if (hasDefiniteLogicalHeight() || ...
0
122,968
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int lua_ap_sendfile(lua_State *L) { apr_finfo_t file_info; const char *filename; request_rec *r; luaL_checktype(L, 1, LUA_TUSERDATA); luaL_checktype(L, 2, LUA_TSTRING); r = ap_lua_check_request_rec(L, 1); filename = lua_tostring(L, 2); apr_stat(&file_info, filename, APR_F...
0
45,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: FPDF_PAGE PDFiumEngine::Form_GetCurrentPage(FPDF_FORMFILLINFO* param, FPDF_DOCUMENT document) { PDFiumEngine* engine = static_cast<PDFiumEngine*>(param); int index = engine->last_page_mouse_down_; if (index == -1) { index = engine->GetMostVisiblePage(); if...
0
140,289
Analyze the following 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 perf_event_switch_match(struct perf_event *event) { return event->attr.context_switch; } 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 still have events on. This will result in a use-after-free which is BAD. Simply do n...
0
56,101
Analyze the following 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_lf_deltas(VP8Context *s) { VP56RangeCoder *c = &s->c; int i; for (i = 0; i < 4; i++) { if (vp8_rac_get(c)) { s->lf_delta.ref[i] = vp8_rac_get_uint(c, 6); if (vp8_rac_get(c)) s->lf_delta.ref[i] = -s->lf_delta.ref[i]; } } ...
0
63,980
Analyze the following 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 ContentEncoding::ParseCompressionEntry(long long start, long long size, IMkvReader* pReader, ContentCompression* compression) { assert(pReader); assert(compression); long long pos = start; const long long stop = start + size; bool valid = false; while (pos < stop) { long long id, size; const l...
0
164,284
Analyze the following 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 comedi_device_file_info *comedi_get_device_file_info(unsigned minor) { unsigned long flags; struct comedi_device_file_info *info; BUG_ON(minor >= COMEDI_NUM_MINORS); spin_lock_irqsave(&comedi_file_info_table_lock, flags); info = comedi_file_info_table[minor]; spin_unlock_irqrestore(&comedi_file_info...
0
41,282
Analyze the following 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_setattr_size( struct xfs_inode *ip, struct iattr *iattr) { struct xfs_mount *mp = ip->i_mount; struct inode *inode = VFS_I(ip); xfs_off_t oldsize, newsize; struct xfs_trans *tp; int error; uint lock_flags = 0; bool did_zeroing = false; ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); ASSERT(xf...
0
88,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: bool IsGoogleHostname(base::StringPiece host, SubdomainPermission subdomain_permission) { url::CanonHostInfo host_info; return IsCanonicalHostGoogleHostname(net::CanonicalizeHost(host, &host_info), subdomain_permission); } Commit Message: Fix Chrom...
0
143,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: void hns_rcb_set_tx_ring_bs(struct hnae_queue *q, u32 buf_size) { u32 bd_size_type = hns_rcb_buf_size2type(buf_size); dsaf_write_dev(q, RCB_RING_TX_RING_BD_LEN_REG, bd_size_type); } Commit Message: net: hns: fix ethtool_get_strings overflow in hns driver hns_get_sset_count() returns HNS_NET_STATS_CN...
0
85,621
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AXTableCell::~AXTableCell() {} Commit Message: Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Review-Url: https://codereview.chromium.org/2793913007 Cr-Commit-Position: refs/heads/master@{#461858} CWE ID: CWE-254
0
127,407
Analyze the following 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(getNameIndex) { struct zip *intern; zval *self = getThis(); const char *name; zend_long flags = 0, index = 0; if (!self) { RETURN_FALSE; } ZIP_FROM_OBJECT(intern, self); if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &index, &flags) == FAILURE) { return; } name = z...
0
54,396
Analyze the following 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 BackRenderbuffer::Invalidate() { id_ = 0; } Commit Message: Framebuffer clear() needs to consider the situation some draw buffers are disabled. This is when we expose DrawBuffers extension. BUG=376951 TEST=the attached test case, webgl conformance R=kbr@chromium.org,bajones@chromium.org Review URL: htt...
0
120,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: void perf_output_sample(struct perf_output_handle *handle, struct perf_event_header *header, struct perf_sample_data *data, struct perf_event *event) { u64 sample_type = data->type; perf_output_put(handle, *header); if (sample_type & PERF_SAMPLE_IDENTIFIER) perf_output_put(handle, data->id); if ...
0
56,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: void ExtensionSettingsHandler::GetLocalizedValues( DictionaryValue* localized_strings) { RegisterTitle(localized_strings, "extensionSettings", IDS_MANAGE_EXTENSIONS_SETTING_WINDOWS_TITLE); localized_strings->SetString("extensionSettingsVisitWebsite", l10n_util::GetStringUTF16(IDS_EX...
1
170,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: BGD_DECLARE(gdImagePtr) gdImageScale(const gdImagePtr src, const unsigned int new_width, const unsigned int new_height) { gdImagePtr im_scaled = NULL; if (src == NULL || (uintmax_t)src->interpolation_id >= GD_METHOD_COUNT) { return NULL; } if (new_width == 0 || new_height == 0) { return NULL; } if (ne...
0
70,910
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void hns_nic_set_priv_ops(struct net_device *netdev) { struct hns_nic_priv *priv = netdev_priv(netdev); struct hnae_handle *h = priv->ae_handle; if (AE_IS_VER1(priv->enet_ver)) { priv->ops.fill_desc = fill_desc; priv->ops.get_rxd_bnum = get_rx_desc_bnum; priv->ops.maybe_stop_tx = hns_nic_maybe_st...
0
85,720
Analyze the following 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 SetElementIdForTesting(Layer* layer) { layer->SetElementId(LayerIdToElementIdForTesting(layer->id())); } Commit Message: (Reland) Discard compositor frames from unloaded web content This is a reland of https://codereview.chromium.org/2707243005/ with a small change to fix an uninitialized memory e...
0
137,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: Browser* Browser::Create(Profile* profile) { Browser* browser = new Browser(TYPE_TABBED, profile); browser->InitBrowserWindow(); return browser; } Commit Message: Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode via webkitRequestFullScreen(), telling the user how ...
0
97,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: bool canCollapseMarginBeforeWithChildren() const { return m_canCollapseMarginBeforeWithChildren; } Commit Message: Separate repaint and layout requirements of StyleDifference (Step 1) Previously StyleDifference was an enum that proximately bigger values imply smaller values (e.g. StyleDifferenceLayout impli...
0
116,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: GLenum GLES2DecoderImpl::DoCheckFramebufferStatus(GLenum target) { FramebufferManager::FramebufferInfo* framebuffer = GetFramebufferInfoForTarget(target); if (!framebuffer) { return GL_FRAMEBUFFER_COMPLETE; } GLenum completeness = framebuffer->IsPossiblyComplete(); if (completeness != GL_FRAME...
0
103,513
Analyze the following 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 InputDispatcher::setFocusedApplication( const sp<InputApplicationHandle>& inputApplicationHandle) { #if DEBUG_FOCUS ALOGD("setFocusedApplication"); #endif { // acquire lock AutoMutex _l(mLock); if (inputApplicationHandle != NULL && inputApplicationHandle->updateInfo()) { if (mFocusedApplicationHand...
0
163,828
Analyze the following 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 PageInfoBubbleView::WebContentsDestroyed() { weak_factory_.InvalidateWeakPtrs(); } Commit Message: Desktop Page Info/Harmony: Show close button for internal pages. The Harmony version of Page Info for internal Chrome pages (chrome://, chrome-extension:// and view-source:// pages) show a close button. Upd...
0
134,007
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DCTStream::reset() { int i, j; dctReset(gFalse); if (!readHeader()) { y = height; return; } if (numComps == 1) { compInfo[0].hSample = compInfo[0].vSample = 1; } mcuWidth = compInfo[0].hSample; mcuHeight = compInfo[0].vSample; for (i = 1; i < numComps; ++i) { if (compInfo...
0
4,038
Analyze the following 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 IGraphicBufferProducer::QueueBufferInput::getFlattenedSize() const { return sizeof(timestamp) + sizeof(isAutoTimestamp) + sizeof(dataSpace) + sizeof(crop) + sizeof(scalingMode) + sizeof(transform) + sizeof(stickyTransform) + sizeof(async) + fence->getFlattenedSize() + surfaceDamage.getFlattenedSi...
0
160,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: FT_CMap_New( FT_CMap_Class clazz, FT_Pointer init_data, FT_CharMap charmap, FT_CMap *acmap ) { FT_Error error = FT_Err_Ok; FT_Face face; FT_Memory memory; FT_CMap cmap; if ( clazz == NULL || charmap == NULL || charmap->...
0
10,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: int BN_GF2m_arr2poly(const int p[], BIGNUM *a) { int i; bn_check_top(a); BN_zero(a); for (i = 0; p[i] != -1; i++) { if (BN_set_bit(a, p[i]) == 0) return 0; } bn_check_top(a); return 1; } Commit Message: bn/bn_gf2m.c: avoid infinite loop wich malformed ECParamters...
0
44,251
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: get_target_file_for_link (GFile *src, GFile *dest_dir, const char *dest_fs_type, int count) { const char *editname; char *basename, *new_name; GFileInfo *info; GFile *dest; int max_length; max_...
0
61,073
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ScopedGLErrorSuppressor::~ScopedGLErrorSuppressor() { decoder_->ClearRealGLErrors(); } Commit Message: Revert "Revert 100494 - Fix bug in SimulateAttrib0.""" TEST=none BUG=95625 TBR=apatrick@chromium.org Review URL: http://codereview.chromium.org/7796016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1...
0
99,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: void qeth_core_free_discipline(struct qeth_card *card) { if (card->options.layer2) symbol_put(qeth_l2_discipline); else symbol_put(qeth_l3_discipline); card->discipline = NULL; } Commit Message: qeth: avoid buffer overflow in snmp ioctl Check user-defined length in snmp ioctl request and allow request on...
0
28,516
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int ntpd_main(int argc UNUSED_PARAM, char **argv) { #undef G struct globals G; struct pollfd *pfd; peer_t **idx2peer; unsigned cnt; memset(&G, 0, sizeof(G)); SET_PTR_TO_GLOBALS(&G); ntp_init(argv); /* If ENABLE_FEATURE_NTPD_SERVER, + 1 for listen_fd: */ cnt = G.peer_cnt + ENABLE_FEATURE_NTPD_SERVER; ...
0
9,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: void Part::guiActivateEvent(KParts::GUIActivateEvent *event) { Q_UNUSED(event) } Commit Message: CWE ID: CWE-78
0
9,902
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: find_var_ent(uschar * name) { int first = 0; int last = var_table_size; while (last > first) { int middle = (first + last)/2; int c = Ustrcmp(name, var_table[middle].name); if (c > 0) { first = middle + 1; continue; } if (c < 0) { last = middle; continue; } return &var_table[middle]; } return NULL...
0
12,663
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct key *key_get_instantiation_authkey(key_serial_t target_id) { char description[16]; struct keyring_search_context ctx = { .index_key.type = &key_type_request_key_auth, .index_key.description = description, .cred = current_cred(), .match_data.cmp = user_match, .match_data.raw_data = descr...
1
168,442
Analyze the following 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 adjust_insn_aux_data(struct bpf_verifier_env *env, u32 prog_len, u32 off, u32 cnt) { struct bpf_insn_aux_data *new_data, *old_data = env->insn_aux_data; int i; if (cnt == 1) return 0; new_data = vzalloc(sizeof(struct bpf_insn_aux_data) * prog_len); if (!new_data) return -ENOMEM; memcpy(n...
0
59,178
Analyze the following 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 WebGLRenderingContextBase::getContextAttributes( Nullable<WebGLContextAttributes>& result) { if (isContextLost()) return; result.Set(ToWebGLContextAttributes(CreationAttributes())); if (CreationAttributes().depth() && !GetDrawingBuffer()->HasDepthBuffer()) result.Get().setDepth(false); if...
0
133,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: void PasswordAutofillAgent::SetLoggingState(bool active) { logging_state_active_ = active; } Commit Message: [Android][TouchToFill] Use FindPasswordInfoForElement for triggering Use for TouchToFill the same triggering logic that is used for regular suggestions. Bug: 1010233 Change-Id: I111d4eac4ce94dd94b8609...
0
137,657
Analyze the following 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 tcp_try_undo_loss(struct sock *sk, bool frto_undo) { struct tcp_sock *tp = tcp_sk(sk); if (frto_undo || tcp_may_undo(tp)) { tcp_undo_cwnd_reduction(sk, true); DBGUNDO(sk, "partial loss"); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPLOSSUNDO); if (frto_undo) NET_INC_STATS_BH(sock_net(sk)...
0
55,416
Analyze the following 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 RenderFrameHostImpl::OnSmartClipDataExtracted(uint32_t id, base::string16 text, base::string16 html) { auto it = smart_clip_callbacks_.find(id); if (it != smart_clip_callbacks_.end()) { it->second.Ru...
0
127,869
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ScopedFrameBlamer::ScopedFrameBlamer(LocalFrame* frame) : frame_(IsScopedFrameBlamerEnabled() ? frame : nullptr) { if (LIKELY(!frame_)) return; LocalFrameClient* client = frame_->Client(); if (!client) return; if (BlameContext* context = client->GetFrameBlameContext()) context->Enter(); } ...
0
154,879
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: diskfile_send(struct iperf_stream *sp) { int r; r = read(sp->diskfile_fd, sp->buffer, sp->test->settings->blksize); if (r == 0) sp->test->done = 1; else r = sp->snd2(sp); return r; } Commit Message: Fix a buffer overflow / heap corruption issue that could occur if a malformed JSON s...
0
53,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: void TrayCast::DestroyDefaultView() { default_ = nullptr; } Commit Message: Allow the cast tray to function as expected when the installed extension is missing API methods. BUG=489445 Review URL: https://codereview.chromium.org/1145833003 Cr-Commit-Position: refs/heads/master@{#330663} CWE ID: CWE-79
0
119,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: static long sock_do_ioctl(struct net *net, struct socket *sock, unsigned int cmd, unsigned long arg) { int err; void __user *argp = (void __user *)arg; err = sock->ops->ioctl(sock, cmd, arg); /* * If this ioctl is unknown try to hand it down * to the NIC driver. */ if (err != -ENOIOCTLCMD) ret...
0
82,270
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WtsSessionProcessDelegate::~WtsSessionProcessDelegate() { core_->Stop(); } Commit Message: Validate and report peer's PID to WorkerProcessIpcDelegate so it will be able to duplicate handles to and from the worker process. As a side effect WorkerProcessLauncher::Delegate is now responsible for retrieving the c...
0
118,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: void Curl_cookie_clearsess(struct CookieInfo *cookies) { struct Cookie *first, *curr, *next, *prev = NULL; if(!cookies || !cookies->cookies) return; first = curr = prev = cookies->cookies; for(; curr; curr = next) { next = curr->next; if(!curr->expires) { if(first == curr) fir...
0
32,446
Analyze the following 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 cachedDirtyableAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) { v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedDirtyableAttributeRaises"); TestObject* imp = V8TestObject::toNative(info.Holder()); if (!imp->isValueDirty()) { ...
0
121,585
Analyze the following 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 RTCPeerConnectionHandlerDummy::setRemoteDescription(PassRefPtr<RTCVoidRequest>, PassRefPtr<RTCSessionDescriptionDescriptor>) { } Commit Message: Unreviewed, rolling out r127612, r127660, and r127664. http://trac.webkit.org/changeset/127612 http://trac.webkit.org/changeset/127660 http://trac.webkit.org/chang...
1
170,350
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _crypt_extended_init(void) { int i, j, b, k, inbit, obit; uint32_t *p, *il, *ir, *fl, *fr; uint32_t *bits28, *bits24; u_char inv_key_perm[64]; u_char u_key_perm[56]; u_char inv_comp_perm[56]; u_char init_perm[64], final_perm[64]; u_char u_sbox[8][64]; u_char un_pbox[32]; bits24 = (bits28 = bits32 + 4) ...
0
10,872
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cff_parse_num( CFF_Parser parser, FT_Byte** d ) { if ( **d == 30 ) { /* binary-coded decimal is truncated to integer */ return cff_parse_real( *d, parser->limit, 0, NULL ) >> 16; } else if ( **d == 255 ) { /* 16.16 fixed point is used internally for C...
0
13,246
Analyze the following 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_v4_timewait_ack(struct sock *sk, struct sk_buff *skb) { struct inet_timewait_sock *tw = inet_twsk(sk); struct tcp_timewait_sock *tcptw = tcp_twsk(sk); tcp_v4_send_ack(skb, tcptw->tw_snd_nxt, tcptw->tw_rcv_nxt, tcptw->tw_rcv_wnd >> tw->tw_rcv_wscale, tcptw->tw_ts_recent, tw->tw_bound_d...
0
19,048
Analyze the following 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 WebSocketJob::OnConnected( SocketStream* socket, int max_pending_send_allowed) { if (state_ == CLOSED) return; DCHECK_EQ(CONNECTING, state_); if (delegate_) delegate_->OnConnected(socket, max_pending_send_allowed); } Commit Message: Use ScopedRunnableMethodFactory in WebSocketJob Don't po...
0
98,377
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DiceTurnSyncOnHelper::AbortAndDelete() { if (signin_aborted_mode_ == SigninAbortedMode::REMOVE_ACCOUNT) { token_service_->RevokeCredentials(account_info_.account_id); } delete this; } Commit Message: [signin] Add metrics to track the source for refresh token updated events This CL add a sourc...
1
172,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: std::wstring GetSwitchValueFromCommandLine(const std::wstring& command_line, const std::wstring& switch_name) { assert(!command_line.empty()); assert(!switch_name.empty()); std::vector<std::wstring> as_array = TokenizeCommandLineToArray(command_line); std...
1
173,062
Analyze the following 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 TestWebKitPlatformSupport::SetThemeEngine(WebKit::WebThemeEngine* engine) { active_theme_engine_ = engine ? engine : WebKitPlatformSupportImpl::themeEngine(); } Commit Message: Use a new scheme for swapping out RenderViews. BUG=118664 TEST=none Review URL: http://codereview.chromium.org/9720004 ...
0
108,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 update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new) { int id = new->id; int i = slots->id_to_index[id]; struct kvm_memory_slot *mslots = slots->memslots; WARN_ON(mslots[i].id != id); if (!new->npages) { WARN_ON(!mslots[i].npages); if (mslots[i].npages) slots->u...
0
71,277
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ptaGetCount(PTA *pta) { PROCNAME("ptaGetCount"); if (!pta) return ERROR_INT("pta not defined", procName, 0); return pta->n; } Commit Message: Security fixes: expect final changes for release 1.75.3. * Fixed a debian security issue with fscanf() reading a string with possible buffer overf...
0
84,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: void comps_objmrtree_create_u(COMPS_Object * obj, COMPS_Object **args) { (void)args; comps_objmrtree_create((COMPS_ObjMRTree*)obj, NULL); } Commit Message: Fix UAF in comps_objmrtree_unite function The added field is not used at all in many places and it is probably the left-over of some copy-paste. CWE...
0
91,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: do_test(struct display *dp, const char *file) /* Exists solely to isolate the setjmp clobbers */ { int ret = setjmp(dp->error_return); if (ret == 0) { test_one_file(dp, file); return 0; } else if (ret < ERRORS) /* shouldn't longjmp on warnings */ display_log(dp, INTERNAL_ERROR, "unexpected re...
0
159,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: PermissionsAPIUnitTest() {} Commit Message: [Extensions] Have URLPattern::Contains() properly check schemes Have URLPattern::Contains() properly check the schemes of the patterns when evaluating if one pattern contains another. This is important in order to prevent extensions from requesting chrome:-scheme pe...
0
153,448
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: smtphelo_handler(vector_t *strvec) { char *helo_name; if (vector_size(strvec) < 2) return; helo_name = MALLOC(strlen(strvec_slot(strvec, 1)) + 1); if (!helo_name) return; strcpy(helo_name, strvec_slot(strvec, 1)); global_data->smtp_helo_name = helo_name; } Commit Message: Add command line and config...
0
75,850
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderViewHostManagerTestWebUIControllerFactory() : should_create_webui_(false) { } Commit Message: Allow browser to handle all WebUI navigations. BUG=113496 TEST="Google Dashboard" link in Sync settings loads in new process. Review URL: http://codereview.chromium.org/9663045 git-svn-id: svn://svn.ch...
0
108,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: void NavigationControllerImpl::LoadIfNecessary() { if (!needs_reload_) return; if (pending_entry_) { NavigateToPendingEntry(ReloadType::NONE, nullptr /* navigation_ui_data */); } else if (last_committed_entry_index_ != -1) { pending_entry_ = entries_[last_committed_entry_index_].get(); pend...
0
153,988
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: get_frac_paths_needed_for_circs(const or_options_t *options, const networkstatus_t *ns) { #define DFLT_PCT_USABLE_NEEDED 60 if (options->PathsNeededToBuildCircuits >= 0.0) { return options->PathsNeededToBuildCircuits; } else { return networkstatus_get_param(ns, "min_pat...
0
69,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: ImageManager* image_manager() { return group_->image_manager(); } Commit Message: Framebuffer clear() needs to consider the situation some draw buffers are disabled. This is when we expose DrawBuffers extension. BUG=376951 TEST=the attached test case, webgl conformance R=kbr@chromium.org,bajones@chromi...
0
121,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: void GLES2DecoderImpl::DoDetachShader( GLuint program_client_id, GLint shader_client_id) { ProgramManager::ProgramInfo* program_info = GetProgramInfoNotShader( program_client_id, "glDetachShader"); if (!program_info) { return; } ShaderManager::ShaderInfo* shader_info = GetShaderInfoNotProgra...
0
99,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: static int def_generate_session_id(const SSL *ssl, unsigned char *id, unsigned int *id_len) { unsigned int retry = 0; do if (RAND_pseudo_bytes(id, *id_len) <= 0) return 0; while (SSL_has_matching_session_id(ssl, id, *id_len) && (++retry...
0
12,803
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: path_mountpoint(int dfd, const struct filename *name, struct path *path, unsigned int flags) { struct nameidata nd; int err; err = path_init(dfd, name, flags, &nd); if (unlikely(err)) goto out; err = mountpoint_last(&nd, path); while (err > 0) { void *cookie; struct path link = *path; err = may_...
0
42,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: void BrowserView::FocusBookmarksToolbar() { DCHECK(!immersive_mode_controller_->IsEnabled()); if (bookmark_bar_view_.get() && bookmark_bar_view_->visible() && bookmark_bar_view_->GetPreferredSize().height() != 0) { bookmark_bar_view_->SetPaneFocusAndFocusDefault(); } } Commit Message: Mac: ...
0
155,159
Analyze the following 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 LiveSyncTest::TriggerMigrationDoneError( const syncable::ModelTypeSet& model_types) { ASSERT_TRUE(ServerSupportsErrorTriggering()); std::string path = "chromiumsync/migrate"; char joiner = '?'; for (syncable::ModelTypeSet::const_iterator it = model_types.begin(); it != model_types.end(); +...
0
100,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: bool Browser::IsFullscreenForTabOrPending( const WebContents* web_contents) const { return exclusive_access_manager_->fullscreen_controller() ->IsFullscreenForTabOrPending(web_contents); } Commit Message: Don't focus the location bar for NTP navigations in non-selected tabs. BUG=677716 TEST=See bug ...
0
139,016
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: NavigationEntryImpl* NavigationControllerImpl::GetVisibleEntry() const { if (transient_entry_index_ != -1) return entries_[transient_entry_index_].get(); bool safe_to_show_pending = pending_entry_ && pending_entry_index_ == -1 && (!pending_entry_->is_renderer_initiated() || IsUnmodifiedB...
0
137,783
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: d_to_tv(double d, struct timeval *tv) { tv->tv_sec = (long)d; tv->tv_usec = (d - tv->tv_sec) * 1000000; } Commit Message: CWE ID: CWE-399
0
9,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: bool MockContentSettingsClient::allowImage(bool enabled_per_settings, const blink::WebURL& image_url) { bool allowed = enabled_per_settings && flags_->images_allowed(); if (flags_->dump_web_content_settings_client_callbacks() && delegate_) { delegate_->PrintMessa...
0
128,721
Analyze the following 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 inode_set_flags(struct inode *inode, unsigned int flags, unsigned int mask) { unsigned int old_flags, new_flags; WARN_ON_ONCE(flags & ~mask); do { old_flags = ACCESS_ONCE(inode->i_flags); new_flags = (old_flags & ~mask) | flags; } while (unlikely(cmpxchg(&inode->i_flags, old_flags, new_...
0
36,876
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void tls1_set_cert_validity(SSL *s) { tls1_check_chain(s, NULL, NULL, NULL, SSL_PKEY_RSA_ENC); tls1_check_chain(s, NULL, NULL, NULL, SSL_PKEY_RSA_SIGN); tls1_check_chain(s, NULL, NULL, NULL, SSL_PKEY_DSA_SIGN); tls1_check_chain(s, NULL, NULL, NULL, SSL_PKEY_DH_RSA); tls1_check_chain(s, NULL, N...
0
6,177
Analyze the following 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 __rpc_wait_for_completion_task(struct rpc_task *task, int (*action)(void *)) { if (action == NULL) action = rpc_wait_bit_killable; return out_of_line_wait_on_bit(&task->tk_runstate, RPC_TASK_ACTIVE, action, TASK_KILLABLE); } Commit Message: NLM: Don't hang forever on NLM unlock requests If the NLM da...
0
34,946
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _dbus_header_reinit (DBusHeader *header, int byte_order) { _dbus_string_set_length (&header->data, 0); header->byte_order = byte_order; header->padding = 0; _dbus_header_cache_invalidate_all (header); } Commit Message: CWE ID: CWE-20
0
2,754
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _upnp_delete_redir(unsigned short eport, int proto) { int r; #if defined(__linux__) r = delete_redirect_and_filter_rules(eport, proto); #elif defined(USE_PF) r = delete_redirect_and_filter_rules(ext_if_name, eport, proto); #else r = delete_redirect_rule(ext_if_name, eport, proto); delete_filter_rule(ext_if_n...
0
89,830
Analyze the following 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 ~HTTPSRequestTest() {} Commit Message: Tests were marked as Flaky. BUG=151811,151810 TBR=droger@chromium.org,shalev@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/10968052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158204 0039d316-1c4b-4281-b951-d872f2087c98 CWE ...
0
102,301
Analyze the following 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_entry_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name, int namlen, u64 ino) { *p++ = xdr_one; /* mark entry present */ p = xdr_encode_hyper(p, ino); /* file id */ p = xdr_encode_array(p, name, namlen);/* name length & name */ cd->offset = p; /* remember pointer */ ...
0
65,255
Analyze the following 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 anyCallbackFunctionOptionalAnyArgMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::anyCallbackFunctionOptionalAnyArgMethodMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"...
0
122,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: void BackFramebuffer::AttachRenderTexture(BackTexture* texture) { DCHECK_NE(id_, 0u); ScopedGLErrorSuppressor suppressor("BackFramebuffer::AttachRenderTexture", decoder_->error_state_.get()); ScopedFramebufferBinder binder(decoder_, id_); GLuint attach_id = texture ? t...
0
141,183
Analyze the following 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 ChromeClientImpl::shouldReportDetailedMessageForSource(const String& url) { return m_webView->client() && m_webView->client()->shouldReportDetailedMessageForSource(url); } Commit Message: Delete apparently unused geolocation declarations and include. BUG=336263 Review URL: https://codereview.chromium....
0
118,664
Analyze the following 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 hblur(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int w, int h, int radius, int power, uint8_t *temp[2]) { int y; if (radius == 0 && dst == src) return; for (y = 0; y < h; y++) blur_power(dst + y*dst_linesize, 1, src + y*src_lin...
0
29,719
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _pango_emoji_iter_init (PangoEmojiIter *iter, const char *text, int length) { iter->text_start = text; if (length >= 0) iter->text_end = text + length; else iter->text_end = text + strlen (text); iter->start = text; iter->end = text; iter->is_emoji = (gboolean) 2; /* HAC...
0
79,122
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: device_luks_change_passphrase (Device *device, const char *old_secret, const char *new_secret, DBusGMethodInvocation *context) { /* No need to check for busy; we can actually do this while the device is unlocked as *...
0
11,665
Analyze the following 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 rt_bind_exception(struct rtable *rt, struct fib_nh_exception *fnhe, __be32 daddr, const bool do_cache) { bool ret = false; spin_lock_bh(&fnhe_lock); if (daddr == fnhe->fnhe_daddr) { struct rtable __rcu **porig; struct rtable *orig; int genid = fnhe_genid(dev_net(rt->dst.dev)); i...
0
62,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: static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image, *image2=NULL, *rotated_image; register Quantum *q; unsigned int status; MATHeader MATLAB_HDR; size_t size; size_t CellType; QuantumInfo *quantum_info; ImageInfo *clone_info; int i; ssize_t ldbl...
1
169,554
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int mov_write_minf_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track) { int64_t pos = avio_tell(pb); int ret; avio_wb32(pb, 0); /* size */ ffio_wfourcc(pb, "minf"); if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) mov_write_vmhd_tag(pb); else if ...
0
79,376
Analyze the following 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 FeatureEntry* GetFeatureEntries(size_t* count) { if (!GetEntriesForTesting()->empty()) { *count = GetEntriesForTesting()->size(); return GetEntriesForTesting()->data(); } *count = base::size(kFeatureEntries); return kFeatureEntries; } Commit Message: Add feature and flag to enable incognito...
0
137,030
Analyze the following 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 KURL& DocumentLoader::originalURL() const { return m_originalRequestCopy.url(); } Commit Message: Unreviewed, rolling out r147402. http://trac.webkit.org/changeset/147402 https://bugs.webkit.org/show_bug.cgi?id=112903 Source/WebCore: * dom/Document.cpp: (WebCore::Document::processHttpEquiv): * loade...
0
105,734
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vrrp_register_workers(list l) { sock_t *sock; timeval_t timer; element e; /* Init compute timer */ memset(&timer, 0, sizeof(timer)); /* Init the VRRP instances state */ vrrp_init_state(vrrp_data->vrrp); /* Init VRRP instances sands */ vrrp_init_sands(vrrp_data->vrrp); /* Init VRRP tracking scripts *...
0
76,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 ecb_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { struct des3_ede_x86_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); struct blkcipher_walk walk; blkcipher_walk_init(&walk, dst, src, nbytes); return ecb_crypt(desc, &walk, ctx->de...
0
46,970
Analyze the following 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 uint16_t extension_payload(bitfile *ld, drc_info *drc, uint16_t count) { uint16_t i, n, dataElementLength; uint8_t dataElementLengthPart; uint8_t align = 4, data_element_version, loopCounter; uint8_t extension_type = (uint8_t)faad_getbits(ld, 4 DEBUGVAR(1,87,"extension_payload(): e...
0
88,378
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebCachePolicy DetermineWebCachePolicy(RequestMethod method, RequestType request_type, ResourceType resource_type, FrameLoadType load_type) { switch (load_type) { case kFrameLoadTypeStandard:...
0
138,726
Analyze the following 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 ssize_t pstr_store(struct device *kdev, struct device_attribute *kattr, const char *buf, size_t count) { struct hid_device *hdev = to_hid_device(kdev); struct cp2112_pstring_attribute *attr = container_of(kattr, struct cp2112_pstring_attribute, attr); struct cp2112_string_report report; int...
0
66,470
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gst_asf_demux_process_header_ext (GstASFDemux * demux, guint8 * data, guint64 size) { GstFlowReturn ret = GST_FLOW_OK; guint64 hdr_size; /* Get the rest of the header's header */ if (size < (16 + 2 + 4)) goto not_enough_data; /* skip GUID and two other bytes */ gst_asf_demux_skip_bytes (16 +...
0
68,571