instruction
stringclasses
1 value
input
stringlengths
64
129k
output
int64
0
1
__index_level_0__
int64
0
30k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) { var_entries *var_hash = (*var_hashx)->last_dtor; #if VAR_ENTRIES_DBG fprintf(stderr, "var_push_dtor(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval)); #endif if (!var_hash || var_hash->used_slots == VAR_ENTRIES_MAX) { ...
0
8,923
Analyze the following 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 AddDataReductionProxyBinding( content::ResourceContext* resource_context, data_reduction_proxy::mojom::DataReductionProxyRequest request) { DCHECK_CURRENTLY_ON(BrowserThread::IO); auto* io_data = ProfileIOData::FromResourceContext(resource_context); if (io_data && io_data->data_reduction_proxy_...
0
1,993
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool RenderFrameImpl::HandleCurrentKeyboardEvent() { bool did_execute_command = false; for (auto command : GetRenderWidget()->edit_commands()) { if (!frame_->ExecuteCommand(blink::WebString::FromUTF8(command.name), blink::WebString::FromUTF8(command.value))) break; ...
0
25,504
Analyze the following 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 FolderHeaderView::Update() { if (!folder_item_) return; folder_name_view_->SetVisible(folder_name_visible_); if (folder_name_visible_) folder_name_view_->SetText(base::UTF8ToUTF16(folder_item_->name())); Layout(); } Commit Message: Enforce the maximum length of the folder name in UI...
1
3,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: void bta_av_api_disconnect(tBTA_AV_DATA* p_data) { AVDT_DisconnectReq(p_data->api_discnt.bd_addr, bta_av_conn_cback); alarm_cancel(bta_av_cb.link_signalling_timer); } Commit Message: Check packet length in bta_av_proc_meta_cmd Bug: 111893951 Test: manual - connect A2DP Change-Id: Ibbf347863dfd29ea3385312e9d...
0
29,297
Analyze the following 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 AtomicString& Element::webkitRegionOverset() const { document()->updateLayoutIgnorePendingStylesheets(); DEFINE_STATIC_LOCAL(AtomicString, undefinedState, ("undefined", AtomicString::ConstructFromLiteral)); if (!RuntimeEnabledFeatures::cssRegionsEnabled() || !renderRegion()) return unde...
0
14,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: ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { renderer_client_.reset(switches::IsRunWebTestsSwitchPresent() ? new LayoutTestContentRendererClient : new ShellContentRendererClient); return renderer_client_.get(); } Commit ...
0
25,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 int move_to_new_page(struct page *newpage, struct page *page, enum migrate_mode mode) { struct address_space *mapping; int rc = -EAGAIN; bool is_lru = !__PageMovable(page); VM_BUG_ON_PAGE(!PageLocked(page), page); VM_BUG_ON_PAGE(!PageLocked(newpage), newpage); mapping = page_mapping(page); if...
0
3,808
Analyze the following 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 status_t getPropertyByteArray(String8 const &name, Vector<uint8_t> &value) const { Parcel data, reply; data.writeInterfaceToken(IDrm::getInterfaceDescriptor()); data.writeString8(name); status_t status = remote()->transact(GET_PROPERTY_BYTE_ARRAY, data, &reply); if (status != OK) { r...
0
9,041
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: QPointF QQuickWebViewFlickablePrivate::pageItemPos() { qreal xPos = flickProvider->contentItem()->x() + pageView->x(); qreal yPos = flickProvider->contentItem()->y() + pageView->y(); return QPointF(xPos, yPos); } Commit Message: [Qt][WK2] Allow transparent WebViews https://bugs.webkit.org/show_bug.cg...
0
19,808
Analyze the following 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 pdf_run_F(fz_context *ctx, pdf_processor *proc) { pdf_run_processor *pr = (pdf_run_processor *)proc; pdf_show_path(ctx, pr, 0, 1, 0, 0); } Commit Message: CWE ID: CWE-416
0
9,235
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: media::CdmFactory* RenderFrameImpl::GetCdmFactory() { #if defined(ENABLE_BROWSER_CDMS) if (!cdm_manager_) cdm_manager_ = new RendererCdmManager(this); #endif // defined(ENABLE_BROWSER_CDMS) if (!cdm_factory_) { DCHECK(frame_); #if defined(ENABLE_MOJO_MEDIA) cdm_factory_.reset(new media::MojoCdm...
0
23,584
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: status_t ATSParser::parsePID( ABitReader *br, unsigned PID, unsigned continuity_counter, unsigned payload_unit_start_indicator, SyncEvent *event) { ssize_t sectionIndex = mPSISections.indexOfKey(PID); if (sectionIndex >= 0) { sp<PSISection> section = mPSISections.valueAt(sectionIndex); if (payloa...
0
19,528
Analyze the following 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 ArthurOutputDev::eoFill(GfxState *state) { m_painter->fillPath( convertPath( state, state->getPath(), Qt::OddEvenFill ), m_currentBrush ); } Commit Message: CWE ID: CWE-189
0
15,202
Analyze the following 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 AppCacheUpdateJob::BuildUrlFileList(const AppCacheManifest& manifest) { for (base::hash_set<std::string>::const_iterator it = manifest.explicit_urls.begin(); it != manifest.explicit_urls.end(); ++it) { AddUrlToFileList(GURL(*it), AppCacheEntry::EXPLICIT); } const std::vector<AppC...
0
9,029
Analyze the following 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 GfxDeviceCMYKColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) { double c, m, y, k, c1, m1, y1, k1, r, g, b, x; c = colToDbl(color->c[0]); m = colToDbl(color->c[1]); y = colToDbl(color->c[2]); k = colToDbl(color->c[3]); c1 = 1 - c; m1 = 1 - m; y1 = 1 - y; k1 = 1 - k; x = c1 * m1 * y1 ...
0
17,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: static float CL_DemoFrameDurationSDev( void ) { int i; int numFrames; float mean = 0.0f; float variance = 0.0f; if( ( clc.timeDemoFrames - 1 ) > MAX_TIMEDEMO_DURATIONS ) numFrames = MAX_TIMEDEMO_DURATIONS; else numFrames = clc.timeDemoFrames - 1; for( i = 0; i < numFrames; i++ ) mean += clc.timeDem...
0
16,007
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int do_getname(const char __user *filename, char *page) { int retval; unsigned long len = PATH_MAX; if (!segment_eq(get_fs(), KERNEL_DS)) { if ((unsigned long) filename >= TASK_SIZE) return -EFAULT; if (TASK_SIZE - (unsigned long) filename < PATH_MAX) len = TASK_SIZE - (unsigned long) filenam...
0
20,591
Analyze the following 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 WebRTCAudioDeviceTest::GetTestDataPath( const FilePath::StringType& file_name) { FilePath path; EXPECT_TRUE(PathService::Get(content::DIR_TEST_DATA, &path)); path = path.Append(file_name); EXPECT_TRUE(file_util::PathExists(path)); #ifdef OS_WIN return WideToUTF8(path.value()); #else re...
0
15,546
Analyze the following 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 AXNodeObject::stepValueForRange() const { if (!isNativeSlider()) return 0.0; Decimal step = toHTMLInputElement(*getNode()).createStepRange(RejectAny).step(); return step.toString().toFloat(); } Commit Message: Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 R...
0
19,072
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int validate_camera_metadata_structure(const camera_metadata_t *metadata, const size_t *expected_size) { if (metadata == NULL) { ALOGE("%s: metadata is null!", __FUNCTION__); return ERROR; } { static const struct { const char *name; size_t alignment; } alignments[] = { { .name = "camera_metad...
1
6,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: mm_sshpam_query(void *ctx, char **name, char **info, u_int *num, char ***prompts, u_int **echo_on) { Buffer m; u_int i; int ret; debug3("%s", __func__); buffer_init(&m); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_QUERY, &m); debug3("%s: waiting for MONITOR_ANS_PAM_QUERY", __func__); mm_reque...
0
15,017
Analyze the following 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 set_bootcount_addr(void) { uchar buf[32]; unsigned int bootcountaddr; bootcountaddr = gd->ram_size - BOOTCOUNT_ADDR; sprintf((char *)buf, "0x%x", bootcountaddr); env_set("bootcountaddr", (char *)buf); } Commit Message: Merge branch '2020-01-22-master-imports' - Re-add U8500 platform support - A...
0
27,934
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: M_fs_error_t M_fs_path_readlink_int(char **out, const char *path, M_bool last, M_fs_path_norm_t flags, M_fs_system_t sys_type) { (void)path; (void)last; (void)flags; (void)sys_type; *out = NULL; return M_FS_ERROR_SUCCESS; } Commit Message: fs: Don't try to delete the file when copying. It could cause a sec...
0
10,024
Analyze the following 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 WebPluginDelegateProxy::OnAcceleratedSurfaceBuffersSwapped( gfx::PluginWindowHandle window, uint64 surface_handle) { if (render_view_) render_view_->AcceleratedSurfaceBuffersSwapped(window, surface_handle); } Commit Message: Convert plugin and GPU process to brokered handle duplication. BUG=11925...
0
10,370
Analyze the following 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 tsc210x_set_transform(uWireSlave *chip, MouseTransformInfo *info) { TSC210xState *s = (TSC210xState *) chip->opaque; #if 0 int64_t ltr[8]; ltr[0] = (int64_t) info->a[1] * info->y; ltr[1] = (int64_t) info->a[4] * info->x; ltr[2] = (int64_t) info->a[1] * info->a[3] - ...
0
4,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 cvarinit(JF, js_Ast *list) { while (list) { js_Ast *var = list->a; if (var->b) { cexp(J, F, var->b); emitlocal(J, F, OP_SETLOCAL, OP_SETVAR, var->a); emit(J, F, OP_POP); } list = list->b; } } Commit Message: CWE ID: CWE-476
0
9,941
Analyze the following 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 __fuse_put_request(struct fuse_req *req) { BUG_ON(atomic_read(&req->count) < 2); atomic_dec(&req->count); } Commit Message: fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message FUSE_NOTIFY_INVAL_ENTRY didn't check the length of the write so the message processing could overrun and result in a "kern...
0
20,781
Analyze the following 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 CommandBufferProxyImpl::SetGetBuffer(int32 shm_id) { if (last_state_.error != gpu::error::kNoError) return; Send(new GpuCommandBufferMsg_SetGetBuffer(route_id_, shm_id)); last_put_offset_ = -1; } Commit Message: Convert plugin and GPU process to brokered handle duplication. BUG=119250 Review URL...
0
13,981
Analyze the following 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 char *js_ref(js_State *J) { js_Value *v = stackidx(J, -1); const char *s; char buf[32]; switch (v->type) { case JS_TUNDEFINED: s = "_Undefined"; break; case JS_TNULL: s = "_Null"; break; case JS_TBOOLEAN: s = v->u.boolean ? "_True" : "_False"; break; case JS_TOBJECT: sprintf(buf, "%p", (void*)...
0
8,906
Analyze the following 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 DOMWindow::close(LocalDOMWindow* incumbent_window) { if (!GetFrame() || !GetFrame()->IsMainFrame()) return; Page* page = GetFrame()->GetPage(); if (!page) return; Document* active_document = nullptr; if (incumbent_window) { DCHECK(IsMainThread()); active_document = incumbent_windo...
0
15,650
Analyze the following 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 GpuVideoDecodeAccelerator::NotifyError( media::VideoDecodeAccelerator::Error error) { if (init_done_msg_) { init_done_msg_->set_reply_error(); if (!Send(init_done_msg_)) DLOG(ERROR) << "Send(init_done_msg_) failed"; init_done_msg_ = NULL; } if (!Send(new AcceleratedVideoDecoderHos...
0
3,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: void WebResourceService::EndFetch() { in_fetch_ = false; } Commit Message: Add data usage tracking for chrome services Add data usage tracking for captive portal, web resource and signin services BUG=655749 Review-Url: https://codereview.chromium.org/2643013004 Cr-Commit-Position: refs/heads/master@{#445810...
0
9,833
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PluginService* PluginService::GetInstance() { return PluginServiceImpl::GetInstance(); } Commit Message: Follow-on fixes and naming changes for https://codereview.chromium.org/12086077/ BUG=172573 Review URL: https://codereview.chromium.org/12177018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180600 ...
0
19,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: static MagickBooleanType GetOneAuthenticPixelFromCache(Image *image, const ssize_t x,const ssize_t y,PixelPacket *pixel,ExceptionInfo *exception) { CacheInfo *restrict cache_info; const int id = GetOpenMPThreadId(); PixelPacket *restrict pixels; assert(image != (const Image *) NULL); as...
0
17,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: get_command_line_for_pid (pid_t pid) { char proc_name[32]; char *buf; gsize len; char *ret; unsigned int n; ret = NULL; snprintf (proc_name, sizeof(proc_name), "/proc/%d/cmdline", pid); if (g_file_get_contents (proc_name, &buf, &len, NULL)) { for (n = 0; n < len; n++) { ...
0
17,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: static int apparmor_path_mknod(struct path *dir, struct dentry *dentry, int mode, unsigned int dev) { return common_perm_create(OP_MKNOD, dir, dentry, AA_MAY_CREATE, mode); } Commit Message: AppArmor: fix oops in apparmor_setprocattr When invalid parameters are passed to apparmor_setprocattr a NULL d...
0
14,127
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline struct l2tp_ip6_sock *l2tp_ip6_sk(const struct sock *sk) { return (struct l2tp_ip6_sock *)sk; } Commit Message: l2tp: fix info leak in l2tp_ip6_recvmsg() The L2TP code for IPv6 fails to initialize the l2tp_conn_id member of struct sockaddr_l2tpip6 and therefore leaks four bytes kernel stack in l2...
0
17,046
Analyze the following 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::FrameDidStopLoading(WebFrame* frame) { if (frames_in_progress_ == 0) return; frames_in_progress_--; if (frames_in_progress_ == 0) { for (auto& observer : observers_) observer.DidStopLoading(); } } Commit Message: Prevent renderer initiated back navigation to cancel a br...
0
17,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 RenderWidgetHostViewAura::OnWindowDestroying(aura::Window* window) { #if defined(OS_WIN) if (legacy_render_widget_host_HWND_) { legacy_render_widget_host_HWND_->set_host(NULL); legacy_render_widget_host_HWND_->Destroy(); legacy_render_widget_host_HWND_ = NULL; } #endif DetachFromInputMetho...
0
8,504
Analyze the following 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 Frame* CreateWindowHelper(LocalFrame& opener_frame, LocalFrame& active_frame, LocalFrame& lookup_frame, const FrameLoadRequest& request, const WebWindowFeatures& features, ...
0
2,548
Analyze the following 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 zend_shared_alloc_shutdown(void) { zend_shared_segment **tmp_shared_segments; size_t shared_segments_array_size; zend_smm_shared_globals tmp_shared_globals; int i; tmp_shared_globals = *smm_shared_globals; smm_shared_globals = &tmp_shared_globals; shared_segments_array_size = ZSMMG(shared_segments_co...
0
5,253
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LocalFileSystem::~LocalFileSystem() { } Commit Message: Oilpan: Ship Oilpan for SyncCallbackHelper, CreateFileResult and CallbackWrapper in filesystem/ These are leftovers when we shipped Oilpan for filesystem/ once. BUG=340522 Review URL: https://codereview.chromium.org/501263003 git-svn-id: svn://svn.chrom...
0
2,204
Analyze the following 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 AutocompleteResult& AutocompleteEditModel::result() const { return autocomplete_controller_->result(); } Commit Message: Adds per-provider information to omnibox UMA logs. Adds a fairly general structure to omnibox logs that can be used to pass information (that's not per-result information) from provid...
0
2,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: OMX_ERRORTYPE SoftAMRNBEncoder::internalGetParameter( OMX_INDEXTYPE index, OMX_PTR params) { switch (index) { case OMX_IndexParamAudioPortFormat: { OMX_AUDIO_PARAM_PORTFORMATTYPE *formatParams = (OMX_AUDIO_PARAM_PORTFORMATTYPE *)params; if (formatParams->nP...
1
19,395
Analyze the following 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 read_super(char *source) { squashfs_super_block_3 sBlk_3; struct squashfs_super_block sBlk_4; /* * Try to read a Squashfs 4 superblock */ read_fs_bytes(fd, SQUASHFS_START, sizeof(struct squashfs_super_block), &sBlk_4); swap = sBlk_4.s_magic != SQUASHFS_MAGIC; SQUASHFS_INSWAP_SUPER_BLOCK(&sBlk_4);...
0
25,714
Analyze the following 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 RenderFrameImpl::SetMediaStreamClientForTesting( MediaStreamClient* media_stream_client) { DCHECK(!media_stream_client_); DCHECK(!web_user_media_client_); media_stream_client_ = media_stream_client; } Commit Message: Add logging to figure out which IPC we're failing to deserialize in RenderFrame. ...
0
12,768
Analyze the following 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 print_udev_ambivalent(blkid_probe pr) { char *val = NULL; size_t valsz = 0; int count = 0, rc = -1; while (!blkid_do_probe(pr)) { const char *usage_txt = NULL, *type = NULL, *version = NULL; char enc[256]; blkid_probe_lookup_value(pr, "USAGE", &usage_txt, NULL); blkid_probe_lookup_value(p...
0
680
Analyze the following 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 nfs4_xdr_enc_setclientid(struct rpc_rqst *req, __be32 *p, struct nfs4_setclientid *sc) { struct xdr_stream xdr; struct compound_hdr hdr = { .nops = 1, }; xdr_init_encode(&xdr, &req->rq_snd_buf, p); encode_compound_hdr(&xdr, &hdr); return encode_setclientid(&xdr, sc); } Commit Message: NFSv4: ...
0
22,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: static int tty_copy_to_user(struct tty_struct *tty, void __user *to, size_t tail, size_t n) { struct n_tty_data *ldata = tty->disc_data; size_t size = N_TTY_BUF_SIZE - tail; const void *from = read_buf_addr(ldata, tail); int uncopied; if (n > size) { tty_audit_add_data(tty, from, size); uncopied ...
0
10,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: IsMacResource( FT_Library library, FT_Stream stream, FT_Long resource_offset, FT_Long face_index, FT_Face *aface ) { FT_Memory memory = library->memory; FT_Error error; FT_Long map_offset, rdara_pos; FT_Lon...
0
28,807
Analyze the following 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 wdm_in_callback(struct urb *urb) { struct wdm_device *desc = urb->context; int status = urb->status; spin_lock(&desc->iuspin); clear_bit(WDM_RESPONDING, &desc->flags); if (status) { switch (status) { case -ENOENT: dev_dbg(&desc->intf->dev, "nonzero urb status received: -ENOENT"...
1
12,748
Analyze the following 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 EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *c) { if (c == NULL) return 1; if (c->cipher != NULL) { if (c->cipher->cleanup && !c->cipher->cleanup(c)) return 0; /* Cleanse cipher context data */ if (c->cipher_data && c->cipher->ctx_size) OPENSSL_cleanse(c...
0
6,598
Analyze the following 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 ReadPSDMergedImage(const ImageInfo *image_info, Image *image,const PSDInfo *psd_info,ExceptionInfo *exception) { MagickOffsetType *offsets; MagickBooleanType status; PSDCompressionType compression; register ssize_t i; compression=(PSDCompressionType) ReadBl...
0
29,572
Analyze the following 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 RenderMessageFilter::OnAsyncOpenFile(const IPC::Message& msg, const FilePath& path, int flags, int message_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (!Child...
0
9,716
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void AppListSyncableService::AddOrUpdateFromSyncItem(AppListItem* app_item) { if (app_item->id() == kOemFolderId) return; SyncItem* sync_item = FindSyncItem(app_item->id()); if (sync_item) { UpdateAppItemFromSyncItem(sync_item, app_item); return; } CreateSyncItemFromAppItem(app_item); } Co...
0
5,262
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: png_sig_cmp(png_bytep sig, png_size_t start, png_size_t num_to_check) { png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10}; if (num_to_check > 8) num_to_check = 8; else if (num_to_check < 1) return (-1); if (start > 7) return (-1); if (start + num_to_check > 8) ...
0
13,442
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int dccp_cksum(netdissect_options *ndo, const struct ip *ip, const struct dccp_hdr *dh, u_int len) { return nextproto4_cksum(ndo, ip, (const uint8_t *)(const void *)dh, len, dccp_csum_coverage(dh, len), IPPROTO_DCCP); } Commit Message: (for 4.9.3) CVE-2018-16229/DCCP: Fix printing "Timestamp" and "T...
0
26,796
Analyze the following 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 btif_dispatch_sm_event(btif_av_sm_event_t event, void* p_data, int len) { /* Switch to BTIF context */ btif_transfer_context(btif_av_handle_event, event, (char*)p_data, len, NULL); } Commit Message: DO NOT MERGE AVRC: Copy browse.p_browse_data in btif_av_event_deep_copy p_msg_src->browse.p_browse_data i...
0
16,422
Analyze the following 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 GlobalHistogramAllocator::CreateWithPersistentMemory( void* base, size_t size, size_t page_size, uint64_t id, StringPiece name) { Set(WrapUnique( new GlobalHistogramAllocator(std::make_unique<PersistentMemoryAllocator>( base, size, page_size, id, name, false)))); } Comm...
0
5,710
Analyze the following 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::ForceRestoreContext() { if (!isContextLost()) { SynthesizeGLError(GL_INVALID_OPERATION, "restoreContext", "context not lost"); return; } if (!restore_allowed_) { if (context_lost_mode_ == kWebGLLoseContextLostContext) SynthesizeGLError...
0
12,803
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: brcmf_set_wsec_mode(struct net_device *ndev, struct cfg80211_connect_params *sme) { struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev); struct brcmf_cfg80211_security *sec; s32 pval = 0; s32 gval = 0; s32 wsec; s32 err = 0; if (sme->crypto.n_ciphers_pairwise) { switch (sme->crypto.ciphers...
0
8,466
Analyze the following 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 DrawInfo *DestroyDrawInfo(DrawInfo *draw_info) { if (draw_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); assert(draw_info != (DrawInfo *) NULL); assert(draw_info->signature == MagickCoreSignature); if (draw_info->primitive != (char *) NULL) draw...
0
19,837
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: acpi_status acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler handler) { if (gsi != acpi_gbl_FADT.sci_interrupt || !acpi_sci_irq_valid()) return AE_BAD_PARAMETER; free_irq(acpi_sci_irq, acpi_irq); acpi_irq_handler = NULL; acpi_sci_irq = INVALID_ACPI_IRQ; return AE_OK; } Commit Message: acpi: Di...
0
15,665
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline void Q(u32 *block, u8 *Kr, u32 *Km) { u32 I; block[2] ^= F1(block[3], Kr[0], Km[0]); block[1] ^= F2(block[2], Kr[1], Km[1]); block[0] ^= F3(block[1], Kr[2], Km[2]); block[3] ^= F1(block[0], Kr[3], Km[3]); } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all cry...
0
17,879
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void __unlink_end_trans(struct btrfs_trans_handle *trans, struct btrfs_root *root) { if (trans->block_rsv->type == BTRFS_BLOCK_RSV_GLOBAL) { btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved); trans->block_rsv = &root->fs_info->trans_block_rsv; BUG_ON(!root->fs_inf...
0
7,160
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int sctp_getsockopt_local_addrs(struct sock *sk, int len, char __user *optval, int __user *optlen) { struct sctp_bind_addr *bp; struct sctp_association *asoc; struct list_head *pos; int cnt = 0; struct sctp_getaddrs getaddrs; struct sctp_sockaddr_entry *addr; void __user *to; union sctp_...
0
8,171
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderClientCallback (CallbackListPtr *list, pointer closure, pointer data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; RenderClientPtr pRenderClient = GetRenderClient (pClient); pRenderClient->major_version = 0; pRend...
0
1,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: helo_code(thread_t * thread, int status) { smtp_t *smtp = THREAD_ARG(thread); if (status == 250) { smtp->stage++; } else { log_message(LOG_INFO, "Error processing HELO cmd on SMTP server %s." " SMTP status code = %d" , FMT_SMTP_HOST() , status); smtp->stage = ERROR; } return...
0
24,540
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: String Document::lastModified() const { DateComponents date; bool foundDate = false; if (m_frame) { if (DocumentLoader* documentLoader = loader()) { const AtomicString& httpLastModified = documentLoader->response().httpHeaderField("Last-Modified"); if (!httpLastModified...
0
4,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: OJPEGWriteHeaderInfo(TIFF* tif) { static const char module[]="OJPEGWriteHeaderInfo"; OJPEGState* sp=(OJPEGState*)tif->tif_data; uint8** m; uint32 n; /* if a previous attempt failed, don't try again */ if (sp->libjpeg_session_active != 0) return 0; sp->out_state=ososSoi; sp->restart_index=0; jpeg_std_e...
0
24,131
Analyze the following 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 SmushYGap(const Image *smush_image,const Image *images, const ssize_t offset,ExceptionInfo *exception) { CacheView *bottom_view, *top_view; const Image *bottom_image, *top_image; RectangleInfo bottom_geometry, top_geometry; register const PixelPacket *p; ...
0
20,247
Analyze the following 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 int propagate_entity_load_avg(struct sched_entity *se) { return 0; } Commit Message: sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the scheduler under high loads, starting at around the v4.18 time...
0
15,931
Analyze the following 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 Track::Info::CopyStr(char* Info::*str, Info& dst_) const { if (str == static_cast<char* Info::*>(NULL)) return -1; char*& dst = dst_.*str; if (dst) //should be NULL already return -1; const char* const src = this->*str; if (src == NULL) return 0; const size_t l...
1
10,750
Analyze the following 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 PrintRenderFrameHelper::Delegate::IsScriptedPrintEnabled() { return true; } Commit Message: Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which were assuming that the call actually has any control over the memory protection applied to a handle when m...
0
4,161
Analyze the following 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 sctp_inet_listen(struct socket *sock, int backlog) { struct sock *sk = sock->sk; struct sctp_endpoint *ep = sctp_sk(sk)->ep; int err = -EINVAL; if (unlikely(backlog < 0)) return err; lock_sock(sk); /* Peeled-off sockets are not allowed to listen(). */ if (sctp_style(sk, UDP_HIGH_BANDWIDTH)) got...
0
23,762
Analyze the following 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 *req_uri_field(request_rec *r) { return r->uri; } Commit Message: *) SECURITY: CVE-2015-0228 (cve.mitre.org) mod_lua: A maliciously crafted websockets PING after a script calls r:wsupgrade() can cause a child process crash. [Edward Lu <Chaosed0 gmail.com>] Discovered by Guido Vr...
0
8,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: SECURITY_STATUS SEC_ENTRY VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP) { char* Name; SECURITY_STATUS status; SecurityFunctionTableA* table; Name = (char*) sspi_SecureHandleGetUpperPointer(phContext); if (!Name) return SEC_E_SECPKG_NOT_FOUND; table = ...
0
11,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: _krb5_pk_load_id(krb5_context context, struct krb5_pk_identity **ret_id, const char *user_id, const char *anchor_id, char * const *chain_list, char * const *revoke_list, krb5_prompter_fct prompter, void *prompter_data, char *password) { struct krb5_pk_identity *id = NULL; struct pr...
0
1,638
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderWidgetHostImpl::OnTouchEventAck( const TouchEventWithLatencyInfo& event, InputEventAckState ack_result) { latency_tracker_.OnInputEventAck(event.event, &event.latency); if (touch_emulator_ && touch_emulator_->HandleTouchEventAck(event.event, ack_result)) { return; } if (view...
0
7,413
Analyze the following 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 dtls1_reset_seq_numbers(SSL *s, int rw) { unsigned char *seq; unsigned int seq_bytes = sizeof(s->s3->read_sequence); if (rw & SSL3_CC_READ) { seq = s->s3->read_sequence; s->d1->r_epoch++; memcpy(&(s->d1->bitmap), &(s->d1->next_bitmap), sizeof(DTLS1_BITMAP)); memse...
0
13,863
Analyze the following 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_exception(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); struct kvm_run *kvm_run = vcpu->run; u32 intr_info, ex_no, error_code; unsigned long cr2, rip, dr6; u32 vect_info; enum emulation_result er; vect_info = vmx->idt_vectoring_info; intr_info = vmx->exit_intr_info; i...
1
12,350
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool PrintWebViewHelper::PrintPreviewContext::CreatePreviewDocument( PrintMsg_Print_Params* print_params, const std::vector<int>& pages, bool ignore_css_margins) { DCHECK_EQ(INITIALIZED, state_); state_ = RENDERING; metafile_.reset(new printing::PreviewMetafile); if (!metafile_->Init()) { ...
0
14,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 inline int tcp_head_timedout(const struct sock *sk) { const struct tcp_sock *tp = tcp_sk(sk); return tp->packets_out && tcp_skb_timedout(sk, tcp_write_queue_head(sk)); } Commit Message: tcp: drop SYN+FIN messages Denys Fedoryshchenko reported that SYN+FIN attacks were bringing his linux machin...
0
29,104
Analyze the following 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 *get_netscape_format(const struct Cookie *co) { return aprintf( "%s" /* httponly preamble */ "%s%s\t" /* domain */ "%s\t" /* tailmatch */ "%s\t" /* path */ "%s\t" /* secure */ "%" FORMAT_OFF_T "\t" /* expires */ "%s\t" /* name */ "%s", /* value */ ...
0
28,011
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OMX_ERRORTYPE omx_vdec::set_config(OMX_IN OMX_HANDLETYPE hComp, OMX_IN OMX_INDEXTYPE configIndex, OMX_IN OMX_PTR configData) { (void) hComp; if (m_state == OMX_StateInvalid) { DEBUG_PRINT_ERROR("Get Config in Invalid State"); return OMX_ErrorInvalidState; } OMX_ERRORT...
0
24,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 int midi_setup_channel_pressure(struct _mdi *mdi, uint8_t channel, uint8_t pressure) { MIDI_EVENT_DEBUG(__FUNCTION__,channel, pressure); _WM_CheckEventMemoryPool(mdi); mdi->events[mdi->event_count].do_event = *_WM_do_channel_pressure; mdi->events[mdi->...
0
1,311
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: code_exist_check(OnigCodePoint c, UChar* from, UChar* end, int ignore_escaped, ScanEnv* env) { int in_esc; OnigCodePoint code; OnigEncoding enc = env->enc; UChar* p = from; in_esc = 0; while (! PEND) { if (ignore_escaped && in_esc) { in_esc = 0; } else { PFETCH_S(code); ...
0
9,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: int xt_compat_match_offset(const struct xt_match *match) { u_int16_t csize = match->compatsize ? : match->matchsize; return XT_ALIGN(match->matchsize) - COMPAT_XT_ALIGN(csize); } Commit Message: netfilter: x_tables: check for bogus target offset We're currently asserting that targetoff + targetsize <= nextoff...
0
23,480
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LocalFrame* LocalFrame::Create(LocalFrameClient* client, Page& page, FrameOwner* owner, InterfaceRegistry* interface_registry) { LocalFrame* frame = new LocalFrame( client, page, owner, interface_registry ? ...
0
29,591
Analyze the following 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 _write_acl(struct dlist *dl, const char *aclstr) { const char *p, *q; struct dlist *al = dlist_newkvlist(dl, "A"); p = aclstr; while (p && *p) { char *name,*val; q = strchr(p, '\t'); if (!q) break; name = xstrndup(p, q-p); q++; p = s...
0
19,774
Analyze the following 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 Gfx::opSetTextLeading(Object args[], int numArgs) { state->setLeading(args[0].getNum()); } Commit Message: CWE ID: CWE-20
0
8,879
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void btif_hl_send_setup_connecting_cb(UINT8 app_idx, UINT8 mcl_idx){ btif_hl_pending_chan_cb_t *p_pcb = BTIF_HL_GET_PCB_PTR(app_idx, mcl_idx); bt_bdaddr_t bd_addr; int app_id = (int) btif_hl_get_app_id(p_pcb->channel_id); btif_hl_copy_bda(&bd_addr, p_pcb->bd_addr); ...
0
25,408
Analyze the following 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_dops_tag(AVIOContext *pb, MOVTrack *track) { int64_t pos = avio_tell(pb); avio_wb32(pb, 0); ffio_wfourcc(pb, "dOps"); avio_w8(pb, 0); /* Version */ if (track->par->extradata_size < 19) { av_log(pb, AV_LOG_ERROR, "invalid extradata size\n"); return AVERROR_I...
0
28,670
Analyze the following 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::MaybeGenerateCrashReport( base::TerminationStatus status, int exit_code) { if (!last_committed_url_.SchemeIsHTTPOrHTTPS()) return; if (!frame_tree_node_->IsMainFrame() && !IsCrossProcessSubframe()) return; std::string reason; switch (status) { case base::TER...
0
5,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: apr_status_t h2_stream_set_request_rec(h2_stream *stream, request_rec *r) { h2_request *req; apr_status_t status; ap_assert(stream->request == NULL); ap_assert(stream->rtmp == NULL); if (stream->rst_error) { return APR_ECONNRESET; } status = h2_request_rcreate(&req, stream->po...
0
23,767
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: fbFetch_a1b5g5r5 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed) { const CARD16 *pixel = (const CARD16 *)bits + x; const CARD16 *end = pixel + width; while (pixel < end) { CARD32 p = READ(pixel++); CARD32 r,g,b, a; a = (CARD32) ((CARD8) (0 - ((p ...
0
28,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: bool RenderFlexibleBox::isLeftToRightFlow() const { if (isColumnFlow()) return style()->writingMode() == TopToBottomWritingMode || style()->writingMode() == LeftToRightWritingMode; return style()->isLeftToRightDirection() ^ (style()->flexDirection() == FlowRowReverse); } Commit Message: Separate ...
0
8,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 __init sched_init_smp(void) { cpumask_var_t non_isolated_cpus; alloc_cpumask_var(&non_isolated_cpus, GFP_KERNEL); alloc_cpumask_var(&fallback_doms, GFP_KERNEL); get_online_cpus(); mutex_lock(&sched_domains_mutex); init_sched_domains(cpu_active_mask); cpumask_andnot(non_isolated_cpus, cpu_possible_ma...
0
11,605
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TabStripGtk::~TabStripGtk() { model_->RemoveObserver(this); tabstrip_.Destroy(); std::vector<TabData>::iterator iterator = tab_data_.begin(); for (; iterator < tab_data_.end(); iterator++) { delete iterator->tab; } tab_data_.clear(); RemoveMessageLoopObserver(); } Commit Message: Remove TabC...
0
13,469