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: ActiveDOMObject* V8TestNamedConstructor::toActiveDOMObject(v8::Handle<v8::Object> object) { return toNative(object); } Commit Message: [V8] Pass Isolate to throwNotEnoughArgumentsError() https://bugs.webkit.org/show_bug.cgi?id=86983 Reviewed by Adam Barth. The objective is to pass Isolate around in V...
0
23,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: static int parse_sid(struct cifs_sid *psid, char *end_of_acl) { /* BB need to add parm so we can store the SID BB */ /* validate that we do not go past end of ACL - sid must be at least 8 bytes long (assuming no sub-auths - e.g. the null SID */ if (end_of_acl < (char *)psid + 8) { cifs_dbg(VFS, "ACL too...
0
12,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 ff_put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size) { int i; /* read the pixels */ for (i = 0; i < 8; i++) { pixels[0] = av_clip_uint8(block[0]); pixels[1] = av_clip_uint8(block[1]); pixels[2] = av_c...
0
3,816
Analyze the following 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 GfxState::shift(double dx, double dy) { curX += dx; curY += dy; } Commit Message: CWE ID: CWE-189
0
18,930
Analyze the following 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 ExecuteMovePageUp(LocalFrame& frame, Event*, EditorCommandSource, const String&) { unsigned distance = VerticalScrollDistance(frame); if (!distance) return false; return ModifySelectionyWithPageGranular...
0
15,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: static void VoidMethodSequenceLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "voidMethodSequenceLongArg"); TestObject* impl = V8TestObject::ToImpl(info.Holder()); if (UNLIKELY(info.Length()...
0
16,316
Analyze the following 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 customSetterImplementedAsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); TestObjectPythonV8Internal::customSetterImplementedAsLongAttributeAttributeGetter(info); TRACE_EVENT...
0
22,611
Analyze the following 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 r_bin_dwarf_init_comp_unit(RBinDwarfCompUnit *cu) { if (!cu) { return -EINVAL; } cu->dies = calloc (sizeof (RBinDwarfDIE), COMP_UNIT_CAPACITY); if (!cu->dies) { return -ENOMEM; } cu->capacity = COMP_UNIT_CAPACITY; cu->length = 0; return 0; } Commit Message: Fix #8813 - segfault in dwarf pa...
0
26,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 LoadFile(const base::FilePath& file) { base::FilePath webui(FILE_PATH_LITERAL("webui")); RunTest(ui_test_utils::GetTestUrl(webui, file)); } Commit Message: WebUI: Include cr/ui/grid.js only on ChromeOS. Not used in any other platform. Bug: None Change-Id: I13cb2550ee38a828d8d266aeea5a8aa04695b...
0
28,159
Analyze the following 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 v8::Handle<v8::Value> unsignedLongLongAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.TestObj.unsignedLongLongAttr._get"); TestObj* imp = V8TestObj::toNative(info.Holder()); return v8::Number::New(static_cast<double>(imp->unsignedLongLongAttr())); } Co...
0
16,107
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DRM_ENUM_NAME_FN(drm_get_dirty_info_name, drm_dirty_info_enum_list) struct drm_conn_prop_enum_list { int type; char *name; int count; }; Commit Message: drm: integer overflow in drm_mode_dirtyfb_ioctl() There is a potential integer overflow in drm_mode_dirtyfb_ioctl() if userspace passes in a large num_c...
0
24,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: int handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi) { u32 uval, uninitialized_var(nval), mval; retry: if (get_user(uval, uaddr)) return -1; if ((uval & FUTEX_TID_MASK) == task_pid_vnr(curr)) { /* * Ok, this dying thread is truly holding a futex * of interest. Set the OWNER_D...
0
9,481
Analyze the following 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 ndis_set(USBNetState *s, uint32_t oid, uint8_t *inbuf, unsigned int inlen) { switch (oid) { case OID_GEN_CURRENT_PACKET_FILTER: s->filter = le32_to_cpup((le32 *) inbuf); if (s->filter) { s->rndis_state = RNDIS_DATA_INITIALIZED; } else { ...
0
5,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: int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) { struct nfs_inode *nfsi = NFS_I(inode); int ret = 0; if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) || nfs_attribute_timeout(inode) || NFS_STALE(inode)) { ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode); if (re...
0
9,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 int reset_config_defines(void *dummy) { ap_server_config_defines = saved_server_config_defines; saved_server_config_defines = NULL; server_config_defined_vars = NULL; return OK; } Commit Message: core: Disallow Methods' registration at run time (.htaccess), they may be used only if registe...
0
7,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: int ssl3_pending(const SSL *s) { if (s->rstate == SSL_ST_READ_BODY) return 0; return (s->s3->rrec.type == SSL3_RT_APPLICATION_DATA) ? s->s3->rrec.length : 0; } Commit Message: CWE ID: CWE-310
0
8,338
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DummyPageHolder& GetDummyPageHolder() const { return *dummy_page_holder_; } Commit Message: Move SelectionTemplate::is_handle_visible_ to FrameSelection This patch moves |is_handle_visible_| to |FrameSelection| from |SelectionTemplate| since handle visibility is used only for setting |FrameSelection|, hence i...
0
29,043
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_func) { uint32_t idx; Bucket *p; int result; IS_CONSISTENT(ht); HT_ASSERT(GC_REFCOUNT(ht) == 1); HASH_PROTECT_RECURSION(ht); for (idx = 0; idx < ht->nNumUsed; idx++) { p = ht->arData + idx; if (UNEXPECTED(Z_TYPE(p->val) == ...
0
14,962
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContext(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSTestObj::s_info)) return throwVMTypeError(exec); JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); ASSER...
0
15,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: GLint GLES2Implementation::GetProgramResourceLocationHelper( GLuint program, GLenum program_interface, const char* name) { typedef cmds::GetProgramResourceLocation::Result Result; SetBucketAsCString(kResultBucketId, name); auto result = GetResultAs<Result>(); if (!result) { return -1; } ...
0
23,404
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ExtensionFunctionDispatcher::ResetFunctions() { ExtensionFunctionRegistry::GetInstance()->ResetFunctions(); } Commit Message: Tighten restrictions on hosted apps calling extension APIs Only allow component apps to make any API calls, and for them only allow the namespaces they explicitly have permission ...
0
15,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 HB_Error Load_Anchor( HB_Anchor* an, HB_Stream stream ) { HB_Error error; HB_UInt cur_offset, new_offset, base_offset; base_offset = FILE_Pos(); if ( ACCESS_Frame( 2L ) ) return error; an->PosFormat = GET_UShort(); FORGET_Frame(); switch ( an->PosFormat ) { case ...
0
26,040
Analyze the following 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 cycle_packfile(void) { end_packfile(); start_packfile(); } Commit Message: prefer memcpy to strcpy When we already know the length of a string (e.g., because we just malloc'd to fit it), it's nicer to use memcpy than strcpy, as it makes it more obvious that we are not going to overflow the buffer ...
0
9,051
Analyze the following 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 KeyboardOverlayHandler::GetInputMethodId(const ListValue* args) { chromeos::input_method::InputMethodManager* manager = chromeos::input_method::InputMethodManager::GetInstance(); const chromeos::input_method::InputMethodDescriptor& descriptor = manager->current_input_method(); StringValue p...
0
6,194
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebTransformationMatrix WebTransformOperations::apply() const { WebTransformationMatrix toReturn; for (size_t i = 0; i < m_private->operations.size(); ++i) toReturn.multiply(m_private->operations[i].matrix); return toReturn; } Commit Message: [chromium] We should accelerate all transformation...
0
15,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 qrio_wdmask(u8 bit, bool wden) { u16 wdmask; void __iomem *qrio_base = (void *)CONFIG_SYS_QRIO_BASE; wdmask = in_be16(qrio_base + WDMASK_OFF); if (wden) wdmask |= (1 << bit); else wdmask &= ~(1 << bit); out_be16(qrio_base + WDMASK_OFF, wdmask); } Commit Message: Merge branch '2020-01-22-master-...
0
28,674
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GraphicsLayerFactory* ChromeClientImpl::graphicsLayerFactory() const { return m_webView->graphicsLayerFactory(); } Commit Message: Delete apparently unused geolocation declarations and include. BUG=336263 Review URL: https://codereview.chromium.org/139743014 git-svn-id: svn://svn.chromium.org/blink/trunk@...
0
11,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 free_descriptor_buffer(struct b43_dmaring *ring, struct b43_dmadesc_meta *meta) { if (meta->skb) { dev_kfree_skb_any(meta->skb); meta->skb = NULL; } } Commit Message: b43: allocate receive buffers big enough for max frame len + offset Otherwise, skb_put inside of dma_rx can fail... https://...
0
2,514
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void vhost_scsi_release_cmd(struct se_cmd *se_cmd) { struct vhost_scsi_cmd *tv_cmd = container_of(se_cmd, struct vhost_scsi_cmd, tvc_se_cmd); struct se_session *se_sess = tv_cmd->tvc_nexus->tvn_se_sess; int i; if (tv_cmd->tvc_sgl_count) { for (i = 0; i < tv_cmd->tvc_sgl_count; i++) put_page(s...
0
19,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: int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; } Commit Message: sysctl: restrict write access to dmesg_restrict When dmesg_restrict is set to 1 CAP_SYS_ADMIN is needed to read the kernel ring buffer. But a root user ...
0
26,681
Analyze the following 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 WebPageSerializerImpl::buildContentForNode(Node* node, SerializeDomParam* param) { switch (node->nodeType()) { case Node::ELEMENT_NODE: openTagToString(toElement(node), param); for (Node *child = node->firstChild(); child; child = child-...
0
13,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: ebt_register_table(struct net *net, const struct ebt_table *input_table) { struct ebt_table_info *newinfo; struct ebt_table *t, *table; struct ebt_replace_kernel *repl; int ret, i, countersize; void *p; if (input_table == NULL || (repl = input_table->table) == NULL || repl->entries == NULL || repl->en...
0
29,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: static __init int init_posix_cpu_timers(void) { struct k_clock process = { .clock_getres = process_cpu_clock_getres, .clock_get = process_cpu_clock_get, .clock_set = do_posix_clock_nosettime, .timer_create = process_cpu_timer_create, .nsleep = process_cpu_nsleep, .nsleep_restart = process_cpu_nsleep_...
0
10,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: static int crc32c_sparc64_digest(struct shash_desc *desc, const u8 *data, unsigned int len, u8 *out) { return __crc32c_sparc64_finup(crypto_shash_ctx(desc->tfm), data, len, out); } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "cryp...
0
18,501
Analyze the following 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_signalling_timer(UNUSED_ATTR tBTA_AV_DATA* p_data) { tBTA_AV_CB* p_cb = &bta_av_cb; int xx; uint8_t mask; tBTA_AV_LCB* p_lcb = NULL; APPL_TRACE_DEBUG("%s: conn_lcb=0x%x", __func__, p_cb->conn_lcb); for (xx = 0; xx < BTA_AV_NUM_LINKS; xx++) { p_lcb = &p_cb->lcb[xx]; mask = 1 << xx; ...
0
12,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: RenderWidgetHostViewChildFrame* child_rwhv() { return child_rwhv_; } Commit Message: Add a check for disallowing remote frame navigations to local resources. Previously, RemoteFrame navigations did not perform any renderer-side checks and relied solely on the browser-side logic to block disallowed navigations...
0
16,201
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebContentsImpl::WorkerCrashed() { if (delegate_) delegate_->WorkerCrashed(this); } Commit Message: Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 git-svn-id: svn://svn.chromium.org/chrome/...
0
23,911
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: template <typename T> static inline bool CheckIdType(T id, PPIdType type) { if (!id) return true; const T mask = (static_cast<T>(1) << kPPIdTypeBits) - 1; return (id & mask) == type; } Commit Message: Maintain a map of all resources in the resource tracker and clear instance back pointers when needed, ...
0
21,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: bool ChromeWebUIControllerFactory::UseWebUIBindingsForURL( content::BrowserContext* browser_context, const GURL& url) const { return !NeedsExtensionWebUI(NULL, Profile::FromBrowserContext(browser_context), url) && UseWebUIForURL(browser_cont...
0
21,644
Analyze the following 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_state_to_tss32(struct x86_emulate_ctxt *ctxt, struct tss_segment_32 *tss) { /* CR3 and ldt selector are not saved intentionally */ tss->eip = ctxt->_eip; tss->eflags = ctxt->eflags; tss->eax = reg_read(ctxt, VCPU_REGS_RAX); tss->ecx = reg_read(ctxt, VCPU_REGS_RCX); tss->edx = reg_read(c...
0
16,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: bool AppendEntry(const QuotaTableEntry& entry) { entries_.push_back(entry); return true; } Commit Message: Wipe out QuotaThreadTask. This is a one of a series of refactoring patches for QuotaManager. http://codereview.chromium.org/10872054/ http://codereview.chromium.org/10917060/ BUG=139270 Revie...
0
12,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: void WebContentsImpl::DidCallFocus() { ForSecurityDropFullscreen(); } Commit Message: Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser initiated navigation if they are not user initiated. Note: 'normal' ...
0
13,667
Analyze the following 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 process_smi_save_state_64(struct kvm_vcpu *vcpu, char *buf) { #ifdef CONFIG_X86_64 struct desc_ptr dt; struct kvm_segment seg; unsigned long val; int i; for (i = 0; i < 16; i++) put_smstate(u64, buf, 0x7ff8 - i * 8, kvm_register_read(vcpu, i)); put_smstate(u64, buf, 0x7f78, kvm_rip_read(vcpu...
0
28,472
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: process_compressed_8x8_brush_data(uint8 * in, uint8 * out, int Bpp) { int x, y, pal_index, in_index, shift, do2, i; uint8 *pal; in_index = 0; pal = in + 16; /* read it bottom up */ for (y = 7; y >= 0; y--) { /* 2 bytes per row */ x = 0; for (do2 = 0; do2 < 2; do2++) { /* 4 pixels per byte */ ...
0
26,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: isoclns_print(netdissect_options *ndo, const uint8_t *p, u_int length) { if (!ND_TTEST(*p)) { /* enough bytes on the wire ? */ ND_PRINT((ndo, "|OSI")); return; } if (ndo->ndo_eflag) ND_PRINT((ndo, "OSI NLPID %s (0x%02x): ", tok2str(nlpid_values, "Unknown", *p), *p)); switch (*p) { case NLPID_CLNP: ...
0
119
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_FUNCTION(unregister_tick_function) { zval *function; user_tick_function_entry tick_fe; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &function) == FAILURE) { return; } if (!BG(user_tick_functions)) { return; } if (Z_TYPE_P(function) != IS_ARRAY && Z_TYPE_P(function) != IS_OBJECT) { ...
0
17,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: iperf_get_test_get_server_output(struct iperf_test *ipt) { return ipt->get_server_output; } Commit Message: Fix a buffer overflow / heap corruption issue that could occur if a malformed JSON string was passed on the control channel. This issue, present in the cJSON library, was already fixed upstream, so wa...
0
20,431
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: asmlinkage void do_reserved(struct pt_regs *regs) { /* * Game over - no way to handle this if it ever occurs. Most probably * caused by a new unknown cpu type or after another deadly * hard/software error. */ show_regs(regs); panic("Caught reserved exception %ld - should not happen.", (regs->cp...
0
19,783
Analyze the following 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 reply_outbuf(struct smb_request *req, uint8 num_words, uint32 num_bytes) { char *outbuf; if (!create_outbuf(req, req, (char *)req->inbuf, &outbuf, num_words, num_bytes)) { smb_panic("could not allocate output buffer\n"); } req->outbuf = (uint8_t *)outbuf; } Commit Message: CWE ID:
0
22,877
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: partition_modify_data_new (DBusGMethodInvocation *context, Device *device, Device *enclosing_device, const char *type, const char *label, char **flags) { ModifyPartitionData *da...
0
11,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: static inline int set_dawr(struct arch_hw_breakpoint *brk) { unsigned long dawr, dawrx, mrd; dawr = brk->address; dawrx = (brk->type & (HW_BRK_TYPE_READ | HW_BRK_TYPE_WRITE)) \ << (63 - 58); //* read/write bits */ dawrx |= ((brk->type & (HW_BRK_TYPE_TRANSLATE)) >> 2) \ ...
0
13,883
Analyze the following 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 TCGMemOp mo_pushpop(DisasContext *s, TCGMemOp ot) { if (CODE64(s)) { return ot == MO_16 ? MO_16 : MO_64; } else { return ot; } } Commit Message: tcg/i386: Check the size of instruction being translated This fixes the bug: 'user-to-root privesc inside VM via bad translat...
0
15,563
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LayoutPoint RenderBlock::flipForWritingModeIncludingColumns(const LayoutPoint& point) const { ASSERT(hasColumns()); if (!hasColumns() || !style()->isFlippedBlocksWritingMode()) return point; ColumnInfo* colInfo = columnInfo(); LayoutUnit columnLogicalHeight = colInfo->columnHeight(); L...
0
13,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: static inline size_t GetPSDRowSize(Image *image) { if (image->depth == 1) return((image->columns+7)/8); else return(image->columns*GetPSDPacketSize(image)); } Commit Message: Fixed head buffer overflow reported in: https://github.com/ImageMagick/ImageMagick/issues/98 CWE ID: CWE-125
1
27,254
Analyze the following 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 module_data_cleanup(pam_handle_t *pamh, void *data, int error_status) { struct module_data *module_data = data; if (module_data) { if (1 == module_data->module_loaded) { PKCS11_release_all_slots(module_data->ctx, module_data->slots, module_data->nslots); PKCS11_CTX_unload(module_data->ctx); } P...
0
16,925
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_METHOD(snmp, __construct) { php_snmp_object *snmp_object; zval *object = getThis(); char *a1, *a2; size_t a1_len, a2_len; zend_long timeout = SNMP_DEFAULT_TIMEOUT; zend_long retries = SNMP_DEFAULT_RETRIES; zend_long version = SNMP_DEFAULT_VERSION; int argc = ZEND_NUM_ARGS(); snmp_object = Z_SNMP_P(o...
0
887
Analyze the following 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 sigchld_handler(int s) { int status; int* i; pid_t pid; while((pid=waitpid(-1, &status, WNOHANG)) > 0) { if(WIFEXITED(status)) { msg3(LOG_INFO, "Child exited with %d", WEXITSTATUS(status)); } i=g_hash_table_lookup(children, &pid); if(!i) { msg3(LOG_INFO, "SIGCHLD received for an unk...
0
1,729
Analyze the following 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 Extension::HasFullPermissions() const { base::AutoLock auto_lock(runtime_data_lock_); return runtime_data_.GetActivePermissions()->HasEffectiveFullAccess(); } Commit Message: Tighten restrictions on hosted apps calling extension APIs Only allow component apps to make any API calls, and for them only al...
0
27,538
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: encode_CLONE(const struct ofpact_nest *clone, enum ofp_version ofp_version, struct ofpbuf *out) { size_t len; const size_t ofs = out->size; struct ext_action_header *eah; eah = put_NXAST_CLONE(out); len = ofpacts_put_openflow_actions(clone->actions, ...
0
18,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: void ProfilingProcessHost::BrowserChildProcessLaunchedAndConnected( const content::ChildProcessData& data) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_NE(data.process_type, content::ProcessType::PROCESS_TYPE_RENDERER); if (!ShouldProfileProcessType(data.process_ty...
0
29,224
Analyze the following 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::ResponseReceived( Resource* resource, const ResourceResponse& response, std::unique_ptr<WebDataConsumerHandle> handle) { DCHECK_EQ(GetResource(), resource); DCHECK(!handle); DCHECK(frame_); application_cache_host_->DidReceiveResponseForMainResource(response); if (respo...
0
27,745
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: error::Error GLES2DecoderImpl::HandleDrawArrays(uint32_t immediate_data_size, const volatile void* cmd_data) { const volatile cmds::DrawArrays& c = *static_cast<const volatile cmds::DrawArrays*>(cmd_data); return DoDrawArrays("glDrawArrays", ...
0
23,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: void PushMessagingServiceImpl::Shutdown() { GetGCMDriver()->RemoveAppHandler(kPushMessagingAppIdentifierPrefix); HostContentSettingsMapFactory::GetForProfile(profile_)->RemoveObserver(this); } Commit Message: Remove some senseless indirection from the Push API code Four files to call one Java function. Let'...
0
21,777
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void FileSystemOperationRunner::DidCreateSnapshot( const OperationID id, SnapshotFileCallback callback, base::File::Error rv, const base::File::Info& file_info, const base::FilePath& platform_path, scoped_refptr<storage::ShareableFileReference> file_ref) { if (is_beginning_operation_) { ...
0
6,078
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: EntrySync::EntrySync(DOMFileSystemBase* fileSystem, const String& fullPath) : EntryBase(fileSystem, fullPath) { ScriptWrappable::init(this); } Commit Message: Oilpan: Ship Oilpan for SyncCallbackHelper, CreateFileResult and CallbackWrapper in filesystem/ These are leftovers when we shipped Oilpan for fi...
0
23,141
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ftp_chmod(ftpbuf_t *ftp, const int mode, const char *filename, const int filename_len) { char *buffer; if (ftp == NULL || filename_len <= 0) { return 0; } spprintf(&buffer, 0, "CHMOD %o %s", mode, filename); if (!ftp_putcmd(ftp, "SITE", buffer)) { efree(buffer); return 0; } efree(buffer); if (!...
0
12,129
Analyze the following 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 withScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), jsValue)); imp->s...
0
16,027
Analyze the following 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 js_Function *newfun(js_State *J, js_Ast *name, js_Ast *params, js_Ast *body, int script) { js_Function *F = js_malloc(J, sizeof *F); memset(F, 0, sizeof *F); F->gcmark = 0; F->gcnext = J->gcfun; J->gcfun = F; ++J->gccounter; F->filename = js_intern(J, J->filename); F->line = name ? name->line : pa...
0
7,005
Analyze the following 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 HeadlessPrintManager::OnScriptedPrint( const PrintHostMsg_ScriptedPrint_Params& params, IPC::Message* reply_msg) { PageRangeStatus status = PageRangeTextToPages(page_ranges_text_, ignore_invalid_page_ranges_, params.expected_pages_count, &print_params_->pages); sw...
0
13,279
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual ~SyncMessageStatusReceiver() {} Commit Message: Revert 143656 - Add an IPC channel between the NaCl loader process and the renderer. BUG=116317 TEST=ppapi, nacl tests, manual testing for experimental IPC proxy. Review URL: https://chromiumcodereview.appspot.com/10641016 TBR=bbudge@chromium.org Review ...
0
264
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: views::View* AutofillDialogViews::CreateInputsContainer(DialogSection section) { views::View* info_view = new views::View(); info_view->SetLayoutManager( new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); DetailsGroup* group = GroupForSection(section); group->manual_input = new views::Vie...
0
10,813
Analyze the following 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 hci_sock_release(struct socket *sock) { struct sock *sk = sock->sk; struct hci_dev *hdev; BT_DBG("sock %p sk %p", sock, sk); if (!sk) return 0; hdev = hci_pi(sk)->hdev; if (hci_pi(sk)->channel == HCI_CHANNEL_MONITOR) atomic_dec(&monitor_promisc); bt_sock_unlink(&hci_sk_list, sk); if (...
0
12,511
Analyze the following 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 RConfigNode* r_config_set(RConfig *cfg, const char *name, const char *value) { RConfigNode *node = NULL; char *ov = NULL; ut64 oi; if (!cfg || STRNULL (name)) { return NULL; } node = r_config_node_get (cfg, name); if (node) { if (node->flags & CN_RO) { eprintf ("(error: '%s' config key is read...
1
26,883
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ShellWindowGeometryCache* ExtensionSystemImpl::shell_window_geometry_cache() { return shared_->shell_window_geometry_cache(); } Commit Message: Check prefs before allowing extension file access in the permissions API. R=mpcomplete@chromium.org BUG=169632 Review URL: https://chromiumcodereview.appspot.co...
0
24,150
Analyze the following 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 LocalDOMWindow::orientation() const { DCHECK(RuntimeEnabledFeatures::OrientationEventEnabled()); if (!GetFrame() || !GetFrame()->GetPage()) return 0; int orientation = GetFrame() ->GetPage() ->GetChromeClient() .GetScreenInfo(...
0
25,673
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderFrameImpl::PopulateDocumentStateFromPending( DocumentState* document_state) { document_state->set_request_time( pending_navigation_params_->request_params.request_time); InternalDocumentStateData* internal_data = InternalDocumentStateData::FromDocumentState(document_state); if (...
0
16,053
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: interpt_sl(LSEG *lseg, LINE *line) { LINE tmp; Point *p; line_construct_pts(&tmp, &lseg->p[0], &lseg->p[1]); p = line_interpt_internal(&tmp, line); #ifdef GEODEBUG printf("interpt_sl- segment is (%.*g %.*g) (%.*g %.*g)\n", DBL_DIG, lseg->p[0].x, DBL_DIG, lseg->p[0].y, DBL_DIG, lseg->p[1].x, DBL_DIG...
0
28,095
Analyze the following 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 std::string& WebContentsImpl::GetEncoding() const { return encoding_; } Commit Message: Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22502...
0
11,557
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int MagickDLLCall PostscriptDelegateMessage(void *handle, const char *message,int length) { char **messages; ssize_t offset; offset=0; messages=(char **) handle; if (*messages == (char *) NULL) *messages=(char *) AcquireQuantumMemory(length+1,sizeof(char *)); else { of...
0
9,834
Analyze the following 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 hugetlbfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) { struct inode *inode; int error = -ENOSPC; inode = hugetlbfs_get_inode(dir->i_sb, dir, mode, dev); if (inode) { dir->i_ctime = dir->i_mtime = CURRENT_TIME; d_instantiate(dentry, inode); dget(dentry); /* Ex...
0
12,896
Analyze the following 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 md4_update(struct shash_desc *desc, const u8 *data, unsigned int len) { struct md4_ctx *mctx = shash_desc_ctx(desc); const u32 avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f); mctx->byte_count += len; if (avail > len) { memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), ...
0
21,687
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GLES2Implementation::CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsize...
0
28,885
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebRuntimeFeatures::EnableRenderingPipelineThrottling(bool enable) { RuntimeEnabledFeatures::SetRenderingPipelineThrottlingEnabled(enable); } Commit Message: Remove RequireCSSExtensionForFile runtime enabled flag. The feature has long since been stable (since M64) and doesn't seem to be a need for this...
0
20,914
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ssize_t splice_to_pipe(struct pipe_inode_info *pipe, struct splice_pipe_desc *spd) { unsigned int spd_pages = spd->nr_pages; int ret = 0, page_nr = 0; if (!spd_pages) return 0; if (unlikely(!pipe->readers)) { send_sig(SIGPIPE, current, 0); ret = -EPIPE; goto out; } while (pipe->nrbufs < ...
0
26,254
Analyze the following 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 smbXcli_negprot_invalid_done(struct tevent_req *subreq) { struct tevent_req *req = tevent_req_callback_data(subreq, struct tevent_req); NTSTATUS status; /* * we just want the low level error */ status = tevent_req_simple_recv_ntstatus(subreq); TALLOC_FREE(subreq); if (tevent_req_nterror...
0
15,875
Analyze the following 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 RenderObject* rendererForScrollbar(RenderObject& renderer) { if (Node* node = renderer.node()) { if (ShadowRoot* shadowRoot = node->containingShadowRoot()) { if (shadowRoot->type() == ShadowRoot::UserAgentShadowRoot) return shadowRoot->host()->renderer(); ...
0
8,455
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo) { struct proc_dir_entry *p; int rc = 0; afinfo->seq_fops.open = udp_seq_open; afinfo->seq_fops.read = seq_read; afinfo->seq_fops.llseek = seq_lseek; afinfo->seq_fops.release = seq_release_net; afinfo->seq_ops.start = udp_seq_start;...
0
28,403
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int jpc_poc_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in) { jpc_poc_t *poc = &ms->parms.poc; jpc_pocpchg_t *pchg; int pchgno; uint_fast8_t tmp; poc->numpchgs = (cstate->numcomps > 256) ? (ms->len / 9) : (ms->len / 7); if (!(poc->pchgs = jas_alloc2(poc->numpchgs, sizeof(jpc_pocpchg...
0
11,102
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ofpact_put(struct ofpbuf *ofpacts, enum ofpact_type type, size_t len) { struct ofpact *ofpact; ofpacts->header = ofpbuf_put_uninit(ofpacts, len); ofpact = ofpacts->header; ofpact_init(ofpact, type, len); return ofpact; } Commit Message: ofp-actions: Avoid buffer overread in BUNDLE action dec...
0
23,458
Analyze the following 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 TraceEventTestFixture::FindNonMatchingValue(const char* key, const char* value) { JsonKeyValue key_values[] = { {key, value, IS_NOT_EQUAL}, {0, 0, IS_EQUAL} }; return FindMatchingTraceEntry(key_values); } Commit Message: Tracing: Add support for...
0
15,601
Analyze the following 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 put_links(struct ctl_table_header *header) { struct ctl_table_set *root_set = &sysctl_table_root.default_set; struct ctl_table_root *root = header->root; struct ctl_dir *parent = header->parent; struct ctl_dir *core_parent; struct ctl_table *entry; if (header->set == root_set) return; core_...
0
10,279
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int ciebasecolor(i_ctx_t * i_ctx_p, ref *space, int base, int *stage, int *cont, int *stack_depth) { os_ptr op; ref *spacename, nref; int i, components=1, code; /* If the spaece is an array, the first element is always the name */ if (r_is_array(space)) spacename = space->value...
0
19,493
Analyze the following 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 Texture::Destroy() { if (id_ != 0) { ScopedGLErrorSuppressor suppressor(decoder_); glDeleteTextures(1, &id_); id_ = 0; estimated_size_ = 0; decoder_->UpdateBackbufferMemoryAccounting(); } } Commit Message: Always write data to new buffer in SimulateAttrib0 This is to work around lin...
0
22,169
Analyze the following 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 OnCryptohomeNeedsDircryptoMigrationCallback( const AccountId& account_id, base::Optional<bool> needs_migration) { if (!needs_migration.has_value()) { LOG(ERROR) << "Failed to call cryptohome NeedsDircryptoMigration."; UpdateUI(account_id, false); return; } needs_d...
0
4,220
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SMB2_logoff(const unsigned int xid, struct cifs_ses *ses) { struct smb_rqst rqst; struct smb2_logoff_req *req; /* response is also trivial struct */ int rc = 0; struct TCP_Server_Info *server; int flags = 0; unsigned int total_len; struct kvec iov[1]; struct kvec rsp_iov; int resp_buf_type; cifs_dbg(FY...
0
4,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 log_write(void __user *log_base, u64 write_address, u64 write_length) { u64 write_page = write_address / VHOST_PAGE_SIZE; int r; if (!write_length) return 0; write_length += write_address % VHOST_PAGE_SIZE; for (;;) { u64 base = (u64)(unsigned long)log_base; u64 log = base + write_pa...
0
20,643
Analyze the following 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 zend_object_value spl_filesystem_object_new_check(zend_class_entry *class_type TSRMLS_DC) { zend_object_value ret = spl_filesystem_object_new_ex(class_type, NULL TSRMLS_CC); ret.handlers = &spl_filesystem_object_check_handlers; return ret; } Commit Message: Fix bug #72262 - do not overflow int CWE ID: ...
0
23,989
Analyze the following 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 ssh_gotdata(Ssh ssh, const unsigned char *data, int datalen) { /* Log raw data, if we're in that mode. */ if (ssh->logctx) log_packet(ssh->logctx, PKT_INCOMING, -1, NULL, data, datalen, 0, NULL, NULL, 0, NULL); crBegin(ssh->ssh_gotdata_crstate); /* * To begin with, feed th...
0
1,525
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC) { return php_copy_file_ctx(src, dest, 0, NULL TSRMLS_CC); } Commit Message: Fix bug #72114 - int/size_t confusion in fread CWE ID: CWE-190
0
24,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: static int midi_setup_smpteoffset(struct _mdi *mdi, uint32_t setting) { MIDI_EVENT_DEBUG(__FUNCTION__,0, setting); _WM_CheckEventMemoryPool(mdi); mdi->events[mdi->event_count].do_event = *_WM_do_meta_smpteoffset; mdi->events[mdi->event_count].event_data.channel = 0; mdi->events[mdi->event_coun...
0
958