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: void trace_printk_init_buffers(void) { if (buffers_allocated) return; if (alloc_percpu_trace_buffer()) return; /* trace_printk() is for debug use only. Don't use it in production. */ pr_warn("\n"); pr_warn("**********************************************************\n"); pr_warn("** NOTICE NOTICE NO...
0
81,432
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: enum act_return http_action_res_capture_by_id(struct act_rule *rule, struct proxy *px, struct session *sess, struct stream *s, int flags) { struct sample *key; struct cap_hdr *h; char **cap = s->res_cap; struct proxy *fe = strm_fe(s); int len; int i; /* Look f...
0
6,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: void GLES2DecoderImpl::DoVertexAttrib4fv(GLuint index, const GLfloat* v) { VertexAttribManager::VertexAttribInfo* info = vertex_attrib_manager_.GetVertexAttribInfo(index); if (!info) { SetGLError(GL_INVALID_VALUE, "glVertexAttrib4fv: index out of range"); return; } VertexAttribManager::Verte...
0
99,197
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gfx::Point ClientControlledShellSurface::GetSurfaceOrigin() const { return gfx::Point(); } Commit Message: Ignore updatePipBounds before initial bounds is set When PIP enter/exit transition happens, window state change and initial bounds change are committed in the same commit. However, as state change is app...
0
137,688
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FileReaderLoader::~FileReaderLoader() { Cleanup(); UnadjustReportedMemoryUsageToV8(); } Commit Message: FileReader: Make a copy of the ArrayBuffer when returning partial results. This is to avoid accidentally ending up with multiple references to the same underlying ArrayBuffer. The extra performance overhe...
0
152,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: static MagickBooleanType GetOneAuthenticPixelFromCache(Image *image, const ssize_t x,const ssize_t y,Quantum *pixel,ExceptionInfo *exception) { CacheInfo *magick_restrict cache_info; const int id = GetOpenMPThreadId(); register Quantum *magick_restrict q; assert(image != (const Image *) N...
0
94,784
Analyze the following 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 Extension::GetResourceURL(const GURL& extension_url, const std::string& relative_path) { DCHECK(extension_url.SchemeIs(extensions::kExtensionScheme)); DCHECK_EQ("/", extension_url.path()); std::string path = relative_path; if (relative_path.size() > 0 && relative_path...
0
114,305
Analyze the following 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 BlobURLRequestJob::AdvanceItem() { DeleteCurrentFileReader(); current_item_index_++; current_item_offset_ = 0; } Commit Message: Avoid integer overflows in BlobURLRequestJob. BUG=169685 Review URL: https://chromiumcodereview.appspot.com/12047012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src...
0
115,156
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ImportArrayTIFF_SShort ( const TIFF_Manager::TagInfo & tagInfo, const bool nativeEndian, SXMPMeta * xmp, const char * xmpNS, const char * xmpProp ) { try { // Don't let errors with one stop the others. XMP_Int16 * binPtr = (XMP_Int16*)tagInfo.dataPtr; xmp->DeleteProperty ( xmpNS, xmpProp ); // ! D...
0
15,966
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */ { const char *hostname; /* Hostname of client */ char name[256]; /* Hostname of client */ int count; /* Count of connections on a host */ cupsd_client_t *con, /* New client pointer */ *tempcon; /* Temporary client pointer */ soc...
0
86,097
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void show_stacktrace(struct task_struct *task, const struct pt_regs *regs) { const int field = 2 * sizeof(unsigned long); long stackdata; int i; unsigned long __user *sp = (unsigned long __user *)regs->regs[29]; printk("Stack :"); i = 0; while ((unsigned long) sp & (PAGE_SIZE - 1)) { if (i && ((...
0
25,430
Analyze the following 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 SkipDXTMipmaps(Image *image, DDSInfo *dds_info, int texel_size) { register ssize_t i; MagickOffsetType offset; size_t h, w; /* Only skip mipmaps for textures and cube maps */ if (dds_info->ddscaps1 & DDSCAPS_MIPMAP && (dds_info->ddscaps1 & DDSCAPS_TEXTURE ...
1
168,904
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int get_scl(void) { return kw_gpio_get_value(KM_KIRKWOOD_SCL_PIN) ? 1 : 0; } Commit Message: Merge branch '2020-01-22-master-imports' - Re-add U8500 platform support - Add bcm968360bg support - Assorted Keymile fixes - Other assorted bugfixes CWE ID: CWE-787
0
89,303
Analyze the following 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 ResourceFetcher::InitializeRevalidation( ResourceRequest& revalidating_request, Resource* resource) { DCHECK(resource); DCHECK(GetMemoryCache()->Contains(resource)); DCHECK(resource->IsLoaded()); DCHECK(resource->CanUseCacheValidator()); DCHECK(!resource->IsCacheValidator()); DCHECK(!Cont...
0
138,885
Analyze the following 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 RenderWidgetHostImpl::ViewDestroyed() { CancelKeyboardLock(); RejectMouseLockOrUnlockIfNecessary(); SetView(nullptr); } Commit Message: Start rendering timer after first navigation Currently the new content rendering timer in the browser process, which clears an old page's contents 4 seconds after a...
0
145,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: MagickExport MagickBooleanType BlobToFile(char *filename,const void *blob, const size_t length,ExceptionInfo *exception) { int file; register size_t i; ssize_t count; assert(filename != (const char *) NULL); (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename); assert(blo...
0
88,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 void fdctrl_handle_perpendicular_mode(FDCtrl *fdctrl, int direction) { FDrive *cur_drv = get_cur_drv(fdctrl); if (fdctrl->fifo[1] & 0x80) cur_drv->perpendicular = fdctrl->fifo[1] & 0x7; /* No result back */ fdctrl_reset_fifo(fdctrl); } Commit Message: CWE ID: CWE-119
0
3,313
Analyze the following 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_read_data_skip(struct archive *_a) { struct archive_read *a = (struct archive_read *)_a; int r; const void *buff; size_t size; int64_t offset; archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA, "archive_read_data_skip"); if (a->format->read_data_skip != NULL) r = (a->format->r...
0
50,015
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XML_SetNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start, XML_EndNamespaceDeclHandler end) { if (parser == NULL) return; parser->m_startNamespaceDeclHandler = start; parser->m_endNamespaceDeclHandler = end; } Commit Messa...
0
92,283
Analyze the following 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::MarkContextChanged( ContentChangeType change_type) { if (isContextLost()) return; if (framebuffer_binding_) { framebuffer_binding_->SetContentsChanged(true); return; } must_paint_to_canvas_ = true; if (!GetDrawingBuffer()->MarkContentsChanged() && marke...
0
142,273
Analyze the following 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 parse_fpe(struct pt_regs *regs) { int code = 0; unsigned long fpscr; flush_fp_to_thread(current); fpscr = current->thread.fpscr.val; /* Invalid operation */ if ((fpscr & FPSCR_VE) && (fpscr & FPSCR_VX)) code = FPE_FLTINV; /* Overflow */ else if ((fpscr & FPSCR_OE) && (fpscr & FPSCR_OX)) ...
0
74,738
Analyze the following 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 isValidCachedResult(const Font* font, hb_direction_t dir, const String& localeString, const CachedShapingResults* cachedResults) { ASSERT(cachedResults); return cachedResults->dir == dir && cachedResults->font == *font && !cachedResults->font.loadingCustomFonts() ...
0
128,415
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PromptBrowserLoginFunction::~PromptBrowserLoginFunction() { } Commit Message: Adding tests for new webstore beginInstallWithManifest method. BUG=75821 TEST=none Review URL: http://codereview.chromium.org/6900059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83080 0039d316-1c4b-4281-b951-d872f2087c98 CWE ...
0
99,862
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void cstm(JF, js_Ast *stm) { js_Ast *target; int loop, cont, then, end; emitline(J, F, stm); switch (stm->type) { case AST_FUNDEC: break; case STM_BLOCK: cstmlist(J, F, stm->a); break; case STM_EMPTY: if (F->script) { emitline(J, F, stm); emit(J, F, OP_POP); emit(J, F, OP_UNDEF)...
0
90,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: UINT CSoundFile::GetSaveFormats() const { UINT n = 0; if ((!m_nSamples) || (!m_nChannels) || (m_nType == MOD_TYPE_NONE)) return 0; switch(m_nType) { case MOD_TYPE_MOD: n = MOD_TYPE_MOD; case MOD_TYPE_S3M: n = MOD_TYPE_S3M; } n |= MOD_TYPE_XM | MOD_TYPE_IT; if (!m_nInstruments) { if (m_nSamples < 32) n...
0
8,486
Analyze the following 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_native_overlayfs(const char *path) { struct statfs sb; if (statfs(path, &sb) < 0) return false; if (sb.f_type == OVERLAYFS_SUPER_MAGIC || sb.f_type == OVERLAY_SUPER_MAGIC) return true; return false; } Commit Message: CVE-2015-1335: Protect container mounts against symlinks When a cont...
0
44,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: struct sctp_chunk *sctp_make_abort_violation( const struct sctp_association *asoc, const struct sctp_chunk *chunk, const __u8 *payload, const size_t paylen) { struct sctp_chunk *retval; struct sctp_paramhdr phdr; retval = sctp_make_abort(asoc, chunk, sizeof(sctp_errhdr_t) + paylen + sizeof(sctp_pa...
0
35,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 void lxc_clear_saved_nics(struct lxc_conf *conf) { int i; if (!conf->saved_nics) return; for (i=0; i < conf->num_savednics; i++) free(conf->saved_nics[i].orig_name); free(conf->saved_nics); } Commit Message: CVE-2015-1335: Protect container mounts against symlinks When a container starts up, lxc...
0
44,592
Analyze the following 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 URLPatternSet& PermissionsData::default_policy_allowed_hosts() { return default_runtime_policy.Get().allowed_hosts; } Commit Message: [Extensions] Restrict tabs.captureVisibleTab() Modify the permissions for tabs.captureVisibleTab(). Instead of just checking for <all_urls> and assuming its safe, do the ...
0
155,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: error::Error GLES2DecoderImpl::HandleSwapBuffers( uint32 immediate_data_size, const gles2::SwapBuffers& c) { bool is_offscreen = !!offscreen_target_frame_buffer_.get(); int this_frame_number = frame_number_++; TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", "offscreen", is_offs...
0
99,279
Analyze the following 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::DoGetIntegerv(GLenum pname, GLint* params, GLsizei params_size) { DCHECK(params); GLsizei num_written = 0; if (state_.GetStateAsGLint(pname, params, &num_written) || GetHelper(pname, params, &num_written))...
0
141,321
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){ tsize_t written=0; char buffer[16]; int buflen=0; buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ", t2p->pdf_majorversion&0xff, t2p->pdf_minorversion&0xff); check_snprintf_ret(t2p, buflen, buffer); written += t2pWriteFile(output, (td...
0
48,371
Analyze the following 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 CCLayerTreeHost::setViewport(const IntSize& viewportSize) { m_viewportSize = viewportSize; setNeedsCommitThenRedraw(); } 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...
0
97,815
Analyze the following 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 opl3_alloc_voice(int dev, int chn, int note, struct voice_alloc_info *alloc) { int i, p, best, first, avail, best_time = 0x7fffffff; struct sbi_instrument *instr; int is4op; int instr_no; if (chn < 0 || chn > 15) instr_no = 0; else instr_no = devc->chn_info[chn].pgm_num; instr = &devc->i_m...
0
27,559
Analyze the following 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 OnSuggestionModelRemoved(UiScene* scene, SuggestionBinding* binding) { scene->RemoveUiElement(binding->view()->id()); } Commit Message: Fix wrapping behavior of description text in omnibox suggestion This regression is introduced by https://chromium-review.googlesource.com/c/chromium/src/+/827033 The de...
0
155,525
Analyze the following 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 should_include(struct commit *commit, void *_data) { struct include_data *data = _data; int bitmap_pos; bitmap_pos = bitmap_position(commit->object.oid.hash); if (bitmap_pos < 0) bitmap_pos = ext_index_add_object((struct object *)commit, NULL); if (!add_to_include_set(data, commit->object.oid....
0
54,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 VarianceTest<VarianceFunctionType>::ZeroTest() { for (int i = 0; i <= 255; ++i) { memset(src_, i, block_size_); for (int j = 0; j <= 255; ++j) { memset(ref_, j, block_size_); unsigned int sse; unsigned int var; REGISTER_STATE_CHECK(var = variance_(src_, width_, ref_, wi...
1
174,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: void WebGLRenderingContextBase::RemoveBoundBuffer(WebGLBuffer* buffer) { if (bound_array_buffer_ == buffer) bound_array_buffer_ = nullptr; bound_vertex_array_object_->UnbindBuffer(buffer); } Commit Message: Reset ES3 pixel pack parameters and PIXEL_PACK_BUFFER binding in DrawingBuffer before ReadPixels(...
0
133,672
Analyze the following 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 php_zip_ops_close(php_stream *stream, int close_handle TSRMLS_DC) { STREAM_DATA_FROM_STREAM(); if (close_handle) { if (self->zf) { zip_fclose(self->zf); self->zf = NULL; } if (self->za) { zip_close(self->za); self->za = NULL; } } efree(self); stream->abstract = NULL; return E...
0
9,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: void CWebServer::DisplaySwitchTypesCombo(std::string & content_part) { char szTmp[200]; std::map<std::string, int> _switchtypes; for (int ii = 0; ii < STYPE_END; ii++) { _switchtypes[Switch_Type_Desc((_eSwitchType)ii)] = ii; } for (const auto & itt : _switchtypes) { sprintf(szTm...
0
91,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: static char *format_duration(u64 dur, u32 timescale, char *szDur) { u32 h, m, s, ms; dur = (u32) (( ((Double) (s64) dur)/timescale)*1000); h = (u32) (dur / 3600000); dur -= h*3600000; m = (u32) (dur / 60000); dur -= m*60000; s = (u32) (dur/1000); dur -= s*1000; ms = (u32) (dur); sprintf(szDur, "%02d:%02...
0
80,731
Analyze the following 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_hostname_list () { if (hostname_list_initialized == 0) initialize_hostname_list (); return (hostname_list); } Commit Message: CWE ID: CWE-20
0
9,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: blink::WebPushPermissionStatus PushMessagingServiceImpl::GetPermissionStatus( const GURL& origin, bool user_visible) { if (!user_visible) return blink::kWebPushPermissionStatusDenied; return ToPushPermission( PermissionManager::Get(profile_) ->GetPermissionStatus(CONTENT_SETTINGS_...
0
150,689
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS_DC) { int cnt = 0; MYSQLND **p = conn_array, **p_p; MYSQLND **ret = NULL; while (*p) { if (CONN_GET_STATE((*p)->data) <= CONN_READY || CONN_GET_STATE((*p)->data) == CONN_QUIT_SENT) { cnt++; } p++; } if (cnt) { MYSQL...
0
14,285
Analyze the following 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 OneClickSigninHelper::RedirectToSignin() { VLOG(1) << "OneClickSigninHelper::RedirectToSignin"; signin::Source source = signin::GetSourceForPromoURL(continue_url_); if (source == signin::SOURCE_UNKNOWN) source = signin::SOURCE_MENU; GURL page = signin::GetPromoURL(source, false); content::Web...
0
109,839
Analyze the following 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 snd_hrtimer_start(struct snd_timer *t) { struct snd_hrtimer *stime = t->private_data; atomic_set(&stime->running, 0); hrtimer_cancel(&stime->hrt); hrtimer_start(&stime->hrt, ns_to_ktime(t->sticks * resolution), HRTIMER_MODE_REL); atomic_set(&stime->running, 1); return 0; } Commit ...
1
167,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: rad_put_vendor_addr(struct rad_handle *h, int vendor, int type, struct in_addr addr) { return (rad_put_vendor_attr(h, vendor, type, &addr.s_addr, sizeof addr.s_addr)); } Commit Message: Fix a security issue in radius_get_vendor_attr(). The underlying rad_get_vendor_attr() function assumed that it woul...
0
31,545
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: print_nsp(netdissect_options *ndo, const u_char *nspp, u_int nsplen) { const struct nsphdr *nsphp = (const struct nsphdr *)nspp; int dst, src, flags; if (nsplen < sizeof(struct nsphdr)) goto trunc; ND_TCHECK(*nsphp); flags = EXTRACT_LE_8BITS(nsphp->nh_flags); dst = EXTRACT_LE_16BITS(nsphp->nh_d...
0
95,106
Analyze the following 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 vmx_hwapic_irr_update(struct kvm_vcpu *vcpu, int max_irr) { if (max_irr == -1) return; vmx_set_rvi(max_irr); } Commit Message: nEPT: Nested INVEPT If we let L1 use EPT, we should probably also support the INVEPT instruction. In our current nested EPT implementation, when L1 changes its EPT tab...
0
37,672
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SWFShape_getOutput(SWFShape shape) { return shape->out; } Commit Message: SWFShape_setLeftFillStyle: prevent fill overflow CWE ID: CWE-119
0
89,514
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Document::MediaQueryAffectingValueChanged() { GetStyleEngine().MediaQueryAffectingValueChanged(); if (NeedsLayoutTreeUpdate()) evaluate_media_queries_on_style_recalc_ = true; else EvaluateMediaQueryList(); probe::MediaQueryResultChanged(this); } Commit Message: Cleanup and remove dead code i...
0
129,793
Analyze the following 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_get_client_hello(SSL *s) { int i,j,ok,al,ret= -1; unsigned int cookie_len; long n; unsigned long id; unsigned char *p,*d,*q; SSL_CIPHER *c; #ifndef OPENSSL_NO_COMP SSL_COMP *comp=NULL; #endif STACK_OF(SSL_CIPHER) *ciphers=NULL; /* We do this so that we will respond with our native type. * If...
0
14,343
Analyze the following 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 OnPaint(gfx::Canvas* canvas) { views::Widget* widget = GetWidget(); if (!widget || (widget->IsMaximized() || widget->IsFullscreen())) return; gfx::ImageSkia* image = ui::ResourceBundle::GetSharedInstance(). GetImageSkiaNamed(IDR_TEXTAREA_RESIZER); canvas->DrawImageInt...
0
118,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: IPV6DefragInOrderSimpleTest(void) { Packet *p1 = NULL, *p2 = NULL, *p3 = NULL; Packet *reassembled = NULL; int id = 12; int i; int ret = 0; DefragInit(); p1 = IPV6BuildTestPacket(id, 0, 1, 'A', 8); if (p1 == NULL) goto end; p2 = IPV6BuildTestPacket(id, 1, 1, 'B',...
1
168,309
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ar6000_pmkid_list_event(void *devt, u8 numPMKID, WMI_PMKID *pmkidList, u8 *bssidList) { u8 i, j; A_PRINTF("Number of Cached PMKIDs is %d\n", numPMKID); for (i = 0; i < numPMKID; i++) { A_PRINTF("\nBSSID %d ", i); for (j = 0; j < ATH_MAC_LEN; j++) { ...
0
24,203
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DWORD WtsSessionProcessDelegate::GetExitCode() { if (!core_) return CONTROL_C_EXIT; return core_->GetExitCode(); } 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:...
1
171,557
Analyze the following 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 setcos_generate_store_key(sc_card_t *card, struct sc_cardctl_setcos_gen_store_key_info *data) { struct sc_apdu apdu; u8 sbuf[SC_MAX_APDU_BUFFER_SIZE]; int r, len; SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE); /* Setup key-generation parameters */ len = 0; if (data->op_type == OP_TYPE_GENER...
0
78,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: gfx::Size BrowserView::GetContentsSize() const { DCHECK(initialized_); return contents_web_view_->size(); } Commit Message: Mac: turn popups into new tabs while in fullscreen. It's platform convention to show popups as new tabs while in non-HTML5 fullscreen. (Popups cause tabs to lose HTML5 fullscreen.) Th...
0
155,180
Analyze the following 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 FrameFetchContext::DidLoadResource(Resource* resource) { if (!document_) return; if (LocalFrame* local_frame = document_->GetFrame()) { if (IdlenessDetector* idleness_detector = local_frame->GetIdlenessDetector()) { idleness_detector->OnDidLoadResource(); } } if (resour...
0
145,795
Analyze the following 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_apr_touch(lua_State *L) { request_rec *r; const char *path; apr_status_t status; apr_time_t mtime; r = ap_lua_check_request_rec(L, 1); luaL_checktype(L, 2, LUA_TSTRING); path = lua_tostring(L, 2); mtime = (apr_time_t)luaL_optnumber(L, 3, (lua_Number...
0
45,099
Analyze the following 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 unsigned countGraphemesInCluster(const UChar* normalizedBuffer, unsigned normalizedBufferLength, uint16_t startIndex, uint16_t endIndex) { if (startIndex > endIndex) { uint16_t tempIndex = startIndex; startIndex = endIndex; endIndex = tempIndex; } uint16_t length ...
0
128,404
Analyze the following 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 AXObject::isPresentationalChild() const { updateCachedAttributeValuesIfNeeded(); return m_cachedIsPresentationalChild; } Commit Message: Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Review-Url: https://codereview.chromium.org/2793913007 Cr-Commit-Position: refs/heads/ma...
0
127,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: bool HTMLInputElement::ShouldSaveAndRestoreFormControlState() const { if (!input_type_->ShouldSaveAndRestoreFormControlState()) return false; return TextControlElement::ShouldSaveAndRestoreFormControlState(); } Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTe...
0
126,110
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void remove_port(struct kref *kref) { struct port *port; port = container_of(kref, struct port, kref); kfree(port); } Commit Message: virtio-console: avoid DMA from stack put_chars() stuffs the buffer it gets into an sg, but that buffer may be on the stack. This breaks with CONFIG_VMAP_STACK=y (for ...
0
66,614
Analyze the following 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 Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { TabContentsWrapper* tab_to_delete = tab_to_delete_; tab_to_delete_ = NULL; delete tab_to_delete; } Commit Message: chromeos: fix bug wh...
0
98,168
Analyze the following 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 brcmf_init_conf(struct brcmf_cfg80211_conf *conf) { conf->frag_threshold = (u32)-1; conf->rts_threshold = (u32)-1; conf->retry_short = (u32)-1; conf->retry_long = (u32)-1; } Commit Message: brcmfmac: avoid potential stack overflow in brcmf_cfg80211_start_ap() User-space can choose to omit NL8021...
0
49,083
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: blink::WebPlugin* RenderFrameImpl::CreatePlugin( const blink::WebPluginParams& params) { blink::WebPlugin* plugin = nullptr; if (GetContentClient()->renderer()->OverrideCreatePlugin(this, params, &plugin)) { return plugin; } if (params.mi...
0
147,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: xsltParseStylesheetImport(xsltStylesheetPtr style, xmlNodePtr cur) { int ret = -1; xmlDocPtr import = NULL; xmlChar *base = NULL; xmlChar *uriRef = NULL; xmlChar *URI = NULL; xsltStylesheetPtr res; xsltSecurityPrefsPtr sec; if ((cur == NULL) || (style == NULL)) return (ret); ...
0
156,732
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool ExtensionRegistry::RemoveEnabled(const std::string& id) { return enabled_extensions_.Remove(id); } Commit Message: [Extensions] Add GetInstalledExtension() method to ExtensionRegistry This CL adds GetInstalledExtension() method to ExtensionRegistry and uses it instead of deprecated ExtensionService::GetI...
0
124,000
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void vmx_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) { struct vcpu_vmx *vmx = to_vmx(vcpu); unsigned long hw_cr0; hw_cr0 = (cr0 & ~KVM_GUEST_CR0_MASK); if (enable_unrestricted_guest) hw_cr0 |= KVM_VM_CR0_ALWAYS_ON_UNRESTRICTED_GUEST; else { hw_cr0 |= KVM_VM_CR0_ALWAYS_ON; if (vmx->rmode....
0
37,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: ProcRenderFreeGlyphs (ClientPtr client) { REQUEST(xRenderFreeGlyphsReq); GlyphSetPtr glyphSet; int rc, nglyph; CARD32 *gids; CARD32 glyph; REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); rc = dixLookupResourceByType((pointer *)&glyphSet, stuff->glyphset, GlyphSetType, ...
0
14,070
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool CaptureOnly(const Extension* extension, const GURL& url, int tab_id) { return !extension->permissions_data()->CanAccessPage( extension, url, url, tab_id, -1, NULL) && extension->permissions_data()->CanCaptureVisiblePage(tab_id, NULL); } Commit Message: Have the Debugger ext...
0
120,672
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MessageService* ExtensionSystemImpl::Shared::message_service() { return message_service_.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://svn...
0
115,947
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int kvm_handle_hva_range(struct kvm *kvm, unsigned long start, unsigned long end, unsigned long data, int (*handler)(struct kvm *kvm, unsigned long *rmapp, struct kvm_memory_slot *slot, unsigned long data)) { int j; int ret = 0; struct kvm_memslots *sl...
0
37,455
Analyze the following 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 inet_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { struct sock *sk = sock->sk; int err = -ENOIOCTLCMD; if (sk->sk_prot->compat_ioctl) err = sk->sk_prot->compat_ioctl(sk, cmd, arg); return err; } Commit Message: inet: add RCU protection to inet->opt We lack proper synchroni...
0
18,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 int load_state_from_tss32(struct x86_emulate_ctxt *ctxt, struct tss_segment_32 *tss) { int ret; u8 cpl; if (ctxt->ops->set_cr(ctxt, 3, tss->cr3)) return emulate_gp(ctxt, 0); ctxt->_eip = tss->eip; ctxt->eflags = tss->eflags | 2; /* General purpose registers */ *reg_write(ctxt, VCPU_REGS_RAX...
0
47,966
Analyze the following 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 leave_lazy(enum paravirt_lazy_mode mode) { BUG_ON(this_cpu_read(paravirt_lazy_mode) != mode); this_cpu_write(paravirt_lazy_mode, PARAVIRT_LAZY_NONE); } Commit Message: x86/paravirt: Fix spectre-v2 mitigations for paravirt guests Nadav reported that on guests we're failing to rewrite the indirect ...
0
79,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: void Document::setAlinkColor(const AtomicString& value) { SetBodyAttribute(alinkAttr, value); } Commit Message: Fixed bug where PlzNavigate CSP in a iframe did not get the inherited CSP When inheriting the CSP from a parent document to a local-scheme CSP, it does not always get propagated to the PlzNavigate C...
0
146,799
Analyze the following 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 GDataFileSystem::OnSearch(const SearchCallback& callback, GetDocumentsParams* params, GDataFileError error) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (error != GDATA_FILE_OK) { if (!callback.is_null()) callback.Run...
1
171,483
Analyze the following 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_sanitize_pin_info(struct sc_pin_cmd_pin *pin, unsigned int num) { pin->encoding = SC_PIN_ENCODING_ASCII; pin->min_length = 4; pin->max_length = 16; pin->pad_length = 16; pin->offset = 5 + num * 16; pin->pad_char = 0x00; } Commit Message: fixed out of bounds reads Thanks to Eric Sesterhenn from X4...
0
78,419
Analyze the following 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 intra_prediction_unit_default_value(HEVCContext *s, int x0, int y0, int log2_cb_size) { HEVCLocalContext *lc = s->HEVClc; int pb_size = 1 << log2_cb_size; int size_in_pus = pb_size...
0
90,780
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: t2p_write_advance_directory(T2P* t2p, TIFF* output) { t2p_disable(output); if(!TIFFWriteDirectory(output)){ TIFFError(TIFF2PDF_MODULE, "Error writing virtual directory to output PDF %s", TIFFFileName(output)); t2p->t2p_error = T2P_ERR_ERROR; return; } t2p_enable(output); return; } Commit Messa...
0
48,368
Analyze the following 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 reiserfs_commit_page(struct inode *inode, struct page *page, unsigned from, unsigned to) { unsigned block_start, block_end; int partial = 0; unsigned blocksize; struct buffer_head *bh, *head; unsigned long i_size_index = inode->i_size >> PAGE_CACHE_SHIFT; int new; int logit = reiserfs_file_data_log...
0
46,353
Analyze the following 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 ShouldTreatNavigationAsReload(const NavigationEntry* entry) { if (!entry) return false; if ((ui::PageTransitionCoreTypeIs(entry->GetTransitionType(), ui::PAGE_TRANSITION_RELOAD) && (entry->GetTransitionType() & ui::PAGE_TRANSITION_FROM_ADDRESS_BAR))) { ...
0
137,815
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sshpkt_put_string(struct ssh *ssh, const void *v, size_t len) { return sshbuf_put_string(ssh->state->outgoing_packet, v, len); } Commit Message: CWE ID: CWE-119
0
13,023
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Eina_Bool ewk_frame_mixed_content_displayed_get(const Evas_Object* ewkFrame) { EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, false); return smartData->hasDisplayedMixedContent; } Commit Message: [EFL] fast/frames/frame-crash-with-page-cache.html is crashing https://bugs.webkit.org/show_bug.cgi?id=85879...
0
107,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: void PlatformSensorProviderLinux::OnDeviceAdded( mojom::SensorType type, std::unique_ptr<SensorInfoLinux> sensor_device) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (base::ContainsKey(sensor_devices_by_type_, type)) { DVLOG(1) << "Sensor ignored. Type " << type << ". Node: " ...
0
148,991
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int oidc_check_user_id(request_rec *r) { oidc_cfg *c = ap_get_module_config(r->server->module_config, &auth_openidc_module); /* log some stuff about the incoming HTTP request */ oidc_debug(r, "incoming request: \"%s?%s\", ap_is_initial_req(r)=%d", r->parsed_uri.path, r->args, ap_is_initial_req(r)); /...
0
87,058
Analyze the following 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 SVGDocumentExtensions::updatePan(const FloatPoint& pos) const { if (SVGSVGElement* svg = rootElement(*m_document)) svg->setCurrentTranslate(FloatPoint(pos.x() - m_translate.x(), pos.y() - m_translate.y())); } Commit Message: SVG: Moving animating <svg> to other iframe should not crash. Moving S...
0
120,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: void DocumentLoader::CommitData(const char* bytes, size_t length) { CommitNavigation(response_.MimeType()); DCHECK_GE(state_, kCommitted); if (!frame_ || !frame_->GetDocument()->Parsing()) return; if (length) data_received_ = true; if (parser_blocked_count_) { if (!committed_data_buffer_)...
0
144,084
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void PDFiumEngine::Paint(const pp::Rect& rect, pp::ImageData* image_data, std::vector<pp::Rect>* ready, std::vector<pp::Rect>* pending) { DCHECK(image_data); DCHECK(ready); DCHECK(pending); pp::Rect leftover = rect; for (size_t ...
0
140,393
Analyze the following 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 PermissionUtil::ShouldShowPersistenceToggle() { return base::FeatureList::IsEnabled( features::kDisplayPersistenceToggleInPermissionPrompts); } Commit Message: PermissionUtil::GetPermissionType needs to handle MIDI After the recent PermissionManager's change, it calls GetPermissionType even for CON...
0
129,233
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cpStripToTile(uint8* out, uint8* in, uint32 rows, uint32 cols, int outskew, int inskew) { while (rows-- > 0) { uint32 j = cols; while (j-- > 0) *out++ = *in++; out += outskew; in += inskew; } } Commit Message: * tools/tiffcp.c: fix out-of-bounds write on tiled images with odd tile width vs image...
0
48,211
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebLocalFrameImpl* WebLocalFrameImpl::CreateMainFrame( WebView* web_view, WebLocalFrameClient* client, InterfaceRegistry* interface_registry, WebFrame* opener, const WebString& name, WebSandboxFlags sandbox_flags) { WebLocalFrameImpl* frame = new WebLocalFrameImpl(WebTreeScopeType::kDocu...
0
145,708
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XineramaXvSetPortAttribute(ClientPtr client) { REQUEST(xvSetPortAttributeReq); PanoramiXRes *port; int result, i; REQUEST_SIZE_MATCH(xvSetPortAttributeReq); result = dixLookupResourceByType((void **) &port, stuff->port, XvXRTPort, client, DixReadAccess); ...
0
17,517
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nsPluginInstance::GetValue(NPPVariable aVariable, void *aValue) { if (aVariable == NPPVpluginScriptableNPObject) { if (_scriptObject) { void **v = (void **)aValue; NPN_RetainObject(_scriptObject); *v = _scriptObject; } else { gnash::log_debug("_...
0
13,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: ext4_fsblk_t ext_pblock(struct ext4_extent *ex) { ext4_fsblk_t block; block = le32_to_cpu(ex->ee_start_lo); block |= ((ext4_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1; return block; } Commit Message: ext4: use ext4_get_block_write in buffer write Allocate uninitialized extent before ext4 buffer writ...
0
57,467
Analyze the following 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_n_lt(PG_FUNCTION_ARGS) { PATH *p1 = PG_GETARG_PATH_P(0); PATH *p2 = PG_GETARG_PATH_P(1); PG_RETURN_BOOL(p1->npts < p2->npts); } Commit Message: Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such that the calculatio...
0
38,964
Analyze the following 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 __init chainiv_module_init(void) { return crypto_register_template(&chainiv_tmpl); } Commit Message: crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to the template lookup as well. For example, attempting to load 'vfat(blowfish)' via AF_ALG now correc...
0
45,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: sg_read_oxfer(Sg_request * srp, char __user *outp, int num_read_xfer) { Sg_scatter_hold *schp = &srp->data; int k, num; SCSI_LOG_TIMEOUT(4, sg_printk(KERN_INFO, srp->parentfp->parentdp, "sg_read_oxfer: num_read_xfer=%d\n", num_read_xfer)); if ((!outp) || (num_read_xfer <= 0)) return 0; num = 1 <<...
0
42,297