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: HeadlessDevToolsClientMinimizeWindowTest() : HeadlessDevToolsClientChangeWindowStateTest( browser::WindowState::MINIMIZED){}; Commit Message: Implicitly bypass localhost when proxying requests. This aligns Chrome's behavior with the Windows and macOS proxy resolvers (but not Firefox). Concr...
0
144,755
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ParamTraits<gfx::Size>::Write(Message* m, const gfx::Size& p) { m->WriteInt(p.width()); m->WriteInt(p.height()); } Commit Message: Beware of print-read inconsistency when serializing GURLs. BUG=165622 Review URL: https://chromiumcodereview.appspot.com/11576038 git-svn-id: svn://svn.chromium.org/chrom...
0
117,473
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static MagickBooleanType WriteARTImage(const ImageInfo *image_info,Image *image) { MagickBooleanType status; QuantumInfo *quantum_info; register const PixelPacket *p; size_t length; ssize_t count, y; unsigned char *pixels; /* Open output image file. */ asser...
0
71,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 __exit tcp_illinois_unregister(void) { tcp_unregister_congestion_control(&tcp_illinois); } Commit Message: net: fix divide by zero in tcp algorithm illinois Reading TCP stats when using TCP Illinois congestion control algorithm can cause a divide by zero kernel oops. The division by zero occur in ...
0
18,535
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool WebLocalFrameImpl::ExecuteCommand(const WebString& name, const WebString& value) { DCHECK(GetFrame()); WebPluginContainerImpl* plugin_container = GetFrame()->GetWebPluginContainer(); if (plugin_container && plugin_container->ExecuteEditCommand(name, value))...
0
134,293
Analyze the following 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 struct inode *dquot_to_inode(struct dquot *dquot) { return sb_dqopt(dquot->dq_sb)->files[dquot->dq_type]; } Commit Message: ext4: fix undefined behavior in ext4_fill_flex_info() Commit 503358ae01b70ce6909d19dd01287093f6b6271c ("ext4: avoid divide by zero when trying to mount a corrupted file syst...
0
20,437
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: zsetdevice(i_ctx_t *i_ctx_p) { gx_device *dev = gs_currentdevice(igs); os_ptr op = osp; int code = 0; check_write_type(*op, t_device); if (dev->LockSafetyParams) { /* do additional checking if locked */ if(op->value.pdevice != dev) /* don't allow a different device ...
1
164,638
Analyze the following 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 sctp_getsockopt_recvrcvinfo(struct sock *sk, int len, char __user *optval, int __user *optlen) { int val = 0; if (len < sizeof(int)) return -EINVAL; len = sizeof(int); if (sctp_sk(sk)->recvrcvinfo) val = 1; if (put_user(len, optlen)) return -EFAULT; if (copy_to_user(...
0
43,550
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: apply_nonancestor_delayed_set_stat (char const *file_name, bool after_links) { size_t file_name_len = strlen (file_name); bool check_for_renamed_directories = 0; while (delayed_set_stat_head) { struct delayed_set_stat *data = delayed_set_stat_head; bool skip_this_one = 0; struct stat ...
0
9,344
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport MagickBooleanType TransformImages(Image **images, const char *crop_geometry,const char *image_geometry,ExceptionInfo *exception) { Image *image, **image_list, *transform_images; MagickStatusType status; register ssize_t i; assert(images != (Image **) NULL); assert((...
0
74,027
Analyze the following 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 HTMLInputElement::setValueAsNumber(double newValue, ExceptionCode& ec, TextFieldEventBehavior eventBehavior) { if (!std::isfinite(newValue)) { ec = NOT_SUPPORTED_ERR; return; } m_inputType->setValueAsDouble(newValue, eventBehavior, ec); } Commit Message: Setting input.x-webkit-sp...
0
113,009
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: set_desktop_file_keys_from_client (GsmClient *client, GKeyFile *keyfile) { SmProp *prop; char *name; char *comment; prop = find_property (GSM_XSMP_CLIENT (client), SmProgram, NULL); name = g_strdup (prop->vals[0].value); com...
0
63,578
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: qboolean FS_IsDemoExt(const char *filename, int namelen) { char *ext_test; int index, protocol; ext_test = strrchr(filename, '.'); if(ext_test && !Q_stricmpn(ext_test + 1, DEMOEXT, ARRAY_LEN(DEMOEXT) - 1)) { protocol = atoi(ext_test + ARRAY_LEN(DEMOEXT)); if(protocol == com_protocol->integer) return...
0
95,916
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GraphicsLayerFactory* RenderLayerCompositor::graphicsLayerFactory() const { if (Page* page = this->page()) return page->chrome().client().graphicsLayerFactory(); return 0; } Commit Message: Disable some more query compositingState asserts. This gets the tests passing again on Mac. See the bug fo...
0
113,805
Analyze the following 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 TextTrackCue::Trace(blink::Visitor* visitor) { visitor->Trace(track_); EventTargetWithInlineData::Trace(visitor); } Commit Message: Support negative timestamps of TextTrackCue Ensure proper behaviour for negative timestamps of TextTrackCue. 1. Cues with negative startTime should become active from 0s. ...
0
125,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: match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, const unsigned char *s, size_t nbytes, size_t offset, int mode, int text, int flip, int recursion_level, int *printed_something, int *need_separator, int *returnval) { uint32_t magindex = 0; unsigned int cont_level = 0; int returnval...
0
14,831
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLboolean WebGL2RenderingContextBase::isTransformFeedback( WebGLTransformFeedback* feedback) { if (isContextLost() || !feedback) return 0; if (!feedback->HasEverBeenBound()) return 0; return ContextGL()->IsTransformFeedback(feedback->Object()); } Commit Message: Validate all incoming Web...
1
173,126
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport, struct nvmet_fc_fcp_iod *fod) { struct nvme_fc_cmd_iu *cmdiu = &fod->cmdiubuf; int ret; /* * Fused commands are currently not supported in the linux * implementation. * * As such, the implementation of the FC transport does not * look at ...
0
93,615
Analyze the following 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 nsc_decode(NSC_CONTEXT* context) { UINT16 x; UINT16 y; UINT16 rw = ROUND_UP_TO(context->width, 8); BYTE shift = context->ColorLossLevel - 1; /* colorloss recovery + YCoCg shift */ BYTE* bmpdata = context->BitmapData; for (y = 0; y < context->height; y++) { const BYTE* yplane; const B...
1
169,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: int DateTimeSymbolicFieldElement::valueAsInteger() const { return m_selectedIndex; } Commit Message: INPUT_MULTIPLE_FIELDS_UI: Inconsistent value of aria-valuetext attribute https://bugs.webkit.org/show_bug.cgi?id=107897 Reviewed by Kentaro Hara. Source/WebCore: aria-valuetext and aria-valuenow attribut...
0
103,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 cmd_xfer(const char *tag, const char *name, const char *toserver, const char *topart) { int r = 0, partial_success = 0, mbox_count = 0; struct xfer_header *xfer = NULL; struct xfer_list list = { &imapd_namespace, imapd_userid, NULL, 0, NULL }; struct xfer_item *ite...
0
95,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: PHP_FUNCTION(imageconvolution) { zval *SIM, *hash_matrix; zval **var = NULL, **var2 = NULL; gdImagePtr im_src = NULL; double div, offset; int nelem, i, j, res; float matrix[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}}; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "radd", &SIM, &hash_matrix, &div, &offset) ...
0
50,201
Analyze the following 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::writeDoubleVector(const std::unique_ptr<std::vector<double>>& val) { return writeNullableTypedVector(val, &Parcel::writeDouble); } Commit Message: Add bound checks to utf16_to_utf8 Bug: 29250543 Change-Id: I518e7b2fe10aaa3f1c1987586a09b1110aff7e1a (cherry picked from commit 7e93b2ddcb49b5365fb...
0
163,615
Analyze the following 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() { source_stride_ = (width_ + 31) & ~31; reference_stride_ = width_ * 2; rnd_.Reset(ACMRandom::DeterministicSeed()); } Commit Message: Merge Conflict Fix CL to lmp-mr1-release for ag/849478 DO NOT MERGE - libvpx: Pull from upstream Current HEAD: 7105df53d7dc13d5e575bc8d...
1
174,577
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void sco_sock_cleanup_listen(struct sock *parent) { struct sock *sk; BT_DBG("parent %p", parent); /* Close not yet accepted channels */ while ((sk = bt_accept_dequeue(parent, NULL))) { sco_sock_close(sk); sco_sock_kill(sk); } parent->sk_state = BT_CLOSED; sock_set_flag(parent, SOCK_ZAPPED); ...
0
27,743
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void json_tokener_free(struct json_tokener *tok) { json_tokener_reset(tok); if (tok->pb) printbuf_free(tok->pb); if (tok->stack) free(tok->stack); free(tok); } Commit Message: Patch to address the following issues: * CVE-2013-6371: hash collision denial of service * CVE-2013-6370: buffer overflow if siz...
0
40,945
Analyze the following 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::pipeRunAACMYK8(SplashPipe *pipe) { Guchar aSrc, aDest, alpha2, aResult; SplashColor cDest; Guchar cResult0, cResult1, cResult2, cResult3; cDest[0] = pipe->destColorPtr[0]; cDest[1] = pipe->destColorPtr[1]; cDest[2] = pipe->destColorPtr[2]; cDest[3] = pipe->destColorPtr[3]; aDest = *p...
0
4,119
Analyze the following 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 RenderFrameHostManager::CreateSpeculativeRenderFrameHost( SiteInstance* old_instance, SiteInstance* new_instance) { CHECK(new_instance); CHECK_NE(old_instance, new_instance); if (!new_instance->GetProcess()->Init()) return false; CreateProxiesForNewRenderFrameHost(old_instance, new_inst...
0
146,821
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() { browser_client_.reset(switches::IsRunWebTestsSwitchPresent() ? new LayoutTestContentBrowserClient : new ShellContentBrowserClient); return browser_client_.get(); } Commit Message: ...
0
131,052
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SPL_METHOD(Array, setFlags) { zval *object = getThis(); spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); long ar_flags = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ar_flags) == FAILURE) { return; } intern->ar_flags = (intern->ar_flags & SP...
0
12,340
Analyze the following 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 WebContext::setHostMappingRules(const QStringList& rules) { DCHECK(!IsInitialized()); construct_props_->host_mapping_rules.clear(); for (QStringList::const_iterator it = rules.cbegin(); it != rules.cend(); ++it) { construct_props_->host_mapping_rules.push_back((*it).toStdString()); } } ...
0
17,008
Analyze the following 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 jsvIsNameWithValue(const JsVar *v) { return v && (v->flags&JSV_VARTYPEMASK)>=_JSV_NAME_WITH_VALUE_START && (v->flags&JSV_VARTYPEMASK)<=_JSV_NAME_WITH_VALUE_END; } Commit Message: fix jsvGetString regression CWE ID: CWE-119
0
82,477
Analyze the following 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::ExtensionRuntimeData::ExtensionRuntimeData() : background_page_ready(false), being_upgraded(false) { } Commit Message: Limit extent of webstore app to just chrome.google.com/webstore. BUG=93497 TEST=Try installing extensions and apps from the webstore, starting both being initially l...
0
98,563
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sBIT0_error_fn(png_structp pp, png_infop pi) { /* 0 is invalid... */ png_color_8 bad; bad.red = bad.green = bad.blue = bad.gray = bad.alpha = 0; png_set_sBIT(pp, pi, &bad); } Commit Message: DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f3597b691b63bc0bf46084833 (cherry ...
0
160,027
Analyze the following 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 deflate_comp_exit(struct deflate_ctx *ctx) { zlib_deflateEnd(&ctx->comp_stream); vfree(ctx->comp_stream.workspace); } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to ...
0
47,221
Analyze the following 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 ns_common *netns_get(struct task_struct *task) { struct net *net = NULL; struct nsproxy *nsproxy; task_lock(task); nsproxy = task->nsproxy; if (nsproxy) net = get_net(nsproxy->net_ns); task_unlock(task); return net ? &net->ns : NULL; } Commit Message: net: Fix double free and memory corr...
0
86,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: content::KeyboardEventProcessingResult DevToolsWindow::PreHandleKeyboardEvent( WebContents* source, const content::NativeWebKeyboardEvent& event) { BrowserWindow* inspected_window = GetInspectedBrowserWindow(); if (inspected_window) { return inspected_window->PreHandleKeyboardEvent(event); } r...
0
151,072
Analyze the following 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 clamp_mv(VP8mvbounds *s, VP56mv *dst, const VP56mv *src) { dst->x = av_clip(src->x, av_clip(s->mv_min.x, INT16_MIN, INT16_MAX), av_clip(s->mv_max.x, INT16_MIN, INT16_MAX)); dst->y = av_clip(src->y, av_clip(s->mv_min.y, INT16_MIN, INT16_MAX), a...
0
63,950
Analyze the following 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 pppol2tp_session_setsockopt(struct sock *sk, struct l2tp_session *session, int optname, int val) { int err = 0; struct pppol2tp_session *ps = l2tp_session_priv(session); switch (optname) { case PPPOL2TP_SO_RECVSEQ: if ((val != 0) && (val != 1)) { err = -EINVAL; break;...
0
36,425
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BackendImpl::BackendImpl( const base::FilePath& path, scoped_refptr<BackendCleanupTracker> cleanup_tracker, const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread, net::NetLog* net_log) : cleanup_tracker_(std::move(cleanup_tracker)), background_queue_(this, FallbackToInternalIfN...
1
172,696
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int rpmPackageFilesRemove(rpmts ts, rpmte te, rpmfiles files, rpmpsm psm, char ** failedFile) { rpmfi fi = rpmfilesIter(files, RPMFI_ITER_BACK); rpmfs fs = rpmteGetFileStates(te); rpmPlugins plugins = rpmtsPlugins(ts); struct stat sb; int rc = 0; char *fpath = NULL; whil...
0
67,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: static int set_haschildren(const mbentry_t *mbentry __attribute__((unused)), void *rock) { uint32_t *attributes = (uint32_t *)rock; list_callback_calls++; *attributes |= MBOX_ATTRIBUTE_HASCHILDREN; return CYRUSDB_DONE; } Commit Message: imapd: check for isadmin BEFORE p...
0
95,261
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: processLog_trace(const boost::format& fmt) { std::cout << "TRACE: " << fmt.str() << std::endl; } Commit Message: CWE ID: CWE-264
0
13,225
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SoftMPEG2::~SoftMPEG2() { CHECK_EQ(deInitDecoder(), (status_t)OK); } Commit Message: codecs: check OMX buffer size before use in (avc|hevc|mpeg2)dec Bug: 27833616 Change-Id: Ic4045a3f56f53b08d0b1264b2a91b8f43e91b738 (cherry picked from commit 87fdee0bc9e3ac4d2a88ef0a8e150cfdf08c161d) CWE ID: CWE-20
0
163,914
Analyze the following 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 ext4_ext_convert_to_initialized(handle_t *handle, struct inode *inode, struct ext4_map_blocks *map, struct ext4_ext_path *path) { struct ext4_sb_info *sbi; struct ext4_extent_header *eh; struct ext4_map_blocks split_map; struct ext4_extent zero_ex; struct ext4_extent *ex; ...
0
18,549
Analyze the following 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 req_aprtable2luatable_cb(void *l, const char *key, const char *value) { int t; lua_State *L = (lua_State *) l; /* [table<s,t>, table<s,s>] */ /* rstack_dump(L, RRR, "start of cb"); */ /* L is [table<s,t>, table<s,s>] */ /* build complex */ ...
0
45,118
Analyze the following 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 trashacl(struct protstream *pin, struct protstream *pout, char *mailbox) { int i=0, j=0; char tagbuf[128]; int c; /* getword() returns an int */ struct buf cmd, tmp, user; int r = 0; memset(&cmd, 0, sizeof(struct buf)); memset(&tmp, 0, sizeo...
0
95,266
Analyze the following 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 SmushXGap(const Image *smush_image,const Image *images, const ssize_t offset,ExceptionInfo *exception) { CacheView *left_view, *right_view; const Image *left_image, *right_image; RectangleInfo left_geometry, right_geometry; register const PixelPacket *p; ...
0
64,540
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLES2DecoderImpl::HandleStencilThenCoverStrokePathInstancedCHROMIUM( uint32_t immediate_data_size, const volatile void* cmd_data) { static const char kFunctionName[] = "glStencilThenCoverStrokeInstancedCHROMIUM"; const volatile gles2::cmds::StencilThenCoverStrokePathInstancedCHROMIUM& c = ...
0
141,593
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset) const { int maxX = scrollWidth() - box().pixelSnappedClientWidth(); int maxY = scrollHeight() - box().pixelSnappedClientHeight(); int x = std::max(std::min(scrollOffset.width(), maxX), 0); int y = std::max(std::min(...
0
119,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 void ProxyLocaltimeCallToBrowser(time_t input, struct tm* output, char* timezone_out, size_t timezone_out_len) { base::Pickle request; request.WriteInt(LinuxSandbox::METHOD_LOCALTIME); request.WriteString( std::st...
1
172,926
Analyze the following 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 xenvif *poll_net_schedule_list(struct xen_netbk *netbk) { struct xenvif *vif = NULL; spin_lock_irq(&netbk->net_schedule_list_lock); if (list_empty(&netbk->net_schedule_list)) goto out; vif = list_first_entry(&netbk->net_schedule_list, struct xenvif, schedule_list); if (!vif) got...
0
33,993
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CCLayerTreeHostTestShortlived3() { } Commit Message: [chromium] Fix shutdown race when posting main thread task to CCThreadProxy and enable tests https://bugs.webkit.org/show_bug.cgi?id=70161 Reviewed by David Levin. Source/WebCore: Adds a weak pointer mechanism to cancel main thread tasks posted to CCThr...
0
97,867
Analyze the following 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::Rect BrowserView::GetToolbarBounds() const { gfx::Rect toolbar_bounds(toolbar_->bounds()); if (toolbar_bounds.IsEmpty()) return toolbar_bounds; toolbar_bounds.Inset(-views::NonClientFrameView::kClientEdgeThickness, 0); return toolbar_bounds; } Commit Message: Remove TabContents from TabStripMode...
0
118,372
Analyze the following 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 set_client_host(ExtensionDevToolsClientHost* client_host) { client_host_ = client_host; } Commit Message: Have the Debugger extension api check that it has access to the tab Check PermissionsData::CanAccessTab() prior to attaching the debugger. BUG=367567 Review URL: https://codereview.chromium.o...
0
120,629
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: unsigned RenderViewImpl::GetLocalSessionHistoryLengthForTesting() const { return history_list_length_; } Commit Message: Let the browser handle external navigations from DevTools. BUG=180555 Review URL: https://chromiumcodereview.appspot.com/12531004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1867...
0
115,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: int ext4_seq_options_show(struct seq_file *seq, void *offset) { struct super_block *sb = seq->private; int rc; seq_puts(seq, (sb->s_flags & MS_RDONLY) ? "ro" : "rw"); rc = _ext4_show_options(seq, sb, 1); seq_puts(seq, "\n"); return rc; } Commit Message: ext4: fix races between page faults and hole punchin...
0
56,694
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _warc_rdtyp(const char *buf, size_t bsz) { static const char _key[] = "\r\nWARC-Type:"; const char *val, *eol; if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) { /* no bother */ return WT_NONE; } val += sizeof(_key) - 1U; if ((eol = _warc_find_eol(val, buf + bsz - val)) == NULL) { /* n...
0
74,912
Analyze the following 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 free_fid(V9fsPDU *pdu, V9fsFidState *fidp) { int retval = 0; if (fidp->fid_type == P9_FID_FILE) { /* If we reclaimed the fd no need to close */ if (fidp->fs.fd != -1) { retval = v9fs_co_close(pdu, &fidp->fs); } } else if (fidp->fid_type == P9_FID_DIR) { ...
0
8,201
Analyze the following 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_qtdemux_get_type (void) { static GType qtdemux_type = 0; if (!qtdemux_type) { static const GTypeInfo qtdemux_info = { sizeof (GstQTDemuxClass), (GBaseInitFunc) gst_qtdemux_base_init, NULL, (GClassInitFunc) gst_qtdemux_class_init, NULL, NULL, sizeof (GstQTDemux), 0, (GIns...
0
4,943
Analyze the following 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::MapTransferCacheEntry(uint32_t serialized_size) { NOTREACHED(); return nullptr; } 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, 957001...
0
141,077
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void tg3_mem_rx_release(struct tg3 *tp) { int i; for (i = 0; i < tp->irq_max; i++) { struct tg3_napi *tnapi = &tp->napi[i]; tg3_rx_prodring_fini(tp, &tnapi->prodring); if (!tnapi->rx_rcb) continue; dma_free_coherent(&tp->pdev->dev, TG3_RX_RCB_RING_BYTES(tp), tnapi->rx_rcb, ...
0
32,620
Analyze the following 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 AppCacheGroup::QueueUpdate(AppCacheHost* host, const GURL& new_master_resource) { DCHECK(update_job_ && host && !new_master_resource.is_empty()); queued_updates_.insert(QueuedUpdates::value_type( host, std::make_pair(host, new_master_resource))); host->AddObserver...
0
145,412
Analyze the following 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::unique_ptr<WebUIImpl> WebContentsImpl::CreateWebUI( const GURL& url, const std::string& frame_name) { std::unique_ptr<WebUIImpl> web_ui = base::MakeUnique<WebUIImpl>(this, frame_name); WebUIController* controller = WebUIControllerFactoryRegistry::GetInstance() ->CreateWebUIC...
0
135,654
Analyze the following 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 sigalrm_handler() { rotate = (rotate + 1) % 4; } Commit Message: unsquashfs-4: Add more sanity checks + fix CVE-2015-4645/6 Add more filesystem table sanity checks to Unsquashfs-4 and also properly fix CVE-2015-4645 and CVE-2015-4646. The CVEs were raised due to Unsquashfs having variable oveflow and sta...
0
74,304
Analyze the following 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 vmxnet3_qdev_reset(DeviceState *dev) { PCIDevice *d = PCI_DEVICE(dev); VMXNET3State *s = VMXNET3(d); VMW_CBPRN("Starting QDEV reset..."); vmxnet3_reset(s); } Commit Message: CWE ID: CWE-200
0
9,040
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GURL DevToolsUI::SanitizeFrontendURL(const GURL& url) { return ::SanitizeFrontendURL(url, content::kChromeDevToolsScheme, chrome::kChromeUIDevToolsHost, SanitizeFrontendPath(url.path()), true); } Commit Message: DevTools: move front-end URL handling to DevToolsUIBindingds BUG=662859 Review-Url: https:/...
1
172,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: GF_Err moof_Read(GF_Box *s, GF_BitStream *bs) { return gf_isom_box_array_read(s, bs, moof_AddBox); } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
80,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 ssize_t tun_do_read(struct tun_struct *tun, struct kiocb *iocb, const struct iovec *iv, ssize_t len, int noblock) { DECLARE_WAITQUEUE(wait, current); struct sk_buff *skb; ssize_t ret = 0; tun_debug(KERN_INFO, tun, "tun_chr_read\n"); if (unlikely(!noblock)) add_wait_queue(&tun->wq.wait,...
0
23,853
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int test_ifmod_section(cmd_parms *cmd, const char *arg) { return find_module(cmd->server, arg) != NULL; } Commit Message: core: Disallow Methods' registration at run time (.htaccess), they may be used only if registered at init time (httpd.conf). Calling ap_method_register() in children processes is ...
0
64,326
Analyze the following 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 immediate_data_size, const gles2::GetShaderSource& c) { GLuint shader = c.shader; uint32 bucket_id = static_cast<uint32>(c.bucket_id); Bucket* bucket = CreateBucket(bucket_id); ShaderManager::ShaderInfo* info = GetShaderInfoNotProgram( ...
0
99,262
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr, unsigned long sz) { pgd_t *pgd; p4d_t *p4d; pud_t *pud; pmd_t *pmd; pgd = pgd_offset(mm, addr); if (!pgd_present(*pgd)) return NULL; p4d = p4d_offset(pgd, addr); if (!p4d_present(*p4d)) return NULL; pud = pud_offset(p4d, addr)...
0
86,450
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: u32 h264bsdMatrixCoefficients(storage_t *pStorage) { /* Variables */ /* Code */ ASSERT(pStorage); if (pStorage->activeSps && pStorage->activeSps->vuiParametersPresentFlag && pStorage->activeSps->vuiParameters && pStorage->activeSps->vuiParameters->videoSignalTypePresentFlag && pSt...
0
160,894
Analyze the following 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 const uint8_t *get_signature(const uint8_t *asn1_sig, int *len) { int offset = 0; const uint8_t *ptr = NULL; if (asn1_next_obj(asn1_sig, &offset, ASN1_SEQUENCE) < 0 || asn1_skip_obj(asn1_sig, &offset, ASN1_SEQUENCE)) goto end_get_sig; if (asn1_sig[offset++] != ASN1_OCTE...
1
169,085
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int ndp_sock_open(struct ndp *ndp) { int sock; int ret; int err; int val; sock = socket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6); if (sock == -1) { err(ndp, "Failed to create ICMP6 socket."); return -errno; } val = 1; ret = setsockopt(sock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &val, sizeof(val)); ...
1
167,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: void Performance::RegisterPerformanceObserver(PerformanceObserver& observer) { observer_filter_options_ |= observer.FilterOptions(); observers_.insert(&observer); UpdateLongTaskInstrumentation(); } Commit Message: Fix timing allow check algorithm for service workers This CL uses the OriginalURLViaServiceW...
0
153,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: static int lxcfs_releasedir(const char *path, struct fuse_file_info *fi) { if (strcmp(path, "/") == 0) return 0; if (strncmp(path, "/cgroup", 7) == 0) { return cg_releasedir(path, fi); } if (strcmp(path, "/proc") == 0) return 0; return -EINVAL; } Commit Message: Implement privilege check when moving t...
0
44,418
Analyze the following 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 normalizeSpacesAndMirrorChars(const UChar* source, UChar* destination, int length, HarfBuzzShaperBase::NormalizeMode normalizeMode) { int position = 0; bool error = false; while (position < length) { UChar32 character; int nextPosition = position; U16_NEXT(source, n...
0
107,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: bt_status_t btif_dm_cancel_bond(const bt_bdaddr_t *bd_addr) { bdstr_t bdstr; BTIF_TRACE_EVENT("%s: bd_addr=%s", __FUNCTION__, bdaddr_to_string(bd_addr, bdstr, sizeof(bdstr))); /* TODO: ** 1. Restore scan modes ** 2. special handling for HID devices */ if (pairing_cb.state == BT_BOND_STATE_B...
0
158,579
Analyze the following 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 OverloadedPerWorldBindingsMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::ToImpl(info.Holder()); impl->overloadedPerWorldBindingsMethod(); } Commit Message: bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a...
0
134,985
Analyze the following 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 LayoutSVGContainer::addOutlineRects(Vector<LayoutRect>& rects, const LayoutPoint&, IncludeBlockVisualOverflowOrNot) const { rects.append(LayoutRect(paintInvalidationRectInLocalSVGCoordinates())); } Commit Message: Avoid using forced layout to trigger paint invalidation for SVG containers Currently, SVG...
0
121,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: const std::vector<GURL>& DownloadItemImpl::GetUrlChain() const { return request_info_.url_chain; } Commit Message: Downloads : Fixed an issue of opening incorrect download file When one download overwrites another completed download, calling download.open in the old download causes the new download to open, w...
0
146,338
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: scoped_refptr<FakeSafeBrowsingService> fake_safe_browsing_service() { return fake_safe_browsing_service_; } 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: I098599394e6ebe7d2fce5af838014297a33...
0
151,954
Analyze the following 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 ParseQualifiedNameResult ParseQualifiedNameInternal( const AtomicString& qualified_name, const CharType* characters, unsigned length, AtomicString& prefix, AtomicString& local_name) { bool name_start = true; bool saw_colon = false; int colon_pos = 0; for (unsigned i = 0; i < le...
0
134,128
Analyze the following 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_vs_use_count_dec(void) { module_put(THIS_MODULE); } Commit Message: ipvs: Add boundary check on ioctl arguments The ipvs code has a nifty system for doing the size of ioctl command copies; it defines an array with values into which it indexes the cmd to find the right length. Unfortunately, the ipvs code f...
0
29,293
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: asmlinkage long sys_unshare(unsigned long unshare_flags) { int err = 0; struct fs_struct *fs, *new_fs = NULL; struct sighand_struct *new_sigh = NULL; struct mm_struct *mm, *new_mm = NULL, *active_mm = NULL; struct files_struct *fd, *new_fd = NULL; struct nsproxy *new_nsproxy = NULL; int do_sysvsem = 0; c...
0
22,182
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderFrameImpl* RenderFrameImpl::FromWebFrame(blink::WebFrame* web_frame) { auto iter = g_frame_map.Get().find(web_frame); if (iter != g_frame_map.Get().end()) return iter->second; return nullptr; } Commit Message: Fix crashes in RenderFrameImpl::OnSelectPopupMenuItem(s) ExternalPopupMenu::DidSelectI...
0
152,875
Analyze the following 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 skb_vlan_pop(struct sk_buff *skb) { u16 vlan_tci; __be16 vlan_proto; int err; if (likely(skb_vlan_tag_present(skb))) { skb->vlan_tci = 0; } else { if (unlikely(!eth_type_vlan(skb->protocol))) return 0; err = __skb_vlan_pop(skb, &vlan_tci); if (err) return err; } /* move next vlan tag to...
0
67,716
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void FrameLoader::load(const FrameLoadRequest& passedRequest, FrameLoadType frameLoadType, HistoryItem* historyItem, HistoryLoadType historyLoadType) { ASSERT(m_frame->document()); if (!m_frame->isNavigationAllowed()) return; if (m_inStopAllLoaders) return; if (m_frame->page...
0
132,679
Analyze the following 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 EC_GROUP_get_trinomial_basis(const EC_GROUP *group, unsigned int *k) { if (group == NULL) return 0; if (EC_GROUP_method_of(group)->group_set_curve != ec_GF2m_simple_group_set_curve || !((group->poly[0] != 0) && (group->poly[1] != 0) ...
0
6,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: ssize_t utf8_to_utf16_length(const uint8_t* u8str, size_t u8len) { const uint8_t* const u8end = u8str + u8len; const uint8_t* u8cur = u8str; /* Validate that the UTF-8 is the correct len */ size_t u16measuredLen = 0; while (u8cur < u8end) { u16measuredLen++; int u8charLen = utf8_codepoint_len(*u8cu...
0
158,443
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: on_name_acquired(__attribute__((unused)) GDBusConnection *connection, const gchar *name, __attribute__((unused)) gpointer user_data) { log_message(LOG_INFO, "Acquired the name %s on the session bus", name); } Commit Message: When opening files for write, ensure they aren't symbolic links Issue #1048 ...
0
75,963
Analyze the following 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 cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info) { int rc = 0; struct sk_buff *rep_skb; struct cgroupstats *stats; struct nlattr *na; size_t size; u32 fd; struct file *file; int fput_needed; na = info->attrs[CGROUPSTATS_CMD_ATTR_FD]; if (!na) return -EINVAL; fd = nla_get...
0
26,913
Analyze the following 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 capture_pattern(vorb *f) { if (0x4f != get8(f)) return FALSE; if (0x67 != get8(f)) return FALSE; if (0x67 != get8(f)) return FALSE; if (0x53 != get8(f)) return FALSE; return TRUE; } Commit Message: fix unchecked length in stb_vorbis that could crash on corrupt/invalid files CWE ID: CWE-...
0
75,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: void ChromePluginServiceFilter::UnregisterResourceContext( const void* context) { base::AutoLock lock(lock_); resource_context_map_.erase(context); } Commit Message: Follow-on fixes and naming changes for https://codereview.chromium.org/12086077/ BUG=172573 Review URL: https://codereview.chromium.org/12...
0
116,749
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int release_wake_lock_callout(const char *lock_name) { JNIEnv *env; JavaVM *vm = AndroidRuntime::getJavaVM(); jint status = vm->GetEnv((void **)&env, JNI_VERSION_1_6); if (status != JNI_OK && status != JNI_EDETACHED) { ALOGE("%s unable to get environment for JNI call", __func__); return BT...
0
163,697
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn) { enum direction dir = decode_direction(insn); int size = decode_access_size(regs, insn); int orig_asi, asi; current_thread_info()->kern_una_regs = regs; current_thread_info()->kern_una_insn = insn; orig_asi = asi = decode_asi(...
1
165,812
Analyze the following 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 OfflinePageModelImpl::DeleteTemporaryPagesInAbandonedCacheDir() { std::vector<int64_t> offline_page_ids; for (const auto& id_page_pair : offline_pages_) { const OfflinePageItem& page = id_page_pair.second; if (policy_controller_->IsRemovedOnCacheReset(page.client_id.name_space) && !archiv...
0
155,873
Analyze the following 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 tty_ldisc_begin(void) { /* Setup the default TTY line discipline. */ (void) tty_register_ldisc(N_TTY, &tty_ldisc_N_TTY); } Commit Message: tty: Prevent ldisc drivers from re-using stale tty fields Line discipline drivers may mistakenly misuse ldisc-related fields when initializing. For example, a failure...
0
55,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: init_time (void) { gettime (&initial_time); } Commit Message: CWE ID: CWE-22
0
5,651