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 SpoolAllPagesWithBoundariesForTesting( cc::PaintCanvas* canvas, const FloatSize& page_size_in_pixels) { DispatchEventsForPrintingOnAllFrames(); if (!GetFrame()->GetDocument() || !GetFrame()->GetDocument()->GetLayoutView()) return; GetFrame()->View()->UpdateLifecyclePh...
0
145,770
Analyze the following 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 Save(const v8::FunctionCallbackInfo<v8::Value>& info) { CHECK(info.Length() == 2 && info[0]->IsString() && info[1]->IsObject()); SaveImpl(*v8::String::Utf8Value(info[0]), info[1], info.GetIsolate()->GetCurrentContext()); } Commit Message: [Extensions] Finish free...
0
132,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: void GDataFileSystem::GetFileByEntryOnUIThread( const GetFileCallback& get_file_callback, const GetDownloadDataCallback& get_download_data_callback, GDataEntry* entry) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); FilePath file_path; if (entry) { GDataFile* file = entry->AsGDataF...
0
116,952
Analyze the following 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 swap (huff_t* huff, node_t *node1, node_t *node2) { node_t *par1, *par2; par1 = node1->parent; par2 = node2->parent; if (par1) { if (par1->left == node1) { par1->left = node2; } else { par1->right = node2; } } else { huff->tree = node2; } if (par2) { if (par2->left == no...
0
63,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: static void pcnet_s_reset(PCNetState *s) { trace_pcnet_s_reset(s); s->rdra = 0; s->tdra = 0; s->rap = 0; s->bcr[BCR_BSBC] &= ~0x0080; s->csr[0] = 0x0004; s->csr[3] = 0x0000; s->csr[4] = 0x0115; s->csr[5] = 0x0000; s->csr[6] = 0x0000; s->csr[8] = 0; s-...
0
14,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: static int ssl_write_new_session_ticket( mbedtls_ssl_context *ssl ) { int ret; size_t tlen; uint32_t lifetime; MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> write new session ticket" ) ); ssl->out_msgtype = MBEDTLS_SSL_MSG_HANDSHAKE; ssl->out_msg[0] = MBEDTLS_SSL_HS_NEW_SESSION_TICKET; /* *...
0
86,147
Analyze the following 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 f2fs_write_node_page(struct page *page, struct writeback_control *wbc) { return __write_node_page(page, false, NULL, wbc); } Commit Message: f2fs: fix race condition in between free nid allocator/initializer In below concurrent case, allocated nid can be loaded into free nid cache and be allocat...
0
85,261
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void __cleanup_signal(struct signal_struct *sig) { thread_group_cputime_free(sig); tty_kref_put(sig->tty); kmem_cache_free(signal_cachep, sig); } Commit Message: block: Fix io_context leak after failure of clone with CLONE_IO With CLONE_IO, parent's io_context->nr_tasks is incremented, but never decremented ...
0
94,343
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gfx::Rect RenderWidgetHostViewGuest::GetBoundsInRootWindow() { return GetViewBounds(); } Commit Message: Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing the renderer contexts - do not require...
0
115,019
Analyze the following 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 unsigned int get_rr_interval_fair(struct rq *rq, struct task_struct *task) { struct sched_entity *se = &task->se; unsigned int rr_interval = 0; /* * Time slice is 0 for SCHED_OTHER tasks that are on an otherwise * idle runqueue: */ if (rq->cfs.load.weight) rr_interval = NS_TO_JIFFIES(sched_sli...
0
92,564
Analyze the following 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 NuPlayer::GenericSource::resetDataSource() { mHTTPService.clear(); mHttpSource.clear(); mUri.clear(); mUriHeaders.clear(); if (mFd >= 0) { close(mFd); mFd = -1; } mOffset = 0; mLength = 0; setDrmPlaybackStatusIfNeeded(Playback::STOP, 0); mDecryptHandle = NULL...
0
160,430
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int main(int argc, char ** argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } Commit Message: Fix uriParse*Ex* out-of-bounds read CWE ID: CWE-125
0
92,888
Analyze the following 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 ExpectSetRequiredCSPRequestHeader( const char* input, WebURLRequest::FrameType frame_type, const AtomicString& expected_required_csp) { KURL input_url(kParsedURLString, input); ResourceRequest resource_request(input_url); resource_request.SetRequestContext(WebURLRequest::kRequ...
0
138,790
Analyze the following 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::getCompiledScripts(int contextGroupId, std::vector<std::unique_ptr<V8DebuggerScript>>& result) { v8::HandleScope scope(m_isolate); v8::MicrotasksScope microtasks(m_isolate, v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local<v8::Object> debuggerScript = m_debuggerScript.Get(m_isolate...
0
130,372
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: json_to_record(PG_FUNCTION_ARGS) { return populate_record_worker(fcinfo, "json_to_record", false); } Commit Message: CWE ID: CWE-119
0
2,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: static struct block_device *bd_acquire(struct inode *inode) { struct block_device *bdev; spin_lock(&bdev_lock); bdev = inode->i_bdev; if (bdev) { ihold(bdev->bd_inode); spin_unlock(&bdev_lock); return bdev; } spin_unlock(&bdev_lock); bdev = bdget(inode->i_rdev); if (bdev) { spin_lock(&bdev_lock)...
0
46,234
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline unsigned int div32(unsigned int a, unsigned int b, unsigned int *r) { if (b == 0) { *r = 0; return UINT_MAX; } *r = a % b; return a / b; } Commit Message: ALSA: pcm : Call kill_fasync() in stream lock Currently kill_fasync() is called outside the stream lock in snd_pcm_period_elapsed...
0
47,782
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebLocalFrame* LocalMainFrame() { return web_view_helper_->LocalMainFrame(); } Commit Message: [BGPT] Add a fast-path for transform-origin changes. This patch adds a fast-path for updating composited transform-origin changes without requiring a PaintArtifactCompositor update. This closely follows the approach...
0
140,118
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebGLRenderingContextBase::TexImageImpl( TexImageFunctionID function_id, GLenum target, GLint level, GLint internalformat, GLint xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, Image* image, WebGLImageConversion::ImageHtmlDomSource dom_source, ...
0
133,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: void SelectionEditor::NodeChildrenWillBeRemoved(ContainerNode& container) { if (selection_.IsNone()) return; const Position old_base = selection_.base_; const Position old_extent = selection_.extent_; const Position& new_base = ComputePositionForChildrenRemoval(old_base, container); const Posi...
1
171,764
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: s64 vsock_stream_has_space(struct vsock_sock *vsk) { return transport->stream_has_space(vsk); } Commit Message: VSOCK: Fix missing msg_namelen update in vsock_stream_recvmsg() The code misses to update the msg_namelen member to 0 and therefore makes net/socket.c leak the local, uninitialized sockaddr_storage v...
0
30,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: AppLauncherHandler::AppLauncherHandler(ExtensionService* extension_service) : extension_service_(extension_service), ignore_changes_(false), attempted_bookmark_app_install_(false), has_loaded_apps_(false) { if (IsAppLauncherEnabled()) RecordAppLauncherPromoHistogram(apps::APP_LAUNCHER_...
0
110,324
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int __init create_tlb_single_page_flush_ceiling(void) { debugfs_create_file("tlb_single_page_flush_ceiling", S_IRUSR | S_IWUSR, arch_debugfs_dir, NULL, &fops_tlbflush); return 0; } Commit Message: x86/mm: Add barriers and document switch_mm()-vs-flush synchronization When switch_mm() activates a...
0
55,423
Analyze the following 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 der_cmp(const void *a, const void *b) { const DER_ENC *d1 = a, *d2 = b; int cmplen, i; cmplen = (d1->length < d2->length) ? d1->length : d2->length; i = memcmp(d1->data, d2->data, cmplen); if (i) return i; return d1->length - d2->length; } Commit Message: CWE ID: CWE-1...
0
12,846
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: v8::Handle<v8::Value> V8DirectoryEntry::getFileCallback(const v8::Arguments& args) { INC_STATS("DOM.DirectoryEntry.getFile"); DirectoryEntry* imp = V8DirectoryEntry::toNative(args.Holder()); if (args.Length() < 1) return V8Proxy::throwNotEnoughArgumentsError(); STRING_TO_V8PARAMETER...
1
171,117
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int32 BrowserGpuChannelHostFactory::CreateViewCommandBuffer( int32 surface_id, const GPUCreateCommandBufferConfig& init_params) { CreateRequest request; GetIOLoopProxy()->PostTask(FROM_HERE, base::Bind( &BrowserGpuChannelHostFactory::CreateViewCommandBufferOnIO, base::Unretained(th...
0
106,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: static int ccid3_hc_rx_insert_options(struct sock *sk, struct sk_buff *skb) { const struct ccid3_hc_rx_sock *hc = ccid3_hc_rx_sk(sk); __be32 x_recv, pinv; if (!(sk->sk_state == DCCP_OPEN || sk->sk_state == DCCP_PARTOPEN)) return 0; if (dccp_packet_without_ack(skb)) return 0; x_recv = htonl(hc->rx_x_re...
0
34,151
Analyze the following 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(Phar, offsetExists) { char *fname; int fname_len; phar_entry_info *entry; PHAR_ARCHIVE_OBJECT(); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) { return; } if (zend_hash_exists(&phar_obj->arc.archive->manifest, fname, (uint) fname_len)) { if (SUC...
0
4,393
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void SoftAVC::onReset() { SoftVideoDecoderOMXComponent::onReset(); mSignalledError = false; } Commit Message: codecs: check OMX buffer size before use in (h263|h264)dec Bug: 27833616 Change-Id: I0fd599b3da431425d89236ffdd9df423c11947c0 CWE ID: CWE-20
0
163,882
Analyze the following 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 mpage_map_and_submit_extent(handle_t *handle, struct mpage_da_data *mpd, bool *give_up_on_write) { struct inode *inode = mpd->inode; struct ext4_map_blocks *map = &mpd->map; int err; loff_t disksize; int progress = 0; mpd->io_submit.io_end->offset = ((loff_t)map->m_lblk...
0
67,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: WORD32 ih264d_parse_inter_slice_data_cavlc(dec_struct_t * ps_dec, dec_slice_params_t * ps_slice, UWORD16 u2_first_mb_in_slice) { UWORD32 uc_more_data_flag; WORD32 i2_cur_mb_addr; UWORD32 u1_num_mbs, u1_num_mbsNby2, u1_mb_idx; UWORD32 i2_mb_skip_run; ...
1
173,957
Analyze the following 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::DidSendScreenRects(RenderWidgetHostImpl* rwh) { if (browser_plugin_embedder_) browser_plugin_embedder_->DidSendScreenRects(); } Commit Message: Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.app...
0
110,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: bool WebContentsImpl::NeedToFireBeforeUnload() { if (ShowingInterstitialPage()) return false; if (!WillNotifyDisconnection()) return false; if (GetRenderViewHost()->SuddenTerminationAllowed()) return false; if (!GetMainFrame()->GetProcess()->SuddenTerminationAllowed()) return true; r...
0
144,999
Analyze the following 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 Compositor::UpdateLayerTreeHost() { if (!root_layer()) return; SendDamagedRectsRecursive(root_layer()); } Commit Message: Fix PIP window being blank after minimize/show DesktopWindowTreeHostX11::SetVisible only made the call into OnNativeWidgetVisibilityChanged when transitioning from shown to mini...
0
140,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: isoent_make_path_table_2(struct archive_write *a, struct vdd *vdd, int depth, int *dir_number) { struct isoent *np; struct isoent **enttbl; struct path_table *pt; int i; pt = &vdd->pathtbl[depth]; if (pt->cnt == 0) { pt->sorted = NULL; return (ARCHIVE_OK); } enttbl = malloc(pt->cnt * sizeof(struc...
0
50,838
Analyze the following 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 RenderSVGImage::updateImageViewport() { SVGImageElement* image = toSVGImageElement(element()); FloatRect oldBoundaries = m_objectBoundingBox; bool updatedViewport = false; SVGLengthContext lengthContext(image); m_objectBoundingBox = FloatRect(image->xCurrentValue().value(lengthContext), ...
0
123,636
Analyze the following 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 jboolean android_net_wifi_get_ring_buffer_data(JNIEnv *env, jclass cls, jint iface, jstring ring_name) { JNIHelper helper(env); wifi_interface_handle handle = getIfaceHandle(helper, cls, iface); ScopedUtfChars chars(env, ring_name); const char* ring_name_const_char = chars.c_str(); int re...
0
159,082
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int64 DownloadItemImpl::CurrentSpeed() const { if (is_paused_) return 0; return bytes_per_sec_; } Commit Message: Refactors to simplify rename pathway in DownloadFileManager. This is https://chromiumcodereview.appspot.com/10668004 / r144817 (reverted due to CrOS failure) with the completion logic moved...
0
106,065
Analyze the following 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 AwContents::UpdateScrollState(gfx::Vector2d max_scroll_offset, gfx::SizeF contents_size_dip, float page_scale_factor, float min_page_scale_factor, float max_page_scal...
1
171,618
Analyze the following 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 AppModalDialog::CompleteDialog() { AppModalDialogQueue::GetInstance()->ShowNextDialog(); } Commit Message: Fix a Windows crash bug with javascript alerts from extension popups. BUG=137707 Review URL: https://chromiumcodereview.appspot.com/10828423 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@...
1
170,754
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void check_http_proxy(HashTable *var_table) { if (zend_hash_exists(var_table, "HTTP_PROXY", sizeof("HTTP_PROXY"))) { char *local_proxy = getenv("HTTP_PROXY"); if (!local_proxy) { zend_hash_del(var_table, "HTTP_PROXY", sizeof("HTTP_PROXY")); } else { zval *local_zval; ALLOC_INIT_ZVAL(local_...
0
63,609
Analyze the following 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 git_index_remove_bypath(git_index *index, const char *path) { int ret; assert(index && path); if (((ret = git_index_remove(index, path, 0)) < 0 && ret != GIT_ENOTFOUND) || ((ret = index_conflict_to_reuc(index, path)) < 0 && ret != GIT_ENOTFOUND)) return ret; if (ret == GIT_ENOTFOUND) giterr_c...
0
83,694
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int gfs2_allocate_page_backing(struct page *page) { struct inode *inode = page->mapping->host; struct buffer_head bh; unsigned long size = PAGE_CACHE_SIZE; u64 lblock = page->index << (PAGE_CACHE_SHIFT - inode->i_blkbits); do { bh.b_state = 0; bh.b_size = size; gfs2_block_map(inode, lblock, &bh...
0
34,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: static bool StartsWith(const uint8* buffer, size_t buffer_size, const uint8* prefix, size_t prefix_size) { return (prefix_size <= buffer_size && memcmp(buffer, prefix, prefix_size) == 0); } Commit Message: Add extra checks to avoid ...
0
119,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 ImageEventSender& beforeLoadEventSender() { DEFINE_STATIC_LOCAL(ImageEventSender, sender, (eventNames().beforeloadEvent)); return sender; } Commit Message: Error event was fired synchronously blowing away the input element from underneath. Remove the FIXME and fire it asynchronously using errorEve...
0
113,473
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport char *RemoveImageProperty(Image *image,const char *property) { char *value; assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); if (image->proper...
0
50,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: void SVGDocumentExtensions::reportError(const String& message) { reportMessage(m_document, ErrorMessageLevel, "Error: " + message); } Commit Message: SVG: Moving animating <svg> to other iframe should not crash. Moving SVGSVGElement with its SMILTimeContainer already started caused crash before this patch. ...
0
120,400
Analyze the following 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 airspy_enum_fmt_sdr_cap(struct file *file, void *priv, struct v4l2_fmtdesc *f) { if (f->index >= NUM_FORMATS) return -EINVAL; strlcpy(f->description, formats[f->index].name, sizeof(f->description)); f->pixelformat = formats[f->index].pixelformat; return 0; } Commit Message: media: fix airspy...
0
51,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: ClientDiscardableSharedMemoryManager::AllocateLockedDiscardableSharedMemory( size_t size, int32_t id) { TRACE_EVENT2("renderer", "ClientDiscardableSharedMemoryManager::" "AllocateLockedDiscardableSharedMemory", "size", size, "id", id); base::SharedMemoryHan...
0
149,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: void tpm_dev_vendor_release(struct tpm_chip *chip) { if (chip->vendor.release) chip->vendor.release(chip->dev); clear_bit(chip->dev_num, dev_mask); kfree(chip->vendor.miscdev.name); } Commit Message: char/tpm: Fix unitialized usage of data buffer This patch fixes information leakage to the userspace by in...
0
27,632
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebPluginAcceleratedSurfaceProxy::~WebPluginAcceleratedSurfaceProxy() { if (surface_) { surface_->Destroy(); delete surface_; surface_ = NULL; } } Commit Message: iwyu: Include callback_old.h where appropriate, final. BUG=82098 TEST=none Review URL: http://codereview.chromium.org/7003003 git-s...
0
100,988
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vrrp_garp_lower_prio_delay_handler(vector_t *strvec) { vrrp_t *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp); unsigned delay; if (!read_unsigned_strvec(strvec, 1, &delay, 0, UINT_MAX / TIMER_HZ, true)) { report_config_error(CONFIG_GENERAL_ERROR, "(%s): garp_lower_prio_delay '%s' invalid - ignoring", vrrp->iname, F...
0
75,994
Analyze the following 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 fscrypt_process_policy(struct inode *inode, const struct fscrypt_policy *policy) { if (policy->version != 0) return -EINVAL; if (!inode_has_encryption_context(inode)) { if (!inode->i_sb->s_cop->empty_dir) return -EOPNOTSUPP; if (!inode->i_sb->s_cop->empty_dir(inode)) return -ENOTEMPTY...
1
168,460
Analyze the following 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 SocketStream::DetachDelegate() { if (!delegate_) return; delegate_ = NULL; if (next_state_ == STATE_NONE) return; net_log_.AddEvent(NetLog::TYPE_CANCELLED); pending_write_bufs_.clear(); Close(); } Commit Message: Revert a workaround commit for a Use-After-Free crash. Revert a workaround...
0
112,668
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Document::clearStyleResolver() { m_styleResolver.clear(); } Commit Message: Refactoring: Move m_mayDisplaySeamlesslyWithParent down to Document The member is used only in Document, thus no reason to stay in SecurityContext. TEST=none BUG=none R=haraken@chromium.org, abarth, haraken, hayato Review URL...
0
102,642
Analyze the following 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 ChromeContentBrowserClient::GetStoragePartitionConfigForSite( content::BrowserContext* browser_context, const GURL& site, bool can_be_default, std::string* partition_domain, std::string* partition_name, bool* in_memory) { partition_domain->clear(); partition_name->clear(); *in_m...
0
115,761
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mojom::RenderMessageFilter* RenderThreadImpl::current_render_message_filter() { if (g_render_message_filter_for_testing) return g_render_message_filter_for_testing; DCHECK(current()); return current()->render_message_filter(); } Commit Message: Roll src/third_party/boringssl/src 664e99a64..696c13bd6 h...
0
150,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: Ins_ENDF( INS_ARG ) { TT_CallRec* pRec; FT_UNUSED_ARG; if ( CUR.callTop <= 0 ) /* We encountered an ENDF without a call */ { CUR.error = TT_Err_ENDF_In_Exec_Stream; return; } CUR.callTop--; pRec = &CUR.callStack[CUR.callTop]; pRec->Cur_Count--; CUR.s...
0
10,100
Analyze the following 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 vrend_fill_shader_key(struct vrend_context *ctx, struct vrend_shader_key *key) { if (vrend_state.use_core_profile == true) { int i; bool add_alpha_test = true; key->cbufs_are_a8_bitmask = 0; for (i = 0; i < ctx->sub->nr_cbufs; ...
0
8,860
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Shader* CreateShader( GLuint client_id, GLuint service_id, GLenum shader_type) { return shader_manager()->CreateShader( client_id, service_id, shader_type); } Commit Message: Framebuffer clear() needs to consider the situation some draw buffers are disabled. This is when we exp...
0
120,766
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Resource* DocumentLoader::StartPreload(Resource::Type type, FetchParameters& params) { Resource* resource = nullptr; switch (type) { case Resource::kImage: if (frame_) frame_->MaybeAllowImagePlaceholder(params); resource = ImageResource::Fetch(par...
0
134,461
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: monitor_apply_keystate(struct monitor *pmonitor) { struct ssh *ssh = active_state; /* XXX */ struct kex *kex; int r; debug3("%s: packet_set_state", __func__); if ((r = ssh_packet_set_state(ssh, child_state)) != 0) fatal("%s: packet_set_state: %s", __func__, ssh_err(r)); sshbuf_free(child_st...
0
42,118
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: status_t OMXCodec::setVideoOutputFormat( const char *mime, const sp<MetaData>& meta) { int32_t width, height; bool success = meta->findInt32(kKeyWidth, &width); success = success && meta->findInt32(kKeyHeight, &height); CHECK(success); CODEC_LOGV("setVideoOutputFormat width=%d, height=%d", width,...
0
158,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: invoke_NPN_Evaluate(PluginInstance *plugin, NPObject *npobj, NPString *script, NPVariant *result) { npw_return_val_if_fail(rpc_method_invoke_possible(g_rpc_connection), false); int error = rpc_method_invoke(g_rpc_connection, RPC_METHOD_NPN_EVALUATE, RPC_TYPE_NPW_PLUGIN_INSTANCE, plugin, ...
0
27,116
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: linux_lvm2_lv_create_completed_cb (DBusGMethodInvocation *context, Device *device, gboolean job_was_cancelled, int status, const char *stderr, ...
0
11,733
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CHUNK_WRITE_PTR(chunk_t *chunk) { return chunk->data + chunk->datalen; } Commit Message: Add a one-word sentinel value of 0x0 at the end of each buf_t chunk This helps protect against bugs where any part of a buf_t's memory is passed to a function that expects a NUL-terminated input. It also closes TROVE-201...
0
73,137
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: R_API int r_config_toggle(RConfig *cfg, const char *name) { RConfigNode *node = r_config_node_get (cfg, name); if (node && node->flags & CN_BOOL) { (void)r_config_set_i (cfg, name, !node->i_value); return true; } return false; } Commit Message: Fix #7698 - UAF in r_config_set when loading a dex CWE ID: C...
0
64,497
Analyze the following 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::UpdateAllLifecyclePhasesAndCompositeForTesting() { NOTREACHED(); } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introduced https://crbug.com/666714 loc...
0
139,872
Analyze the following 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 __rtnl_link_unregister(struct rtnl_link_ops *ops) { struct net *net; for_each_net(net) { __rtnl_kill_links(net, ops); } list_del(&ops->list); } Commit Message: rtnl: fix info leak on RTM_GETLINK request for VF devices Initialize the mac address buffer with 0 as the driver specific function will prob...
0
31,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: bool AttachDebuggerFunction::RunImpl() { if (!InitTabContents()) return false; std::string version; EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &version)); if (!webkit_glue::IsInspectorProtocolVersionSupported(version)) { error_ = ExtensionErrorUtils::FormatErrorMessage( keys::kProto...
0
108,245
Analyze the following 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 commit_tree(struct mount *mnt, struct mount *shadows) { struct mount *parent = mnt->mnt_parent; struct mount *m; LIST_HEAD(head); struct mnt_namespace *n = parent->mnt_ns; BUG_ON(parent == mnt); list_add_tail(&head, &mnt->mnt_list); list_for_each_entry(m, &head, mnt_list) m->mnt_ns = n; l...
0
57,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: bool AppModalDialog::IsJavaScriptModalDialog() { return false; } Commit Message: Fix a Windows crash bug with javascript alerts from extension popups. BUG=137707 Review URL: https://chromiumcodereview.appspot.com/10828423 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152716 0039d316-1c4b-4281-b951-d8...
0
103,753
Analyze the following 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 calculate_bitrate(AVFormatContext *s) { AVIContext *avi = s->priv_data; int i, j; int64_t lensum = 0; int64_t maxpos = 0; for (i = 0; i<s->nb_streams; i++) { int64_t len = 0; AVStream *st = s->streams[i]; if (!st->nb_index_entries) continue; ...
0
64,076
Analyze the following 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 NuPlayer::GenericSource::postReadBuffer(media_track_type trackType) { Mutex::Autolock _l(mReadBufferLock); if ((mPendingReadBufferTypes & (1 << trackType)) == 0) { mPendingReadBufferTypes |= (1 << trackType); sp<AMessage> msg = new AMessage(kWhatReadBuffer, id()); msg->setInt32("tr...
0
161,997
Analyze the following 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 watchdog_nmi_enable(int cpu) { struct perf_event_attr *wd_attr; struct perf_event *event = per_cpu(watchdog_ev, cpu); /* is it already setup and enabled? */ if (event && event->state > PERF_EVENT_STATE_OFF) goto out; /* it is setup but not enabled */ if (event != NULL) goto out_enable; wd...
0
26,401
Analyze the following 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 sign_extend_imm13(int imm) { return imm << 19 >> 19; } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting interru...
0
25,691
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DocumentLoader::getSubresources(Vector<PassRefPtr<ArchiveResource> >& subresources) const { if (!isCommitted()) return; const CachedResourceLoader::DocumentResourceMap& allResources = m_cachedResourceLoader->allCachedResources(); CachedResourceLoader::DocumentResourceMap::const_iterator ...
0
105,712
Analyze the following 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 RenderBox::flipForWritingMode(FloatRect& rect) const { if (!style()->isFlippedBlocksWritingMode()) return; if (isHorizontalWritingMode()) rect.setY(height() - rect.maxY()); else rect.setX(width() - rect.maxX()); } Commit Message: Source/WebCore: Fix for bug 64046 - Wrong...
0
101,585
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: do_cache_op(unsigned long start, unsigned long end, int flags) { struct mm_struct *mm = current->active_mm; struct vm_area_struct *vma; if (end < start || flags) return -EINVAL; down_read(&mm->mmap_sem); vma = find_vma(mm, start); if (vma && vma->vm_start < end) { if (start < vma->vm_start) start =...
0
58,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: FileStreamReader* BlobURLRequestJob::GetFileStreamReader(size_t index) { DCHECK_LT(index, blob_data_->items().size()); const BlobData::Item& item = blob_data_->items().at(index); if (!IsFileType(item.type())) return NULL; if (index_to_reader_.find(index) == index_to_reader_.end()) CreateFileStream...
0
115,164
Analyze the following 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 red_client_destroy(RedClient *client) { RingItem *link, *next; RedChannelClient *rcc; spice_printerr("destroy client with #channels %d", client->channels_num); if (!pthread_equal(pthread_self(), client->thread_id)) { spice_warning("client->thread_id (0x%lx) != pthread_self (0x%lx)." ...
0
2,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: void HTMLSelectElement::optionSelectionStateChanged(HTMLOptionElement* option, bool optionIsSelected) { ASSERT(option->ownerSelectElement() == this); if (optionIsSelected) selectOption(option->index()); else if (!usesMenuList()) selectOption(-1); else selectOption(nextSelec...
0
103,090
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void vmx_flush_pml_buffer(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); u64 *pml_buf; u16 pml_idx; pml_idx = vmcs_read16(GUEST_PML_INDEX); /* Do nothing if PML buffer is empty */ if (pml_idx == (PML_ENTITY_NUM - 1)) return; /* PML index always points to next available PML buffer...
0
42,747
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE1(old_mmap, struct mmap_arg_struct __user *, arg) { struct mmap_arg_struct a; if (copy_from_user(&a, arg, sizeof(a))) return -EFAULT; if (offset_in_page(a.offset)) return -EINVAL; return ksys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT); } Commit Mess...
0
90,523
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: fm_sm_status_query ( IN p_fm_config_conx_hdlt hdl, IN fm_mgr_action_t action, OUT fm_sm_status_t *info, OUT fm_msg_ret_code_t *ret_code ) { p_hsm_com_client_hdl_t client_hdl; if ( (client_hdl = get_mgr_hdl(hdl,FM_MGR_SM)) != NULL ) { return fm_mgr_general_query(client_hdl,action...
0
96,251
Analyze the following 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 mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed) { struct mac80211_hwsim_data *data = hw->priv; struct ieee80211_conf *conf = &hw->conf; static const char *smps_modes[IEEE80211_SMPS_NUM_MODES] = { [IEEE80211_SMPS_AUTOMATIC] = "auto", [IEEE80211_SMPS_OFF] = "off", [IEEE80211_SMPS_STA...
0
83,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: void SoftwareEmulation(struct pt_regs *regs) { extern int do_mathemu(struct pt_regs *); extern int Soft_emulate_8xx(struct pt_regs *); int errcode; CHECK_FULL_REGS(regs); if (!user_mode(regs)) { debugger(regs); die("Kernel Mode Software FPU Emulation", regs, SIGFPE); } #ifdef CONFIG_MATH_EMULATION e...
0
74,717
Analyze the following 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 unconditional(const struct arpt_arp *arp) { static const struct arpt_arp uncond; return memcmp(arp, &uncond, sizeof(uncond)) == 0; } Commit Message: netfilter: x_tables: fix unconditional helper Ben Hawkes says: In the mark_source_chains function (net/ipv4/netfilter/ip_tables.c) it ...
1
167,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: static inline void npidentifier_cache_create(void) { g_npidentifier_cache = g_hash_table_new_full(NULL, NULL, NULL, (GDestroyNotify)npidentifier_info_destroy); } Commit Message: Support all the new variables added CWE ID: CWE-264
0
27,153
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: explicit TextfieldDestroyerController(views::Textfield* target) : target_(target) { target_->set_controller(this); } Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the se...
0
126,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 WebGraphicsContext3DCommandBufferImpl::postSubBufferCHROMIUM( int x, int y, int width, int height) { if (ShouldUseSwapClient()) swap_client_->OnViewContextSwapBuffersPosted(); gl_->PostSubBufferCHROMIUM(x, y, width, height); context_->Echo(base::Bind( &WebGraphicsContext3DCommandBufferImp...
0
109,192
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct dump_dir *wizard_open_directory_for_writing(const char *dump_dir_name) { struct dump_dir *dd = open_directory_for_writing(dump_dir_name, ask_continue_before_steal); if (dd && strcmp(g_dump_dir_name, dd->dd_dirname) != 0) { char *old_...
0
42,888
Analyze the following 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 ProcessRawBytes(const unsigned char* data, size_t data_length) { return ProcessRawBytesWithSeparators(data, data_length, ' ', '\n'); } Commit Message: return early from ProcessRawBytesWithSeperators() when data length is 0 BUG=109717 TEST=N/A Review URL: http://codereview.chromium.org/9169028 git...
0
107,551
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SpoolssReplyClosePrinter_q(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep) { /* Parse packet */ offset = dissect_nt_policy_hnd( tvb, offset, pinfo, tree, di, drep, hf_hnd, NULL, NULL, FALSE, TRUE); return offset; } Commit Message: SPOOL...
0
51,978
Analyze the following 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 BrowserTabStripController::TabMoved(TabContents* contents, int from_model_index, int to_model_index) { hover_tab_selector_.CancelTabTransition(); TabRendererData data; SetTabRendererDataFromModel(contents->web_contents()...
0
118,517
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: typename T::Param ProcessAndReadIPC() { base::RunLoop().RunUntilIdle(); const IPC::Message* message = render_thread_->sink().GetUniqueMessageMatching(T::ID); typename T::Param param; EXPECT_TRUE(message); if (message) T::Read(message, &param); return param; } Commit Mess...
0
139,902
Analyze the following 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 MSG_ReadDeltaKeyFloat( msg_t *msg, int key, float oldV ) { if ( MSG_ReadBits( msg, 1 ) ) { floatint_t fi; fi.i = MSG_ReadBits( msg, 32 ) ^ key; return fi.f; } return oldV; } Commit Message: Fix/improve buffer overflow in MSG_ReadBits/MSG_WriteBits Prevent reading past end of message in MSG_ReadB...
0
63,152
Analyze the following 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 EnabledSelectAll(LocalFrame& frame, Event*, EditorCommandSource source) { frame.GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); const VisibleSelection& selection = frame.Selection().ComputeVisibleSelectionInDOMTree(); ...
0
128,492
Analyze the following 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 __filemap_fdatawrite_range(struct address_space *mapping, loff_t start, loff_t end, int sync_mode) { int ret; struct writeback_control wbc = { .sync_mode = sync_mode, .nr_to_write = mapping->nrpages * 2, .range_start = start, .range_end = end, }; if (!mapping_cap_writeback_dirty(mapping)) r...
0
58,779
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int emulate_branch(unsigned short inst, struct pt_regs *regs) { /* * bfs: 8fxx: PC+=d*2+4; * bts: 8dxx: PC+=d*2+4; * bra: axxx: PC+=D*2+4; * bsr: bxxx: PC+=D*2+4 after PR=PC+4; * braf:0x23: PC+=Rn*2+4; * bsrf:0x03: PC+=Rn*2+4 after PR=PC+4; * jmp: 4x2b: PC=Rn; * jsr: 4x0b: PC=Rn afte...
0
25,555