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: static void prune_init_slice(char *cg) { char *point; point = cg + strlen(cg) - strlen(INITSCOPE); if (point < cg) return; if (strcmp(point, INITSCOPE) == 0) { if (point == cg) *(point+1) = '\0'; else *point = '\0'; } } Commit Message: Implement privilege check when moving tasks When writing p...
0
44,440
Analyze the following 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 uv__process_init_stdio(uv_stdio_container_t* container, int fds[2]) { int mask; int fd; mask = UV_IGNORE | UV_CREATE_PIPE | UV_INHERIT_FD | UV_INHERIT_STREAM; switch (container->flags & mask) { case UV_IGNORE: return 0; case UV_CREATE_PIPE: assert(container->data.stream != NULL);...
0
44,847
Analyze the following 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 generic_readlink(struct dentry *dentry, char __user *buffer, int buflen) { struct nameidata nd; void *cookie; int res; nd.depth = 0; cookie = dentry->d_inode->i_op->follow_link(dentry, &nd); if (IS_ERR(cookie)) return PTR_ERR(cookie); res = vfs_readlink(dentry, buffer, buflen, nd_get_link(&nd)); i...
0
39,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: void bta_hh_co_close(UINT8 dev_handle, UINT8 app_id) { UINT32 i; btif_hh_device_t *p_dev = NULL; APPL_TRACE_WARNING("%s: dev_handle = %d, app_id = %d", __FUNCTION__, dev_handle, app_id); if (dev_handle == BTA_HH_INVALID_HANDLE) { APPL_TRACE_WARNING("%s: Oops, dev_handle (%d) is invalid...", __F...
0
158,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: void FrameView::removeSlowRepaintObject() { ASSERT(m_slowRepaintObjectCount > 0); m_slowRepaintObjectCount--; if (!m_slowRepaintObjectCount) { if (Page* page = m_frame->page()) { if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) scrollin...
0
119,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: void Wait() { run_loop_->Run(); } Commit Message: Security drop fullscreen for any nested WebContents level. This relands 3dcaec6e30feebefc11e with a fix to the test. BUG=873080 TEST=as in bug Change-Id: Ie68b197fc6b92447e9633f233354a68fefcf20c7 Reviewed-on: https://chromium-review.googlesource.com/1175925 ...
0
145,976
Analyze the following 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 BrowserTabStripController::IsCompatibleWith(TabStrip* other) const { Profile* other_profile = static_cast<BrowserTabStripController*>(other->controller())->profile(); return other_profile == profile(); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST...
0
118,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: static inline size_t parse_uiv(const unsigned char *p) { unsigned char cursor; size_t result = 0; if (*p == '+') { p++; } while (1) { cursor = *p; if (cursor >= '0' && cursor <= '9') { result = result * 10 + (size_t)(cursor - (unsigned char)'0'); } else { break; } p++; } return result;...
0
7,553
Analyze the following 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 TextTrack::InvalidateTrackIndex() { track_index_ = kInvalidTrackIndex; rendered_track_index_ = kInvalidTrackIndex; } 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,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: void FakeCrosDisksClient::RemoveObserver(Observer* observer) { observer_list_.RemoveObserver(observer); } Commit Message: Add a fake DriveFS launcher client. Using DriveFS requires building and deploying ChromeOS. Add a client for the fake DriveFS launcher to allow the use of a real DriveFS from a ChromeOS ch...
0
124,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 int key_search(struct extent_buffer *b, struct btrfs_key *key, int level, int *prev_cmp, int *slot) { if (*prev_cmp != 0) { *prev_cmp = bin_search(b, key, level, slot); return *prev_cmp; } key_search_validate(b, key, level); *slot = 0; return 0; } Commit Message: Btrfs: make xattr repla...
0
45,337
Analyze the following 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 long realpath_cache_key(const char *path, int path_len TSRMLS_DC) /* {{{ */ { register unsigned long h; char *bucket_key_start = tsrm_win32_get_path_sid_key(path TSRMLS_CC); char *bucket_key = (char *)bucket_key_start; const char *e = bucket_key + strlen(bucket_key); if (!bucket_key) ...
0
9,658
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderFrameHostImpl::CopyImageAt(int x, int y) { gfx::PointF point_in_view = GetView()->TransformRootPointToViewCoordSpace(gfx::PointF(x, y)); Send(new FrameMsg_CopyImageAt(routing_id_, point_in_view.x(), point_in_view.y())); } Commit Message: Convert FrameHostMsg_D...
0
139,223
Analyze the following 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 nfs4_free_createdata(struct nfs4_createdata *data) { kfree(data); } Commit Message: Fix length of buffer copied in __nfs4_get_acl_uncached _copy_from_pages() used to copy data from the temporary buffer to the user passed buffer is passed the wrong size parameter when copying data. res.acl_len conta...
0
19,908
Analyze the following 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 enum test_return stop_memcached_server(void) { close(sock); assert(kill(server_pid, SIGTERM) == 0); return TEST_PASS; } Commit Message: Issue 102: Piping null to the server will crash it CWE ID: CWE-20
0
94,241
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _waiter_create(uint32_t jobid) { struct waiter *wp = xmalloc(sizeof(struct waiter)); wp->jobid = jobid; wp->thd = pthread_self(); return wp; } Commit Message: Fix security issue in _prolog_error(). Fix security issue caused by insecure file path handling triggered by the failure of a Prolog script. To e...
0
72,162
Analyze the following 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 LauncherView::ShouldHideTooltip(const gfx::Point& cursor_location) { gfx::Rect active_bounds; for (int i = 0; i < child_count(); ++i) { views::View* child = child_at(i); if (child == overflow_button_) continue; gfx::Rect child_bounds = child->GetMirroredBounds(); active_bounds = a...
0
106,258
Analyze the following 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 WebContentsImpl::DidGetRedirectForResourceRequest( const ResourceRedirectDetails& details) { for (auto& observer : observers_) observer.DidGetRedirectForResourceRequest(details); NotificationService::current()->Notify( NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, Source<WebContents>(this),...
0
135,669
Analyze the following 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 ssl_decompress_buf( ssl_context *ssl ) { int ret; unsigned char *msg_post = ssl->in_msg; size_t len_pre = ssl->in_msglen; unsigned char *msg_pre; SSL_DEBUG_MSG( 2, ( "=> decompress buf" ) ); msg_pre = (unsigned char*) malloc( len_pre ); if( msg_pre == NULL ) { ...
0
28,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: void RenderThreadImpl::RegisterSchemes() { WebString chrome_scheme(WebString::FromASCII(kChromeUIScheme)); WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_scheme); WebSecurityPolicy::RegisterURLSchemeAsNotAllowingJavascriptURLs( chrome_scheme); WebString devtools_scheme(WebString::From...
0
150,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 int hns_nic_ring_open(struct net_device *netdev, int idx) { struct hns_nic_priv *priv = netdev_priv(netdev); struct hnae_handle *h = priv->ae_handle; napi_enable(&priv->ring_data[idx].napi); enable_irq(priv->ring_data[idx].ring->irq); h->dev->ops->toggle_ring_irq(priv->ring_data[idx].ring, 0); ret...
0
85,709
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlURIEscape(const xmlChar * str) { xmlChar *ret, *segment = NULL; xmlURIPtr uri; int ret2; #define NULLCHK(p) if(!p) { \ xmlURIErrMemory("escaping URI value\n"); \ xmlFreeURI(uri); \ return NULL; } \ if (str == NULL) return (NULL); uri = xmlCreateURI(); if (uri != NULL) { /...
0
163,364
Analyze the following 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 migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, unsigned long address) { spinlock_t *ptl = pte_lockptr(mm, pmd); pte_t *ptep = pte_offset_map(pmd, address); __migration_entry_wait(mm, ptep, ptl); } Commit Message: mm: migrate dirty page without clear_page_dirty_for_io etc clear_page_dirty_for...
0
54,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: sfnt_find_encoding( int platform_id, int encoding_id ) { typedef struct TEncoding_ { int platform_id; int encoding_id; FT_Encoding encoding; } TEncoding; static const TEncoding tt_encodings[] = { { TT_PLATFORM_ISO, ...
0
7,526
Analyze the following 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 u64 __init get_ramdisk_size(void) { u64 ramdisk_size = boot_params.hdr.ramdisk_size; ramdisk_size |= (u64)boot_params.ext_ramdisk_size << 32; return ramdisk_size; } Commit Message: acpi: Disable ACPI table override if securelevel is set From the kernel documentation (initrd_table_override.txt): I...
0
53,791
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void __tcp_free_md5sig_pool(struct tcp_md5sig_pool * __percpu *pool) { int cpu; for_each_possible_cpu(cpu) { struct tcp_md5sig_pool *p = *per_cpu_ptr(pool, cpu); if (p) { if (p->md5_desc.tfm) crypto_free_hash(p->md5_desc.tfm); kfree(p); p = NULL; } } free_percpu(pool); } Commit Mess...
0
31,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: static int __register_pernet_operations(struct list_head *list, struct pernet_operations *ops) { struct net *net; int error; LIST_HEAD(net_exit_list); list_add_tail(&ops->list, list); if (ops->init || (ops->id && ops->size)) { /* We held write locked pernet_ops_rwsem, and parallel * setup_net() an...
0
91,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: static int lg_input_mapped(struct hid_device *hdev, struct hid_input *hi, struct hid_field *field, struct hid_usage *usage, unsigned long **bit, int *max) { struct lg_drv_data *drv_data = hid_get_drvdata(hdev); if ((drv_data->quirks & LG_BAD_RELATIVE_KEYS) && usage->type == EV_KEY && (field->flags & HID...
0
38,114
Analyze the following 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 jslFunctionCharAsString(unsigned char ch, char *str, size_t len) { if (ch >= LEX_TOKEN_START) { jslTokenAsString(ch, str, len); } else { str[0] = (char)ch; str[1] = 0; } } Commit Message: Fix strncat/cpy bounding issues (fix #1425) CWE ID: CWE-119
0
82,519
Analyze the following 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_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) { struct frame_tail __user *tail; if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { /* We don't support guest os callchain now */ return; } perf_callchain_store(entry, regs->ARM_pc); tail = (struct frame_tail __user *)re...
0
29,803
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void NavigationControllerImpl::PruneAllButVisible() { PruneAllButVisibleInternal(); DCHECK_NE(-1, last_committed_entry_index_); NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry(GetActiveEntry()); web_contents_->SetHistoryLengthAndPrune( entry->site_instance(), 0, entry->...
0
111,547
Analyze the following 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 SplashBitmap::getPixel(int x, int y, SplashColorPtr pixel) { SplashColorPtr p; if (y < 0 || y >= height || x < 0 || x >= width) { return; } switch (mode) { case splashModeMono1: p = &data[y * rowSize + (x >> 3)]; pixel[0] = (p[0] & (0x80 >> (x & 7))) ? 0xff : 0x00; break; case sp...
0
1,301
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track) { AC3HeaderInfo *hdr = NULL; struct eac3_info *info; int num_blocks, ret; if (!track->eac3_priv && !(track->eac3_priv = av_mallocz(sizeof(*info)))) return AVERROR(ENOMEM); info = track->eac3_priv; if (avpr...
1
169,162
Analyze the following 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 UINT dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId) { DVCMAN_CHANNEL* channel; UINT error = CHANNEL_RC_OK; DVCMAN* dvcman = (DVCMAN*) pChannelMgr; channel = (DVCMAN_CHANNEL*) dvcman_find_channel_by_id(pChannelMgr, ChannelId); if (!chann...
0
74,972
Analyze the following 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 futex_requeue(u32 __user *uaddr1, unsigned int flags, u32 __user *uaddr2, int nr_wake, int nr_requeue, u32 *cmpval, int requeue_pi) { union futex_key key1 = FUTEX_KEY_INIT, key2 = FUTEX_KEY_INIT; int drop_count = 0, task_count = 0, ret; struct futex_pi_state *pi_state = NULL; struct futex_h...
1
169,331
Analyze the following 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 adev_dump(const audio_hw_device_t *device, int fd) { (void)device; (void)fd; return 0; } Commit Message: Fix audio record pre-processing proc_buf_out consistently initialized. intermediate scratch buffers consistently initialized. prevent read failure from overwriting memory. Test: POC, CTS, cam...
0
162,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: static bool setup_stratum_socket(struct pool *pool) { struct addrinfo servinfobase, *servinfo, *hints, *p; char *sockaddr_url, *sockaddr_port; int sockd; int ret; mutex_lock(&pool->stratum_lock); pool->stratum_active = false; if (pool->sock) { /* FIXME: change to LOG_DEBUG if issue #88 resolved */ app...
0
36,621
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HeadlessDevToolsManagerDelegate::CloseTarget( content::DevToolsAgentHost* agent_host, int session_id, int command_id, const base::DictionaryValue* params) { const base::Value* target_id_value = params->FindKey("targetId"); if (!target_id_value) return CreateInvalidParamResponse(command_id,...
0
149,809
Analyze the following 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 VideoCaptureManager::OnDeviceLaunchAborted() { EmitLogMessage("Launching device has been aborted.", 1); device_start_request_queue_.pop_front(); ProcessDeviceStartRequestQueue(); } Commit Message: Make MediaStreamDispatcherHost per-request instead of per-frame. Instead of having RenderFrameHost own a...
0
153,248
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void TopSitesCache::StoreRedirectChain(const RedirectList& redirects, size_t destination) { for (size_t i = 0; i < redirects.size(); i++) { if (!IsKnownURL(redirects[i])) { CanonicalURLEntry entry; entry.first = &(top_sites_[destination]); entry.seco...
0
147,045
Analyze the following 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 GLES2DecoderPassthroughImpl::UpdateTextureSizeFromTarget(GLenum target) { GLenum texture_type = TextureTargetToTextureType(target); TextureTarget internal_texture_type = GLenumToTextureTarget(texture_type); DCHECK(internal_texture_type != TextureTarget::kUnkown); BoundTexture& bound_texture = b...
0
141,844
Analyze the following 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 ChromeContentBrowserClient::GetEffectiveURL( content::BrowserContext* browser_context, const GURL& url) { Profile* profile = Profile::FromBrowserContext(browser_context); if (!profile) return url; #if !defined(OS_ANDROID) if (search::ShouldAssignURLToInstantRenderer(url, profile)) retu...
0
142,648
Analyze the following 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 TestingAutomationProvider::ConnectToWifiNetwork( DictionaryValue* args, IPC::Message* reply_message) { AutomationJSONReply reply(this, reply_message); std::string service_path, password; bool shared; if (!args->GetString("service_path", &service_path) || !args->GetString("password", &passwo...
0
109,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: void ExecuteBrowserCommandObserver::Observe( int type, const content::NotificationSource& source, const content::NotificationDetails& details) { if (type == notification_type_) { if (automation_) { if (use_json_interface_) { AutomationJSONReply(automation_, ...
0
117,570
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int lua_ap_escape_logitem(lua_State *L) { char *returnValue; request_rec *r; const char *str; luaL_checktype(L, 1, LUA_TUSERDATA); r = ap_lua_check_request_rec(L, 1); luaL_checktype(L, 2, LUA_TSTRING); str = lua_tostring(L, 2); returnValue = ap_escape_logite...
0
45,057
Analyze the following 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 BrowserTabStripController::GetActiveIndex() const { return model_->active_index(); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trun...
0
118,488
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: write_config_variable(const param_info_t* value, void* file_desc) { int config_fd = *((int*) file_desc); char* actual_value = param(value->name); if(strcmp(actual_value, value->str_val) != 0) { char output[512]; snprintf(output, 512, "# %s: Default value = (%s)\n", value->name, value->str_val); if(write...
0
16,532
Analyze the following 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 HB_Error Get_Anchor( GPOS_Instance* gpi, HB_Anchor* an, HB_UShort glyph_index, HB_Fixed* x_value, HB_Fixed* y_value ) { HB_Error error = HB_Err_Ok; #ifdef HB_SUPPORT_MULTIPLE_MASTER HB_GPOSHeader* gpos = gpi->gpos; #endif HB_UShort ...
0
13,553
Analyze the following 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 clear_all_pkt_pointers(struct bpf_verifier_env *env) { struct bpf_verifier_state *vstate = env->cur_state; int i; for (i = 0; i <= vstate->curframe; i++) __clear_all_pkt_pointers(env, vstate->frame[i]); } Commit Message: bpf: 32-bit RSH verification must truncate input before the ALU op When I...
0
76,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: void license_print_product_info(PRODUCT_INFO* productInfo) { char* CompanyName = NULL; char* ProductId = NULL; ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) productInfo->pbCompanyName, productInfo->cbCompanyName / 2, &CompanyName, 0, NULL, NULL); ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) productInfo->pbProductId...
0
39,560
Analyze the following 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 dump_data_string(FILE *trace, char *data, u32 dataLength) { u32 i; for (i=0; i<dataLength; i++) { switch ((unsigned char) data[i]) { case '\'': fprintf(trace, "&apos;"); break; case '\"': fprintf(trace, "&quot;"); break; case '&': fprintf(trace, "&amp;"); break; case '>':...
0
80,719
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline bool segmentIsEmpty(const InlineIterator& segmentStart, const InlineIterator& segmentEnd) { return segmentStart == segmentEnd; } Commit Message: Update containtingIsolate to go back all the way to top isolate from current root, rather than stopping at the first isolate it finds. This works beca...
0
111,397
Analyze the following 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 SVGElement::RemoveInstanceMapping(SVGElement* instance) { DCHECK(instance); DCHECK(instance->InUseShadowTree()); if (!HasSVGRareData()) return; HeapHashSet<WeakMember<SVGElement>>& instances = SvgRareData()->ElementInstances(); instances.erase(instance); } Commit Message: Fix SVG cras...
0
152,787
Analyze the following 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 WebMediaPlayerImpl::FinishMemoryUsageReport(int64_t demuxer_memory_usage) { DCHECK(main_task_runner_->BelongsToCurrentThread()); const PipelineStatistics stats = GetPipelineStatistics(); const int64_t data_source_memory_usage = data_source_ ? data_source_->GetMemoryUsage() : 0; const int64_t ...
0
144,394
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlAttrPtr get_attribute_ex(xmlAttrPtr node, char *name, char *ns) { while (node!=NULL) { if (attr_is_equal_ex(node, name, ns)) { return node; } node = node->next; } return NULL; } Commit Message: CWE ID: CWE-200
0
3,854
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Pack<WebGLImageConversion::kDataFormatRA32F, WebGLImageConversion::kAlphaDoUnmultiply, float, float>(const float* source, float* destination, unsigned pixels_per_row) { for (unsigned i = 0; i < pixels_per_row; ++i) { float scale_factor = s...
0
146,693
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static __inline__ void rt6_release(struct rt6_info *rt) { if (atomic_dec_and_test(&rt->rt6i_ref)) dst_free(&rt->dst); } Commit Message: net: fib: fib6_add: fix potential NULL pointer dereference When the kernel is compiled with CONFIG_IPV6_SUBTREES, and we return with an error in fn = fib6_add_1(), then erro...
0
28,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: scoped_refptr<HttpNetworkSession> SetupSessionForGroupNameTests( NextProto next_proto, SpdySessionDependencies* session_deps_) { scoped_refptr<HttpNetworkSession> session(CreateSession(session_deps_)); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(...
0
129,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: Factory(const std::string& name, const std::vector<Sample>* custom_ranges, int32_t flags) : Histogram::Factory(name, CUSTOM_HISTOGRAM, 0, 0, 0, flags) { custom_ranges_ = custom_ranges; } Commit Message: Convert DCHECKs to CHECKs for histogram types When a histogram is looked up b...
0
140,025
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pidfile_write(const char *pid_file, int pid) { FILE *pidfile = NULL; int pidfd = creat(pid_file, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (pidfd != -1) pidfile = fdopen(pidfd, "w"); if (!pidfile) { log_message(LOG_INFO, "pidfile_write : Cannot open %s pidfile", pid_file); return 0; } ...
1
168,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: static enum TIFFReadDirEntryErr TIFFReadDirEntryByte(TIFF* tif, TIFFDirEntry* direntry, uint8* value) { enum TIFFReadDirEntryErr err; if (direntry->tdir_count!=1) return(TIFFReadDirEntryErrCount); switch (direntry->tdir_type) { case TIFF_BYTE: TIFFReadDirEntryCheckedByte(tif,direntry,value); return(...
0
70,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: void HTMLFormElement::Disassociate(ListedElement& e) { listed_elements_are_dirty_ = true; listed_elements_.clear(); RemoveFromPastNamesMap(ToHTMLElement(e)); } Commit Message: Move user activation check to RemoteFrame::Navigate's callers. Currently RemoteFrame::Navigate is the user of Frame::HasTransientU...
0
152,214
Analyze the following 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 AutocompleteInput ZeroSuggestProvider::GetInput(bool is_keyword) const { return AutocompleteInput(base::string16(), base::string16::npos, std::string(), GURL(current_query_), current_title_, current_page_classification_, true, false, false, ...
0
128,682
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ofputil_decode_tlv_table_mod(const struct ofp_header *oh, struct ofputil_tlv_table_mod *ttm) { struct ofpbuf msg = ofpbuf_const_initializer(oh, ntohs(oh->length)); ofpraw_pull_assert(&msg); struct nx_tlv_table_mod *nx_ttm = ofpbuf_pull(&msg, sizeof *nx_ttm); ttm->c...
0
77,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: static int bt_get(struct blk_mq_alloc_data *data, struct blk_mq_bitmap_tags *bt, struct blk_mq_hw_ctx *hctx, unsigned int *last_tag, struct blk_mq_tags *tags) { struct bt_wait_state *bs; DEFINE_WAIT(wait); int tag; tag = __bt_get(hctx, bt, last_tag, tags); if (tag != -1) return tag; if (!(data->gf...
0
86,657
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void task_numa_free(struct task_struct *p) { struct numa_group *grp = p->numa_group; void *numa_faults = p->numa_faults; unsigned long flags; int i; if (grp) { spin_lock_irqsave(&grp->lock, flags); for (i = 0; i < NR_NUMA_HINT_FAULT_STATS * nr_node_ids; i++) grp->faults[i] -= p->numa_faults[i]; grp...
0
92,713
Analyze the following 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 stringAttrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); imp->setStringAttrWithGetterExcepti...
0
122,001
Analyze the following 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 StreamPredictor::getChars(int nChars, Guchar *buffer) { int n, m; n = 0; while (n < nChars) { if (predIdx >= rowBytes) { if (!getNextLine()) { break; } } m = rowBytes - predIdx; if (m > nChars - n) { m = nChars - n; } memcpy(buffer + n, predLine + predIdx, m);...
0
3,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: void SavePackage::OnPathPicked( const FilePath& final_name, SavePageType type, const SavePackageDownloadCreatedCallback& download_created_callback) { saved_main_file_path_ = final_name; net::GenerateSafeFileName(web_contents()->GetContentsMimeType(), false, &saved_main_...
0
115,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: sctp_disposition_t sctp_sf_ootb(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { struct sctp_chunk *chunk = arg; struct sk_buff *skb = chunk->skb; sctp_chunkhdr_t *ch; sctp_errhdr_t *err;...
0
31,625
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: alt_merge_opt_map(OnigEncoding enc, OptMap* to, OptMap* add) { int i, val; /* if (! is_equal_mml(&to->mmd, &add->mmd)) return ; */ if (to->value == 0) return ; if (add->value == 0 || to->mmd.max < add->mmd.min) { clear_opt_map(to); return ; } alt_merge_mml(&to->mmd, &add->mmd); val = 0; ...
0
89,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: GBool DCTStream::readMCURow() { int data1[64]; Guchar data2[64]; Guchar *p1, *p2; int pY, pCb, pCr, pR, pG, pB; int h, v, horiz, vert, hSub, vSub; int x1, x2, y2, x3, y3, x4, y4, x5, y5, cc, i; int c; for (x1 = 0; x1 < width; x1 += mcuWidth) { if (restartInterval > 0 && restartCtr == 0) { ...
0
4,020
Analyze the following 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 ConversionContext::SwitchToEffect( const EffectPaintPropertyNode* target_effect) { if (target_effect == current_effect_) return; const EffectPaintPropertyNode* lca_effect = &LowestCommonAncestor(*target_effect, *current_effect_); while (current_effect_ != lca_effect) { EndClips(); #i...
0
125,590
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static ssize_t tcm_loop_tpg_store_nexus( struct se_portal_group *se_tpg, const char *page, size_t count) { struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, tl_se_tpg); struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; unsigned char i_port[TL_WWN_ADDR_LEN], *ptr, *port_ptr; int ret; /...
0
94,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: int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags) { BIO *cmsbio; int ret = 0; if ((cmsbio = CMS_dataInit(cms, dcont)) == NULL) { CMSerr(CMS_F_CMS_FINAL, CMS_R_CMS_LIB); return 0; } SMIME_crlf_copy(data, cmsbio, flags); (void)BIO_flush(cmsbio)...
0
11,940
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: jas_stream_t *jas_stream_memopen(char *buf, int bufsize) { jas_stream_t *stream; jas_stream_memobj_t *obj; if (!(stream = jas_stream_create())) { return 0; } /* A stream associated with a memory buffer is always opened for both reading and writing in binary mode. */ stream->openmode_ = JAS_STREAM_READ ...
0
73,205
Analyze the following 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 DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) { dh->p = p; dh->q = q; dh->g = g; return 1; } Commit Message: CWE ID: CWE-754
0
4,476
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Ins_GETINFO( INS_ARG ) { FT_Long K; K = 0; /* We return MS rasterizer version 1.7 for the font scaler. */ if ( ( args[0] & 1 ) != 0 ) K = 35; /* Has the glyph been rotated? */ if ( ( args[0] & 2 ) != 0 && CUR.tt_metrics.rotated ) K |= 0x80; /* Has the glyph been s...
0
10,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: static void gen_helper_in_func(TCGMemOp ot, TCGv v, TCGv_i32 n) { switch (ot) { case MO_8: gen_helper_inb(v, cpu_env, n); break; case MO_16: gen_helper_inw(v, cpu_env, n); break; case MO_32: gen_helper_inl(v, cpu_env, n); break; default: ...
0
66,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 ServiceWorkerContextCore::DeleteAndStartOver(StatusCallback callback) { job_coordinator_->AbortAll(); storage_->DeleteAndStartOver(std::move(callback)); } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUn...
0
139,447
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GLSurfaceEGLOzoneX11::~GLSurfaceEGLOzoneX11() { Destroy(); } Commit Message: Add ThreadChecker for Ozone X11 GPU. Ensure Ozone X11 tests the same thread constraints we have in Ozone GBM. BUG=none Review-Url: https://codereview.chromium.org/2366643002 Cr-Commit-Position: refs/heads/master@{#421817} CWE ID: C...
0
119,366
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pdf_grestore(fz_context *ctx, pdf_run_processor *pr) { pdf_gstate *gs = pr->gstate + pr->gtop; int clip_depth = gs->clip_depth; if (pr->gtop <= pr->gbot) { fz_warn(ctx, "gstate underflow in content stream"); return; } pdf_drop_gstate(ctx, gs); pr->gtop --; gs = pr->gstate + pr->gtop; while (clip_d...
0
464
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Browser::UpdatePreferredSize(WebContents* source, const gfx::Size& pref_size) { window_->UpdatePreferredSize(source, pref_size); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromi...
0
117,840
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DGAGetViewportStatus(int index) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); /* We rely on the extension to check that DGA is active */ if (!pScreenPriv->funcs->GetViewport) return 0; return (*pScreenPriv->funcs->GetViewport) (pScreenPriv->pScrn); } Comm...
0
17,709
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: read_ttr(usec *ttr, const char *buf, char **end) { return read_delay(ttr, buf, end); } Commit Message: Discard job body bytes if the job is too big. Previously, a malicious user could craft a job payload and inject beanstalk commands without the client application knowing. (An extra-careful client library c...
0
18,165
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: poppler_rectangle_new (void) { return g_new0 (PopplerRectangle, 1); } Commit Message: CWE ID: CWE-189
0
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: void ewk_frame_redirect_requested(Evas_Object* ewkFrame, const char* url) { evas_object_smart_callback_call(ewkFrame, "redirect,requested", (void*)url); } Commit Message: [EFL] fast/frames/frame-crash-with-page-cache.html is crashing https://bugs.webkit.org/show_bug.cgi?id=85879 Patch by Mikhail Pozdnyakov ...
0
107,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: T42_Size_Done( FT_Size t42size ) /* T42_Size */ { T42_Size size = (T42_Size)t42size; FT_Face face = t42size->face; T42_Face t42face = (T42_Face)face; FT_ListNode node; node = FT_List_Find( &t42face->ttf_face->sizes_list, size->ttsize ); if ( node ) ...
0
7,125
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DevToolsWindow::DevToolsWindow(Profile* profile, WebContents* main_web_contents, DevToolsUIBindings* bindings, WebContents* inspected_web_contents, bool can_dock) : profile_(profile), ...
0
138,385
Analyze the following 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 UnsignedLongLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); V8SetReturnValue(info, static_cast<double>(impl->unsignedLongLongAttribute())); } Commit Message: bindings...
0
135,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: void H264DPB::GetNotOutputtedPicsAppending(H264Picture::PtrVector& out) { for (size_t i = 0; i < pics_.size(); ++i) { H264Picture* pic = pics_[i]; if (!pic->outputted) out.push_back(pic); } } Commit Message: Revert 137988 - VAVDA is the hardware video decode accelerator for Chrome on Linux and ...
0
103,003
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: header_put_le_8byte (SF_PRIVATE *psf, sf_count_t x) { if (psf->headindex < SIGNED_SIZEOF (psf->header) - 8) { psf->header [psf->headindex++] = x ; psf->header [psf->headindex++] = (x >> 8) ; psf->header [psf->headindex++] = (x >> 16) ; psf->header [psf->headindex++] = (x >> 24) ; psf->header [psf->headin...
1
170,055
Analyze the following 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 __local_bh_enable(unsigned int cnt) { lockdep_assert_irqs_disabled(); if (softirq_count() == (cnt & SOFTIRQ_MASK)) trace_softirqs_on(_RET_IP_); preempt_count_sub(cnt); } Commit Message: Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull ...
1
169,184
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int expand_downwards(struct vm_area_struct *vma, unsigned long address) { struct mm_struct *mm = vma->vm_mm; struct vm_area_struct *prev; int error; address &= PAGE_MASK; error = security_mmap_addr(address); if (error) return error; /* Enforce stack_guard_gap */ prev = vma->vm_prev; /*...
1
169,722
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PPB_URLLoader_Impl::PPB_URLLoader_Impl(PluginInstance* instance, bool main_document_loader) : Resource(instance), main_document_loader_(main_document_loader), pending_callback_(), bytes_sent_(0), total_bytes_to_be_sent_(-1), bytes_received_(...
0
100,016
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int64_t coroutine_fn iscsi_co_get_block_status(BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum, BlockDriverState **file) { IscsiLun *...
0
10,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 hls_cross_component_pred(HEVCContext *s, int idx) { HEVCLocalContext *lc = s->HEVClc; int log2_res_scale_abs_plus1 = ff_hevc_log2_res_scale_abs(s, idx); if (log2_res_scale_abs_plus1 != 0) { int res_scale_sign_flag = ff_hevc_res_scale_sign_flag(s, idx); lc->tu.res_scale_...
0
90,769
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: walk_string(fz_context *ctx, int uni, int remove, editable_str *str) { int rune; if (str->utf8 == NULL) return; do { char *s = &str->utf8[str->pos]; size_t len; int n = fz_chartorune(&rune, s); if (rune == uni) { /* Match. Skip over that one. */ str->po...
1
164,660
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void setup_msrs(struct vcpu_vmx *vmx) { int save_nmsrs, index; save_nmsrs = 0; #ifdef CONFIG_X86_64 if (is_long_mode(&vmx->vcpu)) { index = __find_msr_index(vmx, MSR_SYSCALL_MASK); if (index >= 0) move_msr_up(vmx, index, save_nmsrs++); index = __find_msr_index(vmx, MSR_LSTAR); if (index >= 0...
0
37,175
Analyze the following 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 ChromeGeolocationPermissionContext::RequestGeolocationPermission( int render_process_id, int render_view_id, int bridge_id, const GURL& requesting_frame, base::Callback<void(bool)> callback) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { BrowserThread::PostTask( BrowserThread::...
0
119,053