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 NavigationRequest::OnRedirectChecksComplete( NavigationThrottle::ThrottleCheckResult result) { DCHECK(result.action() != NavigationThrottle::DEFER); DCHECK(result.action() != NavigationThrottle::BLOCK_RESPONSE); bool collapse_frame = result.action() == NavigationThrottle::BLOCK_REQUEST_AND_C...
0
152,352
Analyze the following 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 MediaStreamDevicesController::NotifyUIRequestDenied() const { if (!content_settings_) return; if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE || request_.video_type == content::MEDIA_TAB_VIDEO_CAPTURE) { return; } if (request_.audio_type == content::MEDIA_DEVICE_AUDIO_CA...
0
113,390
Analyze the following 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 new_idmap_permitted(struct user_namespace *ns, int cap_setid, struct uid_gid_map *new_map) { /* Allow mapping to your own filesystem ids */ if ((new_map->nr_extents == 1) && (new_map->extent[0].count == 1)) { u32 id = new_map->extent[0].lower_first; if (cap_setid == CAP_SETUID) { kuid_...
1
166,092
Analyze the following 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 rose_listen(struct socket *sock, int backlog) { struct sock *sk = sock->sk; if (sk->sk_state != TCP_LISTEN) { struct rose_sock *rose = rose_sk(sk); rose->dest_ndigis = 0; memset(&rose->dest_addr, 0, ROSE_ADDR_LEN); memset(&rose->dest_call, 0, AX25_ADDR_LEN); memset(rose->dest_digis, 0, AX...
0
22,209
Analyze the following 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 VaapiVideoDecodeAccelerator::ImportBufferForPicture( int32_t picture_buffer_id, const gfx::GpuMemoryBufferHandle& gpu_memory_buffer_handle) { VLOGF(2) << "Importing picture id: " << picture_buffer_id; DCHECK(task_runner_->BelongsToCurrentThread()); if (output_mode_ != Config::OutputMode::IMPOR...
0
148,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: void V8Debugger::unmuteScriptParsedEvents() { --m_ignoreScriptParsedEventsCounter; DCHECK_GE(m_ignoreScriptParsedEventsCounter, 0); } Commit Message: [DevTools] Copy objects from debugger context to inspected context properly. BUG=637594 Review-Url: https://codereview.chromium.org/2253643002 Cr-Commit-...
0
130,391
Analyze the following 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 DragStart(aura::Window* window) { resizer_ = CreateWindowResizer(window, window->bounds().origin(), HTCAPTION, ::wm::WINDOW_MOVE_SOURCE_MOUSE); } Commit Message: cros: Enable some tests in //ash/wm in ash_unittests --mash For the ones that fail, disable them via f...
0
133,264
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TT_Set_MM_Blend( TT_Face face, FT_UInt num_coords, FT_Fixed* coords ) { FT_Error error = TT_Err_Ok; GX_Blend blend; FT_MM_Var* mmvar; FT_UInt i; FT_Memory memory = face->root.memory; enum { mcvt_retain, mcvt_mod...
0
7,745
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DownloadManagerImpl::GetDownloadFileFactoryForTesting() { return in_progress_manager_->file_factory(); } Commit Message: Early return if a download Id is already used when creating a download This is protect against download Id overflow and use-after-free issue. BUG=958533 Change-Id: I2c183493cb09106686df98...
0
151,206
Analyze the following 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 Tags::Tag::Clear() { while (m_simple_tags_count > 0) { SimpleTag& d = m_simple_tags[--m_simple_tags_count]; d.Clear(); } delete[] m_simple_tags; m_simple_tags = NULL; m_simple_tags_size = 0; } Commit Message: Fix ParseElementHeader to support 0 payload elements Cherry-pick'ing Change 5c83bbec...
0
164,188
Analyze the following 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 Ins_SHP( INS_ARG ) { TGlyph_Zone zp; Int refp; TT_F26Dot6 dx, dy; Long point; (void)args; if ( CUR.top < CUR.GS.loop ) { CUR.error = TT_Err_Invalid_Reference; return; } if ( COMPUTE_Point_Displacement( &dx, &dy, &z...
0
5,451
Analyze the following 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 srpt_mad_recv_handler(struct ib_mad_agent *mad_agent, struct ib_mad_send_buf *send_buf, struct ib_mad_recv_wc *mad_wc) { struct srpt_port *sport = (struct srpt_port *)mad_agent->context; struct ib_ah *ah; struct ib_mad_send_buf *rsp; struct ib_dm_mad *dm_mad; if (!mad_wc || !mad_wc->...
0
50,673
Analyze the following 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* t2p_init() { T2P* t2p = (T2P*) _TIFFmalloc(sizeof(T2P)); if(t2p==NULL){ TIFFError( TIFF2PDF_MODULE, "Can't allocate %lu bytes of memory for t2p_init", (unsigned long) sizeof(T2P)); return( (T2P*) NULL ); } _TIFFmemset(t2p, 0x00, sizeof(T2P)); t2p->pdf_majorversion=1; t2p->pdf_minorversio...
0
48,345
Analyze the following 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 PHP_INI_MH(OnUpdateHashFunc) /* {{{ */ { long val; char *endptr = NULL; #if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH) PS(hash_ops) = NULL; #endif val = strtol(new_value, &endptr, 10); if (endptr && (*endptr == '\0')) { /* Numeric value */ PS(hash_func) = val ? 1 : 0; return SUCCESS;...
0
9,602
Analyze the following 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<SendTabToSelfEntry> SendTabToSelfEntry::FromProto( const sync_pb::SendTabToSelfSpecifics& pb_entry, base::Time now) { std::string guid(pb_entry.guid()); if (guid.empty()) { return nullptr; } GURL url(pb_entry.url()); if (!url.is_valid()) { return nullptr; } base::T...
0
142,388
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PP_CursorType_Dev Instance::CalculateAutoscroll(const pp::Point& mouse_pos) { if (autoscroll_rect_.Contains(mouse_pos)) { autoscroll_x_ = 0; autoscroll_y_ = 0; return PP_CURSORTYPE_MIDDLEPANNING; } pp::Point rel_pos = mouse_pos - autoscroll_rect_.CenterPoint(); double angle = atan2(static_ca...
0
120,111
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: tt_cmap14_get_def_chars( TT_CMap cmap, FT_Byte* p, FT_Memory memory ) { TT_CMap14 cmap14 = (TT_CMap14) cmap; FT_UInt32 numRanges; FT_UInt cnt; FT_UInt32* q; cnt = tt_cmap14_def_char_count( p ); numRanges = (FT...
0
7,108
Analyze the following 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 del_dac(struct task_struct *child, int slot) { if (slot == 1) { if ((dbcr_dac(child) & (DBCR_DAC1R | DBCR_DAC1W)) == 0) return -ENOENT; child->thread.dac1 = 0; dbcr_dac(child) &= ~(DBCR_DAC1R | DBCR_DAC1W); #ifdef CONFIG_PPC_ADV_DEBUG_DAC_RANGE if (child->thread.dbcr2 & DBCR2_DAC12MODE) { ...
0
25,471
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: aspath_confed_check (struct aspath *aspath) { struct assegment *seg; if ( !(aspath && aspath->segments) ) return 0; seg = aspath->segments; while (seg) { if (seg->type == AS_CONFED_SET || seg->type == AS_CONFED_SEQUENCE) return 1; seg = seg->next; } return 0; } Commit Mess...
0
1,571
Analyze the following 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 __ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr *tmpaddr) { if (tmpaddr && memcmp(idev->rndid, &tmpaddr->s6_addr[8], 8) == 0) __ipv6_regen_rndid(idev); } Commit Message: ipv6: addrconf: validate new MTU before applying it Currently we don't check if the new MTU is valid or not and...
0
41,742
Analyze the following 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 port_cleanup(struct si_sm_io *io) { unsigned int addr = io->addr_data; int idx; if (addr) { for (idx = 0; idx < io->io_size; idx++) release_region(addr + idx * io->regspacing, io->regsize); } } Commit Message: ipmi_si: fix use-after-free of resource->name When we excute...
0
90,278
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool AuthenticatorTransportSelectorSheetModel::IsBackButtonVisible() const { return false; } Commit Message: chrome/browser/ui/webauthn: long domains may cause a line break. As requested by UX in [1], allow long host names to split a title into two lines. This allows us to show more of the name before eliding...
0
142,967
Analyze the following 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 ImageLoader::ImageChanged(ImageResourceContent* content, CanDeferInvalidation, const IntRect*) { DCHECK_EQ(content, image_content_.Get()); if (image_complete_ || !content->IsLoading() || delay_until_image_notify_finished_) return; ...
0
147,495
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: reject_slave_controller(struct ofconn *ofconn) { if (ofconn_get_type(ofconn) == OFCONN_PRIMARY && ofconn_get_role(ofconn) == OFPCR12_ROLE_SLAVE) { return OFPERR_OFPBRC_IS_SLAVE; } else { return 0; } } Commit Message: ofproto: Fix OVS crash when reverting old flows in bundle co...
0
77,421
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int jpc_dec_cp_setfrompoc(jpc_dec_cp_t *cp, jpc_poc_t *poc, int reset) { int pchgno; jpc_pchg_t *pchg; if (reset) { while (jpc_pchglist_numpchgs(cp->pchglist) > 0) { pchg = jpc_pchglist_remove(cp->pchglist, 0); jpc_pchg_destroy(pchg); } } for (pchgno = 0; pchgno < poc->numpchgs; ++pchgno) { ...
0
70,414
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: next_cache_entry(struct archive_read *a, struct iso9660 *iso9660, struct file_info **pfile) { struct file_info *file; struct { struct file_info *first; struct file_info **last; } empty_files; int64_t number; int count; file = cache_get_entry(iso9660); if (file != NULL) { *pfile = file; return ...
0
51,208
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, GLint drawbuffer, const Vector<GLuint>& value, GLuint src_offset) { if (isContextLost() || !Validat...
0
146,634
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool TemplateURL::SupportsReplacement( const SearchTermsData& search_terms_data) const { return url_ref_->SupportsReplacement(search_terms_data); } Commit Message: [Contextual Search] Change "Now on Tap" to "Contextual Cards" BUG=644934 Review-Url: https://codereview.chromium.org/2361163003 Cr-Commit-Pos...
0
120,315
Analyze the following 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 ChromeDownloadManagerDelegate::RequestConfirmation( DownloadItem* download, const base::FilePath& suggested_path, DownloadConfirmationReason reason, const DownloadTargetDeterminerDelegate::ConfirmationCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(!download->IsTransi...
0
146,260
Analyze the following 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 || src->interpolation_id < 0 || src->interpolation_id > GD_METHOD_COUNT) { return 0; } switch (src->interpolation_id) { /*Special cases, ...
0
56,300
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_METHOD(snmp, walk) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, (-1)); } Commit Message: CWE ID: CWE-20
0
11,212
Analyze the following 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_idr_max_id(int id, void *p, void *data) { int *k = data; if (*k < id) *k = id; return 0; } Commit Message: sg_start_req(): make sure that there's not too many elements in iovec unfortunately, allowing an arbitrary 16bit value means a possibility of overflow in the calculation of total number of pages ...
0
42,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: static int filter_pred_comm(struct filter_pred *pred, void *event) { int cmp; cmp = pred->regex.match(current->comm, &pred->regex, TASK_COMM_LEN); return cmp ^ pred->not; } Commit Message: Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes...
0
81,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: RenderFrameHostImpl* RenderFrameHostManager::Navigate( const GURL& dest_url, const FrameNavigationEntry& frame_entry, const NavigationEntryImpl& entry, bool is_reload) { TRACE_EVENT1("navigation", "RenderFrameHostManager:Navigate", "FrameTreeNode id", frame_tree_node_->frame_tree_...
0
136,216
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlBufContent(const xmlBuf *buf) { if ((!buf) || (buf->error)) return NULL; return(buf->content); } Commit Message: Roll libxml to 3939178e4cb797417ff033b1e04ab4b038e224d9 Removes a few patches fixed upstream: https://git.gnome.org/browse/libxml2/commit/?id=e26630548e7d138d2c560844c43820b676725...
0
150,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: bool ExtensionApiTest::ExtensionSubtestsAreSkipped() { #if defined(OS_WIN) && !defined(NDEBUG) LOG(WARNING) << "Workaround for 177163, prematurely returning"; return true; #else return false; #endif } Commit Message: Hide DevTools frontend from webRequest API Prevent extensions from observing requests for...
0
146,561
Analyze the following 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::BindFramebufferHelper(GLenum target, GLuint framebuffer) { bool changed = false; switch (target) { case GL_FRAMEBUFFER: if (bound_framebuffer_ != framebuffer || bound_read_framebuffer_ != framebuffer) { bound...
0
140,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 ServiceURLRequest(const std::string& response) { net::TestURLFetcher* url_fetcher = test_url_fetcher_factory_.GetFetcherByID(0); ASSERT_NE(nullptr, url_fetcher); url_fetcher->set_response_code(200); url_fetcher->SetResponseString(response); url_fetcher->delegate()->OnURLFetchCo...
0
110,132
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: process_server_config_line(ServerOptions *options, char *line, const char *filename, int linenum, int *activep, struct connection_info *connectinfo) { char *cp, **charptr, *arg, *p; int cmdline = 0, *intptr, value, value2, n, port; SyslogFacility *log_facility_ptr; LogLevel *log_level_ptr; ServerOpCo...
0
72,231
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: simple_error (void) { DBusMessage *message; message = dbus_message_new (DBUS_MESSAGE_TYPE_ERROR); if (message == NULL) _dbus_assert_not_reached ("oom"); if (!dbus_message_set_error_name (message, "foo.bar")) _dbus_assert_not_reached ("oom"); set_reply_serial (message); return message;...
0
7,503
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebGLRenderingContextBase::~WebGLRenderingContextBase() { destruction_in_progress_ = true; DestroyContext(); RestoreEvictedContext(this); } 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...
1
172,538
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int gdTransformAffineCopy(gdImagePtr dst, int dst_x, int dst_y, const gdImagePtr src, gdRectPtr src_region, const double affine[6]) { int c1x,c1y,c2x,c2y; int backclip = 0; int backup_clipx1, backup_clipy1, backup_clipx2, backup_clipy2; register int x, y, src_offset_x, src_offset_y; double in...
1
170,006
Analyze the following 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 LodePNGText_cleanup(LodePNGInfo* info) { size_t i; for(i = 0; i < info->text_num; i++) { string_cleanup(&info->text_keys[i]); string_cleanup(&info->text_strings[i]); } free(info->text_keys); free(info->text_strings); } Commit Message: Fixed #5645: realloc return handling CWE ID: C...
0
87,433
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _cdf_tole2(uint16_t sv) { uint16_t rv; uint8_t *s = (uint8_t *)(void *)&sv; uint8_t *d = (uint8_t *)(void *)&rv; d[0] = s[1]; d[1] = s[0]; return rv; } Commit Message: CWE ID:
0
15,456
Analyze the following 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_ptr<base::Value> PixelBufferRasterWorkerPool::StateAsValue() const { scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue); state->SetInteger("completed_count", completed_tasks_.size()); state->SetInteger("pending_count", pixel_buffer_tasks_.size()); state->SetInteger("pending_upload_...
0
112,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: void SimulateFreezeSignal(content::WebContents* contents) { TabLifecycleUnitSource::GetInstance() ->GetTabLifecycleUnit(contents) ->UpdateLifecycleState(mojom::LifecycleState::kFrozen); } Commit Message: Allow origin lock for WebUI pages. Returning true for WebUI pages in DoesSiteRequire...
0
156,479
Analyze the following 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 UDPSocketWin::DidCompleteRead() { DWORD num_bytes, flags; BOOL ok = WSAGetOverlappedResult(socket_, &core_->read_overlapped_, &num_bytes, FALSE, &flags); WSAResetEvent(core_->read_overlapped_.hEvent); int result = ok ? num_bytes : MapSystemError(WSAGetLastError()); ...
0
113,439
Analyze the following 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 CanGetFilesId() { return SystemSaltGetter::Get()->GetRawSalt(); } Commit Message: [reland] Do not set default wallpaper unless it should do so. TBR=bshe@chromium.org, alemate@chromium.org Bug: 751382 Change-Id: Id0793dfe467f737526a95b1e66ed01fbb8860bda Reviewed-on: https://chromium-review.googlesource.c...
0
127,971
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: apprentice_1(struct magic_set *ms, const char *fn, int action) { struct mlist *ml; struct magic_map *map; size_t i; if (magicsize != FILE_MAGICSIZE) { file_error(ms, 0, "magic element size %lu != %lu", (unsigned long)sizeof(*map->magic[0]), (unsigned long)FILE_MAGICSIZE); return -1; } if (...
0
7,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: reportComment(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) { XML_Char *data; if (!parser->m_commentHandler) { if (parser->m_defaultHandler) reportDefault(parser, enc, start, end); return 1; } data = poolStoreString(&parser->m_tempPool, ...
0
92,365
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: process_system_pointer_pdu(STREAM s) { uint32 system_pointer_type; logger(Protocol, Debug, "%s()", __func__); in_uint32_le(s, system_pointer_type); set_system_pointer(system_pointer_type); } Commit Message: Malicious RDP server security fixes This commit includes fixes for a set of 21 vulnerabilities in r...
0
92,996
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: layer_get_visible(int layer) { return s_map->layers[layer].is_visible; } Commit Message: Fix integer overflow in layer_resize in map_engine.c (#268) * Fix integer overflow in layer_resize in map_engine.c There's a buffer overflow bug in the function layer_resize. It allocates a buffer `tilemap` with size `...
0
75,002
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlParseEntityDecl(xmlParserCtxtPtr ctxt) { const xmlChar *name = NULL; xmlChar *value = NULL; xmlChar *URI = NULL, *literal = NULL; const xmlChar *ndata = NULL; int isParameter = 0; xmlChar *orig = NULL; int skipped; /* GROW; done in the caller */ if (CMP8(CUR_PTR, '<', '...
1
171,288
Analyze the following 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 ValidateBrowserAllocations(base::Value* dump_json) { SCOPED_TRACE("Validating Browser Allocations"); base::Value* heaps_v2 = FindHeapsV2(base::Process::Current().Pid(), dump_json); if (GetParam() == switches::kMemlogModeAll || GetParam() == switches::kMemlogModeBrowser || ...
0
150,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: PHP_FUNCTION(openssl_spki_verify) { size_t spkstr_len; int i = 0, spkstr_cleaned_len = 0; char *spkstr = NULL, * spkstr_cleaned = NULL; EVP_PKEY *pkey = NULL; NETSCAPE_SPKI *spki = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &spkstr, &spkstr_len) == FAILURE) { return; } RETVAL_FALSE; if (s...
0
4,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: mrb_f_raise(mrb_state *mrb, mrb_value self) { mrb_value a[2], exc; mrb_int argc; argc = mrb_get_args(mrb, "|oo", &a[0], &a[1]); switch (argc) { case 0: mrb_raise(mrb, E_RUNTIME_ERROR, ""); break; case 1: if (mrb_string_p(a[0])) { a[1] = a[0]; argc = 2; a[0] = mrb_obj_va...
0
82,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: void qeth_set_allowed_threads(struct qeth_card *card, unsigned long threads, int clear_start_mask) { unsigned long flags; spin_lock_irqsave(&card->thread_mask_lock, flags); card->thread_allowed_mask = threads; if (clear_start_mask) card->thread_start_mask &= threads; spin_unlock_irqrestore(&card->thre...
0
28,633
Analyze the following 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 php_http_params_separator_free(php_http_params_token_t **separator) { php_http_params_token_t **sep = separator; if (sep) { while (*sep) { PTR_FREE((*sep)->str); efree(*sep); ++sep; } efree(separator); } } Commit Message: fix bug #73055 CWE ID: CWE-704
0
93,990
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: std::string DevToolsAgentHost::GetProtocolVersion() { return "1.3"; } Commit Message: [DevTools] Do not allow chrome.debugger to attach to web ui pages If the page navigates to web ui, we force detach the debugger extension. TBR=alexclarke@chromium.org Bug: 798222 Change-Id: Idb46c2f59e839388397a8dfa6ce2e2a...
0
155,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: static int hub_port_status(struct usb_hub *hub, int port1, u16 *status, u16 *change) { int ret; mutex_lock(&hub->status_mutex); ret = get_port_status(hub->hdev, port1, &hub->status->port); if (ret < 4) { if (ret != -ENODEV) dev_err(hub->intfdev, "%s failed (err = %d)\n", __func__, ret); if (ret ...
0
56,760
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int cac_process_ACA(sc_card_t *card, cac_private_data_t *priv) { int r; u8 *val = NULL; size_t val_len; SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE); /* Assuming ACA is already selected */ r = cac_get_acr(card, CAC_ACR_SERVICE, &val, &val_len); if (r < 0) goto done; r = cac_parse_ACA_servic...
0
78,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: lvs_netlink_monitor_rcv_bufs_force_handler(vector_t *strvec) { int res = true; if (!strvec) return; if (vector_size(strvec) >= 2) { res = check_true_false(strvec_slot(strvec,1)); if (res < 0) { report_config_error(CONFIG_GENERAL_ERROR, "Invalid value '%s' for global lvs_netlink_monitor_rcv_bufs_forc...
0
75,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: static TEE_Result tee_svc_obj_generate_key_ecc( struct tee_obj *o, const struct tee_cryp_obj_type_props *type_props, uint32_t key_size __unused, const TEE_Attribute *params, uint32_t param_count) { TEE_Result res; struct ecc_keypair *tee_ecc_key; /* Copy the present attributes into the obj before starting ...
0
86,897
Analyze the following 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 sc_pkcs15emu_sc_hsm_add_cd(sc_pkcs15_card_t * p15card, u8 id) { sc_card_t *card = p15card->card; sc_pkcs15_cert_info_t *cert_info; sc_pkcs15_object_t obj; u8 fid[2]; u8 efbin[512]; const u8 *ptr; size_t len; int r; fid[0] = CD_PREFIX; fid[1] = id; /* Try to select a related EF containing ...
0
78,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: SplashCoord *Splash::getMatrix() { return state->matrix; } Commit Message: CWE ID: CWE-189
0
1,263
Analyze the following 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 Resource::WillAddClientOrObserver() { if (!HasClientsOrObservers()) { is_alive_ = true; } } Commit Message: Check CORS using PassesAccessControlCheck() with supplied SecurityOrigin Partial revert of https://chromium-review.googlesource.com/535694. Bug: 799477 Change-Id: I878bb9bcb83afaafe8601293db...
0
149,777
Analyze the following 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_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s) { AVDictionaryEntry *title = av_dict_get(s->metadata, "title", NULL, 0); int64_t pos, pos2; if (title) { pos = avio_tell(pb); avio_wb32(pb, 0); /* size placeholder*/ ffio_wfourcc(pb, "uuid"); ffio_w...
0
79,435
Analyze the following 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 reds_link_free(RedLinkInfo *link) { reds_stream_free(link->stream); link->stream = NULL; free(link->link_mess); link->link_mess = NULL; BN_free(link->tiTicketing.bn); link->tiTicketing.bn = NULL; if (link->tiTicketing.rsa) { RSA_free(link->tiTicketing.rsa); ...
0
1,892
Analyze the following 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 uint32_t deserialize_gw_speed(uint8_t value) { uint32_t speed; uint32_t exp; if (!value) { return 0; } if (value == UINT8_MAX) { /* maximum value: also return maximum value */ return MAX_SMARTGW_SPEED; } speed = (value >> 3) + 1; exp = value & 7; while (exp-- > 0) { sp...
0
62,033
Analyze the following 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 TestOfflineLoadPage::NotifyBlockingPageComplete(bool proceed) { test_page_->OnBlockingPageComplete(proceed); } Commit Message: Disable crashing OfflineLoadPageTest TBR=jam@chromium.org BUG=113219 TEST=none Review URL: https://chromiumcodereview.appspot.com/9358027 git-svn-id: svn://svn.chromium.org/c...
0
107,187
Analyze the following 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 megasas_use_queue64(MegasasState *s) { return s->flags & MEGASAS_MASK_USE_QUEUE64; } Commit Message: CWE ID: CWE-200
0
10,485
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: check_spnego_options(spnego_gss_ctx_id_t spnego_ctx) { spnego_ctx->optionStr = gssint_get_modOptions( (const gss_OID)&spnego_oids[0]); } Commit Message: Fix null deref in SPNEGO acceptor [CVE-2014-4344] When processing a continuation token, acc_ctx_cont was dereferencing the initial byte of the token without...
0
36,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: static void vhost_scsi_exit(void) { vhost_scsi_deregister_configfs(); vhost_scsi_deregister(); destroy_workqueue(vhost_scsi_workqueue); }; Commit Message: vhost/scsi: potential memory corruption This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt" to UINT_MAX but the data type of "tpg->tpo...
0
43,088
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void webkit_web_view_set_zoom_level(WebKitWebView* webView, gfloat zoomLevel) { g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); webkit_web_view_apply_zoom_level(webView, zoomLevel); g_object_notify(G_OBJECT(webView), "zoom-level"); } Commit Message: 2011-06-02 Joone Hur <joone.hur@collabora.co.uk> ...
0
100,646
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: float WebLocalFrameImpl::PrintPage(int page, cc::PaintCanvas* canvas) { DCHECK(print_context_); DCHECK_GE(page, 0); DCHECK(GetFrame()); DCHECK(GetFrame()->GetDocument()); return print_context_->SpoolSinglePage(canvas, page); } Commit Message: Do not forward resource timing to parent frame after back-f...
0
145,752
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xsltNumberFormatGetAnyLevel(xsltTransformContextPtr context, xmlNodePtr node, xsltCompMatchPtr countPat, xsltCompMatchPtr fromPat, double *array, xmlDocPtr doc, xmlNodePtr elem) { int amount = 0; int cnt = 0; xmlNodePtr cur; /* select the starting ...
1
173,308
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void CrosLibrary::TestApi::SetCryptohomeLibrary( CryptohomeLibrary* library, bool own) { library_->crypto_lib_.SetImpl(library, own); } Commit Message: chromeos: Replace copy-and-pasted code with macros. This replaces a bunch of duplicated-per-library cros function definitions and comments. BUG=none TEST...
1
170,637
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void coroutine_fn virtfs_co_reset(void *opaque) { VirtfsCoResetData *data = opaque; virtfs_reset(&data->pdu); data->done = true; } Commit Message: CWE ID: CWE-400
0
7,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 AutofillDialogViews::InputEditedOrActivated(ServerFieldType type, const gfx::Rect& bounds, bool was_edit) { DCHECK_NE(UNKNOWN_TYPE, type); ExpandingTextfield* textfield = TextfieldForType(type); views::Co...
0
109,998
Analyze the following 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 function_stat_cmp(void *p1, void *p2) { struct ftrace_profile *a = p1; struct ftrace_profile *b = p2; if (a->time < b->time) return -1; if (a->time > b->time) return 1; else return 0; } Commit Message: tracing: Fix possible NULL pointer dereferences Currently set_ftrace_pid and set_graph_...
0
30,242
Analyze the following 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 long insn_get_seg_base(struct pt_regs *regs, int seg_reg_idx) { struct desc_struct *desc; short sel; sel = get_segment_selector(regs, seg_reg_idx); if (sel < 0) return -1L; if (v8086_mode(regs)) /* * Base is simply the segment selector shifted 4 * bits to the right. */ return (...
1
169,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 pppol2tp_next_tunnel(struct net *net, struct pppol2tp_seq_data *pd) { for (;;) { pd->tunnel = l2tp_tunnel_find_nth(net, pd->tunnel_idx); pd->tunnel_idx++; if (pd->tunnel == NULL) break; /* Ignore L2TPv3 tunnels */ if (pd->tunnel->version < 3) break; } } Commit Message: net/l2tp: d...
0
36,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: void RenderView::OnDragTargetDrop(const gfx::Point& client_point, const gfx::Point& screen_point) { webview()->dragTargetDrop(client_point, screen_point); Send(new DragHostMsg_TargetDrop_ACK(routing_id_)); } Commit Message: DevTools: move DevToolsAgent/Client into content. ...
0
98,937
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int tracing_time_stamp_mode_open(struct inode *inode, struct file *file) { struct trace_array *tr = inode->i_private; int ret; if (tracing_disabled) return -ENODEV; if (trace_array_get(tr)) return -ENODEV; ret = single_open(file, tracing_time_stamp_mode_show, inode->i_private); if (ret < 0) ...
0
81,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: static int vfio_intx_set_signal(struct vfio_pci_device *vdev, int fd) { struct pci_dev *pdev = vdev->pdev; unsigned long irqflags = IRQF_SHARED; struct eventfd_ctx *trigger; unsigned long flags; int ret; if (vdev->ctx[0].trigger) { free_irq(pdev->irq, vdev); kfree(vdev->ctx[0].name); eventfd_ctx_put(...
0
48,612
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: buf_find_string_offset(const buf_t *buf, const char *s, size_t n) { buf_pos_t pos; buf_pos_init(buf, &pos); while (buf_find_pos_of_char(*s, &pos) >= 0) { if (buf_matches_at_pos(&pos, s, n)) { tor_assert(pos.chunk_pos + pos.pos < INT_MAX); return (int)(pos.chunk_pos + pos.pos); } else { ...
0
73,146
Analyze the following 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 exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoPtr, char **pszEncoding, char *szValuePtr, int ByteCount TSRMLS_DC) { int a; char *decode; size_t len;; *pszEncoding = NULL; /* Copy the comment */ if (ByteCount>=8) { if (!memcmp(szValuePtr, "UNICODE\0", 8)) { *pszEncod...
0
10,956
Analyze the following 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 activityLoggedInIsolatedWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); if (contextData && contextData->activit...
0
121,524
Analyze the following 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 php_wddx_push_element(void *user_data, const XML_Char *name, const XML_Char **atts) { st_entry ent; wddx_stack *stack = (wddx_stack *)user_data; if (!strcmp(name, EL_PACKET)) { int i; if (atts) for (i=0; atts[i]; i++) { if (!strcmp(atts[i], EL_VERSION)) { /* nothing for now */ } }...
1
164,758
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _asn1_error_description_tag_error (asn1_node node, char *ErrorDescription) { Estrcpy (ErrorDescription, ":: tag error near element '"); _asn1_hierarchical_name (node, ErrorDescription + strlen (ErrorDescription), ASN1_MAX_ERROR_DESCRIPTION_SIZE - 40); Estrcat (ErrorDescription, "'"); } Commit Messa...
0
11,275
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void OmniboxViewViews::SaveStateToTab(content::WebContents* tab) { DCHECK(tab); if (IsIMEComposing()) { ConfirmCompositionText(); GetInputMethod()->CancelComposition(this); } OmniboxEditModel::State state = model()->GetStateForTabSwitch(); tab->SetUserData(OmniboxState::kKey, std::make_unique<...
0
142,468
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int connect(struct socket *sock, struct sockaddr *dest, int destlen, int flags) { struct sock *sk = sock->sk; struct sockaddr_tipc *dst = (struct sockaddr_tipc *)dest; struct msghdr m = {NULL,}; unsigned int timeout; int res; lock_sock(sk); /* For now, TIPC does not allow use of connect() wit...
0
30,451
Analyze the following 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 RenderViewImpl::OnImeConfirmComposition( const string16& text, const ui::Range& replacement_range) { if (pepper_delegate_.IsPluginFocused()) { pepper_delegate_.OnImeConfirmComposition(text); } else { #if defined(OS_WIN) if (focused_plugin_id_ >= 0) { std::set<WebPluginDelegateProxy*>:...
0
108,382
Analyze the following 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 GetAcceptedSocketCount() const { return sockets_.size(); } Commit Message: Origins should be represented as url::Origin (not as GURL). As pointed out in //docs/security/origin-vs-url.md, origins should be represented as url::Origin (not as GURL). This CL applies this guideline to predictor-related cod...
0
136,871
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void usb_set_lpm_mel(struct usb_device *udev, struct usb3_lpm_parameters *udev_lpm_params, unsigned int udev_exit_latency, struct usb_hub *hub, struct usb3_lpm_parameters *hub_lpm_params, unsigned int hub_exit_latency) { unsigned int total_mel; unsigned int device_mel; unsigned int hub_mel; ...
0
56,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: static int nf_tables_dump_set(struct sk_buff *skb, struct netlink_callback *cb) { const struct nft_set *set; struct nft_set_dump_args args; struct nft_ctx ctx; struct nlattr *nla[NFTA_SET_ELEM_LIST_MAX + 1]; struct nfgenmsg *nfmsg; struct nlmsghdr *nlh; struct nlattr *nest; u32 portid, seq; int event, er...
0
57,955
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: be4(const unsigned char *p) { return ((((int64_t)p[0]) << 24) + (p[1] << 16) + (p[2] << 8) + (p[3])); } Commit Message: Reject cpio symlinks that exceed 1MB CWE ID: CWE-20
0
52,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 dousers(void) { struct passwd *pw; struct group *gr; gchar* str; if(rungroup) { gr=getgrnam(rungroup); if(!gr) { str = g_strdup_printf("Invalid group name: %s", rungroup); err(str); } if(setgid(gr->gr_gid)<0) { err("Could not set GID: %m"); } } if(runuser) { pw=getpwnam(runuser); ...
0
18,429
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: perf_event_alloc(struct perf_event_attr *attr, int cpu, struct task_struct *task, struct perf_event *group_leader, struct perf_event *parent_event, perf_overflow_handler_t overflow_handler, void *context, int cgroup_fd) { struct pmu *pmu; struct perf_event *event; struct hw_perf_event *hwc; lon...
0
56,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: static ssize_t do_sock_write(struct msghdr *msg, struct kiocb *iocb, struct file *file, const struct iovec *iov, unsigned long nr_segs) { struct socket *sock = file->private_data; size_t size = 0; int i; for (i = 0; i < nr_segs; i++) size += iov[i].iov_len; msg->msg_name = NULL; msg->msg_namelen =...
0
18,653