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: static bool PrecisionMeetsSpecForHighpFloat(GLint rangeMin,
GLint rangeMax,
GLint precision) {
return (rangeMin >= 62) && (rangeMax >= 62) && (precision >= 16);
}
Commit Message: Framebuffer clear() needs to consider the si... | 0 | 6,421 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void* message_thread(void *input)
{
omx_vdec* omx = reinterpret_cast<omx_vdec*>(input);
unsigned char id;
int n;
DEBUG_PRINT_HIGH("omx_vdec: message thread start");
prctl(PR_SET_NAME, (unsigned long)"VideoDecMsgThread", 0, 0, 0);
while (1) {
n = read(omx->m_pipe_in, &id, 1);
if (0 == n)... | 0 | 21,230 |
Analyze the following 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 | 2,396 |
Analyze the following 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::GetInterface(
const std::string& interface_name,
mojo::ScopedMessagePipeHandle interface_pipe) {
if (!registry_ ||
!registry_->TryBindInterface(interface_name, &interface_pipe)) {
delegate_->OnInterfaceRequest(this, interface_name, &interface_pipe);
if (interface_... | 0 | 29,917 |
Analyze the following 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 ContentBrowserClient::AllowSetCookie(const GURL& url,
const GURL& first_party,
const std::string& cookie_line,
ResourceContext* context,
int ... | 0 | 17,788 |
Analyze the following 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 userfaultfd_ctx_get(struct userfaultfd_ctx *ctx)
{
if (!atomic_inc_not_zero(&ctx->refcount))
BUG();
}
Commit Message: userfaultfd: shmem/hugetlbfs: only allow to register VM_MAYWRITE vmas
After the VMA to register the uffd onto is found, check that it has
VM_MAYWRITE set before allowing registrat... | 0 | 25,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 Smb4KGlobal::clearHostsList()
{
mutex.lock();
while ( !p->hostsList.isEmpty() )
{
delete p->hostsList.takeFirst();
}
mutex.unlock();
}
Commit Message:
CWE ID: CWE-20 | 0 | 21,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: static int kiocb_cancel(struct kioctx *ctx, struct kiocb *kiocb)
{
kiocb_cancel_fn *old, *cancel;
/*
* Don't want to set kiocb->ki_cancel = KIOCB_CANCELLED unless it
* actually has a cancel function, hence the cmpxchg()
*/
cancel = ACCESS_ONCE(kiocb->ki_cancel);
do {
if (!cancel || cancel == KIOCB_C... | 0 | 8,784 |
Analyze the following 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 StreamTcpTest24(void)
{
StreamTcpThread stt;
TcpSession ssn;
Packet *p = SCMalloc(SIZE_OF_PACKET);
FAIL_IF (p == NULL);
Flow f;
TCPHdr tcph;
uint8_t packet[1460] = "";
ThreadVars tv;
PacketQueue pq;
memset(&pq,0,sizeof(PacketQueue));
StreamTcpUTInit(&stt.ra_... | 0 | 10,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: int kvm_set_shared_msr(unsigned slot, u64 value, u64 mask)
{
unsigned int cpu = smp_processor_id();
struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu);
int err;
if (((value ^ smsr->values[slot].curr) & mask) == 0)
return 0;
smsr->values[slot].curr = value;
err = wrmsrl_safe(shared_msrs_global.m... | 0 | 21,021 |
Analyze the following 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 void Bar() {}
Commit Message: [oilpan] Fix GCInfoTable for multiple threads
Previously, grow and access from different threads could lead to a race
on the table backing; see bug.
- Rework the table to work on an existing reservation.
- Commit upon growing, avoiding any copies.
Drive-by: Fix over-all... | 0 | 28,590 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int is_large_pte(u64 pte)
{
return pte & PT_PAGE_SIZE_MASK;
}
Commit Message: nEPT: Nested INVEPT
If we let L1 use EPT, we should probably also support the INVEPT instruction.
In our current nested EPT implementation, when L1 changes its EPT table
for L2 (i.e., EPT12), L0 modifies the shadow EPT table ... | 0 | 14,200 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: gfx::Rect LayerTreeHostImpl::DeviceViewport() const {
if (external_viewport_.IsEmpty())
return gfx::Rect(device_viewport_size_);
return external_viewport_;
}
Commit Message: (Reland) Discard compositor frames from unloaded web content
This is a reland of https://codereview.chromium.org/2707243005/ with... | 0 | 26,340 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: V8InspectorImpl* unwrapInspector(const v8::FunctionCallbackInfo<v8::Value>& info)
{
DCHECK(!info.Data().IsEmpty());
DCHECK(info.Data()->IsExternal());
V8InspectorImpl* inspector = static_cast<V8InspectorImpl*>(info.Data().As<v8::External>()->Value());
DCHECK(inspector);
return inspector;
}
Co... | 0 | 20,933 |
Analyze the following 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 l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk,
struct msghdr *msg, size_t len, int noblock,
int flags, int *addr_len)
{
struct ipv6_pinfo *np = inet6_sk(sk);
struct sockaddr_l2tpip6 *lsa = (struct sockaddr_l2tpip6 *)msg->msg_name;
size_t copied = 0;
int err = -EOPNOTSUPP;
stru... | 1 | 20,859 |
Analyze the following 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 setJSTestObjStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
impl->setStringAttr(ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
... | 0 | 28,103 |
Analyze the following 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_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array)
{
zval row;
char *field_name;
size_t num_fields;
int pg_numrows, pg_row;
uint i;
assert(Z_TYPE_P(ret_array) == IS_ARRAY);
if ((pg_numrows = PQntuples(pg_result)) <= 0) {
return FAILURE;
}
for (pg_row = 0; pg_row < pg_numro... | 0 | 1,115 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: local size_t num(char *arg)
{
char *str = arg;
size_t val = 0;
if (*str == 0)
bail("internal error: empty parameter", "");
do {
if (*str < '0' || *str > '9' ||
(val && ((~(size_t)0) - (*str - '0')) / val < 10))
bail("invalid numeric parameter: ", arg);
... | 0 | 19,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: String Location::protocol() const {
return DOMURLUtilsReadOnly::protocol(Url());
}
Commit Message: Check the source browsing context's CSP in Location::SetLocation prior to dispatching a navigation to a `javascript:` URL.
Makes `javascript:` navigations via window.location.href compliant with
https://html.spe... | 0 | 28,097 |
Analyze the following 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 ip_route_input_common(struct sk_buff *skb, __be32 daddr, __be32 saddr,
u8 tos, struct net_device *dev, bool noref)
{
struct rtable * rth;
unsigned hash;
int iif = dev->ifindex;
struct net *net;
int res;
net = dev_net(dev);
rcu_read_lock();
if (!rt_caching(net))
goto skip_cache;
tos &= IPT... | 0 | 22,506 |
Analyze the following 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 tBTA_AV_CODE bta_av_op_supported(tBTA_AV_RC rc_id, bool is_inquiry) {
tBTA_AV_CODE ret_code = AVRC_RSP_NOT_IMPL;
if (p_bta_av_rc_id) {
if (is_inquiry) {
if (p_bta_av_rc_id[rc_id >> 4] & (1 << (rc_id & 0x0F))) {
ret_code = AVRC_RSP_IMPL_STBL;
}
} else {
if (p_bta_av_rc_id[rc_id >> 4] & (1 <... | 0 | 24,817 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: LayoutUnit LayoutBlockFlow::logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const
{
if (m_floatingObjects && m_floatingObjects->hasLeftObjects())
return m_floatingObjects->logicalLeftOffset(fixedOffset, logicalTop, logicalHeight);
return fixe... | 0 | 24,954 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: size_t GetMaxParallelPreload() {
if (base::FeatureList::IsEnabled(media::kLimitParallelMediaPreloading))
return kMaxParallelPreload;
return std::numeric_limits<size_t>::max();
}
Commit Message: Simplify "WouldTaintOrigin" concept in media/blink
Currently WebMediaPlayer has three predicates:
- DidGetOpa... | 0 | 9,182 |
Analyze the following 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 ath_buf *ath_tx_get_buffer(struct ath_softc *sc)
{
struct ath_buf *bf = NULL;
spin_lock_bh(&sc->tx.txbuflock);
if (unlikely(list_empty(&sc->tx.txbuf))) {
spin_unlock_bh(&sc->tx.txbuflock);
return NULL;
}
bf = list_first_entry(&sc->tx.txbuf, struct ath_buf, list);
list_del(&bf->list);
... | 0 | 13,388 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static MagickBooleanType WriteIPLImage(const ImageInfo *image_info,Image *image)
{
ExceptionInfo
*exception;
IPLInfo
ipl_info;
MagickBooleanType
status;
MagickOffsetType
scene;
register const PixelPacket
*p;
QuantumInfo
*quantum_info;
ssize_t
y;
unsigned char
... | 0 | 20,686 |
Analyze the following 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::DidFlushPaint() {
pepper_helper_->ViewFlushedPaint();
if (!webview())
return;
WebFrame* main_frame = webview()->mainFrame();
if (!main_frame->provisionalDataSource()) {
WebDataSource* ds = main_frame->dataSource();
DocumentState* document_state = DocumentState::FromData... | 0 | 16,376 |
Analyze the following 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 GpuProcessHost::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
int client_id,
const gpu::SyncToken& sync_token) {
TRACE_EVENT0("gpu", "GpuProcessHost::DestroyGpuMemoryBuffer");
gpu_service_ptr_->DestroyGpuMemoryBuf... | 0 | 21,448 |
Analyze the following 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 const char *retrieve_id_from_card_name(const char *name)
{
const char *spos = name;
while (*name) {
if (isspace(*name) && isalnum(name[1]))
spos = name + 1;
name++;
}
return spos;
}
Commit Message: ALSA: control: Protect user controls against concurrent access
The user-control put and get han... | 0 | 24,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 int putreg32(struct task_struct *child, unsigned regno, u32 value)
{
struct pt_regs *regs = task_pt_regs(child);
switch (regno) {
SEG32(cs);
SEG32(ds);
SEG32(es);
SEG32(fs);
SEG32(gs);
SEG32(ss);
R32(ebx, bx);
R32(ecx, cx);
R32(edx, dx);
R32(edi, di);
R32(esi, si);
R32(ebp, bp);
R32(eax, ... | 0 | 26,840 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void check_reg_overflow(struct bpf_reg_state *reg)
{
if (reg->max_value > BPF_REGISTER_MAX_RANGE)
reg->max_value = BPF_REGISTER_MAX_RANGE;
if (reg->min_value < BPF_REGISTER_MIN_RANGE ||
reg->min_value > BPF_REGISTER_MAX_RANGE)
reg->min_value = BPF_REGISTER_MIN_RANGE;
}
Commit Message: bpf: don'... | 0 | 15,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: static inline bool classStringHasClassName(const CharacterType* characters, unsigned length)
{
ASSERT(length > 0);
unsigned i = 0;
do {
if (isNotHTMLSpace(characters[i]))
break;
++i;
} while (i < length);
return i < length;
}
Commit Message: Set Attr.ownerDocumen... | 0 | 11,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: PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns)
{
zval *id;
xmlDocPtr docp;
int uri_len, name_len;
dom_object *intern, *namednode;
char *uri, *name;
xmlChar *local, *nsuri;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_document_class_entry, &uri, &uri_len, &... | 0 | 4,503 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: bool SyncBackendHost::RequestClearServerData() {
sync_thread_.message_loop()->PostTask(FROM_HERE,
base::Bind(&SyncBackendHost::Core::DoRequestClearServerData,
core_.get()));
return true;
}
Commit Message: [Sync] Cleanup all tab sync enabling logic now that its on by default.
BUG=none
... | 0 | 11,760 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void test_at()
{
assert_true_rule(
"rule test { \
strings: $a = \"ssi\" \
condition: $a at 2 and $a at 5 }",
"mississippi");
assert_true_rule(
"rule test { \
strings: $a = \"mis\" \
condition: $a at ~0xFF & 0xFF }",
"mississippi");
assert_true... | 0 | 13,465 |
Analyze the following 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 ieee80211_csa_finish(struct ieee80211_vif *vif)
{
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
ieee80211_queue_work(&sdata->local->hw,
&sdata->csa_finalize_work);
}
Commit Message: mac80211: fix fragmentation code, particularly for encryption
The "new" fragmentation code (since my re... | 0 | 18,333 |
Analyze the following 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 blit_region_is_unsafe(struct CirrusVGAState *s,
int32_t pitch, int32_t addr)
{
if (!pitch) {
return true;
}
if (pitch < 0) {
int64_t min = addr
+ ((int64_t)s->cirrus_blt_height-1) * pitch;
int32_t max = addr
... | 0 | 27,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 vmx_free_vcpu_nested(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
int r;
r = vcpu_load(vcpu);
BUG_ON(r);
vmx_load_vmcs01(vcpu);
free_nested(vmx);
vcpu_put(vcpu);
}
Commit Message: kvm: nVMX: Allow L1 to intercept software exceptions (... | 0 | 11,145 |
Analyze the following 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 inode_sb_list_add(struct inode *inode)
{
spin_lock(&inode->i_sb->s_inode_list_lock);
list_add(&inode->i_sb_list, &inode->i_sb->s_inodes);
spin_unlock(&inode->i_sb->s_inode_list_lock);
}
Commit Message: Fix up non-directory creation in SGID directories
sgid directories have special semantics, making newl... | 0 | 3,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: COMPAT_SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes,
const struct compat_mq_attr __user *, u_mqstat,
struct compat_mq_attr __user *, u_omqstat)
{
int ret;
struct mq_attr mqstat, omqstat;
struct mq_attr *new = NULL, *old = NULL;
if (u_mqstat) {
new = &mqstat;
if (get_compat_mq_attr(new, u... | 0 | 9,972 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: GBool FlateStream::readDynamicCodes() {
int numCodeLenCodes;
int numLitCodes;
int numDistCodes;
int codeLenCodeLengths[flateMaxCodeLenCodes];
FlateHuffmanTab codeLenCodeTab;
int len, repeat, code;
int i;
codeLenCodeTab.codes = NULL;
if ((numLitCodes = getCodeWord(5)) == EOF) {
goto err;
... | 0 | 25 |
Analyze the following 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_panic_on_oom(struct oom_control *oc,
enum oom_constraint constraint)
{
if (likely(!sysctl_panic_on_oom))
return;
if (sysctl_panic_on_oom != 2) {
/*
* panic_on_oom == 1 only affects CONSTRAINT_NONE, the kernel
* does not panic for cpuset, mempolicy, or memcg allocation
* ... | 0 | 7,034 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: tsize_t t2p_write_pdf_stream_dict(tsize_t len, uint32 number, TIFF* output){
tsize_t written=0;
char buffer[32];
int buflen=0;
written += t2pWriteFile(output, (tdata_t) "/Length ", 8);
if(len!=0){
written += t2p_write_pdf_stream_length(len, output);
} else {
buflen=snprintf(buffer, sizeof(buffer), "... | 0 | 5,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 RList *r_bin_wasm_get_sections_by_id (RList *sections, ut8 id) {
RBinWasmSection *sec = NULL;
RList *ret = NULL;
RListIter *iter = NULL;
if (!(ret = r_list_new ())) {
return NULL;
}
r_list_foreach (sections, iter, sec) {
if (sec->id == id) {
r_list_append(ret, sec);
}
}
return ret;
}
Co... | 0 | 15,516 |
Analyze the following 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 khugepaged_defrag_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
return single_flag_show(kobj, attr, buf,
TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG);
}
Commit Message: mm: thp: fix /dev/zero MAP_PRIVATE and vm_flags cleanups
The huge_memory.c THP page fault ... | 0 | 1,678 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: format_SET_TUNNEL(const struct ofpact_tunnel *a, struct ds *s)
{
ds_put_format(s, "%sset_tunnel%s:%s%#"PRIx64, colors.param,
(a->tun_id > UINT32_MAX
|| a->ofpact.raw == NXAST_RAW_SET_TUNNEL64 ? "64" : ""),
colors.end, a->tun_id);
}
Commit Message: ofp-ac... | 0 | 10,128 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: pkinit_server_return_padata(krb5_context context,
krb5_pa_data * padata,
krb5_data *req_pkt,
krb5_kdc_req * request,
krb5_kdc_rep * reply,
krb5_keyblock * encrypting_key,
... | 0 | 22,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: const btav_sink_interface_t* btif_av_get_sink_interface(void) {
BTIF_TRACE_EVENT("%s", __func__);
return &bt_av_sink_interface;
}
Commit Message: DO NOT MERGE AVRC: Copy browse.p_browse_data in btif_av_event_deep_copy
p_msg_src->browse.p_browse_data is not copied, but used after the
original pointer is freed... | 0 | 27,396 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: long video_ioctl2(struct file *file,
unsigned int cmd, unsigned long arg)
{
char sbuf[128];
void *mbuf = NULL;
void *parg = (void *)arg;
long err = -EINVAL;
bool has_array_args;
size_t array_size = 0;
void __user *user_ptr = NULL;
void **kernel_ptr = NULL;
/* Copy arguments into temp ke... | 1 | 5,039 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: pdf_dict_getsa(fz_context *ctx, pdf_obj *obj, const char *key, const char *abbrev)
{
pdf_obj *v;
v = pdf_dict_gets(ctx, obj, key);
if (v)
return v;
return pdf_dict_gets(ctx, obj, abbrev);
}
Commit Message:
CWE ID: CWE-416 | 0 | 15,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: xsltDefaultProcessOneNode(xsltTransformContextPtr ctxt, xmlNodePtr node,
xsltStackElemPtr params) {
xmlNodePtr copy;
xmlNodePtr delete = NULL, cur;
int nbchild = 0, oldSize;
int childno = 0, oldPos;
xsltTemplatePtr template;
CHECK_STOPPED;
/*
* Handling of leaves
*/
... | 0 | 7,593 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: fetch_named_backref_token(OnigCodePoint c, OnigToken* tok, UChar** src,
UChar* end, ScanEnv* env)
{
int r, num;
const OnigSyntaxType* syn = env->syntax;
UChar* prev;
UChar* p = *src;
UChar* name_end;
int* backs;
int back_num;
prev = p;
# ifdef USE_BACKREF_WITH_LEVEL
name_end = NULL_UCHARP... | 0 | 24,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: void __init kmem_cache_init(void)
{
int i;
BUILD_BUG_ON(sizeof(((struct page *)NULL)->lru) <
sizeof(struct rcu_head));
kmem_cache = &kmem_cache_boot;
if (!IS_ENABLED(CONFIG_NUMA) || num_possible_nodes() == 1)
use_alien_caches = 0;
for (i = 0; i < NUM_INIT_LISTS; i++)
kmem_cache_node_init(&init_km... | 0 | 21,559 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc)
{ SF_PRIVATE *psf ;
if ((SF_CONTAINER (sfinfo->format)) == SF_FORMAT_SD2)
{ sf_errno = SFE_SD2_FD_DISALLOWED ;
return NULL ;
} ;
if ((psf = calloc (1, sizeof (SF_PRIVATE))) == NULL)
{ sf_errno = SFE_MALLOC_FAILED ;
return NULL ;
}... | 1 | 1,329 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: minimum_cellspacing(int border_mode)
{
switch (border_mode) {
case BORDER_THIN:
case BORDER_THICK:
case BORDER_NOWIN:
return RULE_WIDTH;
case BORDER_NONE:
return 1;
default:
/* not reached */
return 0;
}
}
Commit Message: Prevent negative indent value in feed_table_block_tag()
Bu... | 0 | 4,849 |
Analyze the following 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 imdct_step3_inner_s_loop_ld654(int n, float *e, int i_off, float *A, int base_n)
{
int a_off = base_n >> 3;
float A2 = A[0+a_off];
float *z = e + i_off;
float *base = z - 16 * n;
while (z > base) {
float k00,k11;
k00 = z[-0] - z[-8];
k11 = z[-1] - z[-9];
z[... | 0 | 603 |
Analyze the following 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_noteon(struct _mdi *mdi, uint8_t channel,
uint8_t note, uint8_t velocity) {
MIDI_EVENT_DEBUG(__FUNCTION__,channel, note);
_WM_CheckEventMemoryPool(mdi);
mdi->events[mdi->event_count].do_event = *_WM_do_note_on;
mdi->events[mdi->event_count].event_... | 0 | 15,347 |
Analyze the following 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 LvmBundle_process(LVM_INT16 *pIn,
LVM_INT16 *pOut,
int frameCount,
EffectContext *pContext){
LVM_ControlParams_t ActiveParams; /* Current control Parameters */
LVM_ReturnStatus_en LvmStatus = LVM_SUCCESS; /* Function call status */
LVM_INT16 ... | 0 | 29,873 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ConsumesTouchMovesDelegate() : consume_touch_move_(true) {}
Commit Message: Pass ui::LatencyInfo correct with unified gesture detector on Aura.
BUG=379812
TEST=GestureRecognizerTest.LatencyPassedFromTouchEvent
Review URL: https://codereview.chromium.org/309823002
git-svn-id: svn://svn.chromium.org/chrome/tr... | 0 | 28,789 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: sa_fini(sa_handle_t handle)
{
sa_handle_impl_t impl_handle = (sa_handle_impl_t)handle;
sa_share_impl_t impl_share, next;
sa_share_impl_t *pcurr;
if (impl_handle == NULL)
return;
/*
* clean up shares which don't have a non-NULL dataset property,
* which means they're in sharetab but we couldn't find t... | 0 | 27,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: InputEventAckNotificationObserver::~InputEventAckNotificationObserver() {}
Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt.
BUG=107201
TEST=no visible change
Review URL: https://chromiumcodereview.appspot.com/11293205
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 003... | 0 | 23,924 |
Analyze the following 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 TraceArcPath(PrimitiveInfo *primitive_info,const PointInfo start,
const PointInfo end,const PointInfo arc,const double angle,
const MagickBooleanType large_arc,const MagickBooleanType sweep)
{
double
alpha,
beta,
delta,
factor,
gamma,
theta;
PointInfo
center,
p... | 0 | 26,658 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void reflectedTreatNullAsNullStringCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
TestObjectV8Internal::reflectedTreatNullAsNullStringCustomURLAttrAttributeGetter(info);
TRACE_E... | 0 | 15,839 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: SVGElement* SVGElement::viewportElement() const {
ContainerNode* n = ParentOrShadowHostNode();
while (n) {
if (IsSVGSVGElement(*n) || IsSVGImageElement(*n) || IsSVGSymbolElement(*n))
return ToSVGElement(n);
n = n->ParentOrShadowHostNode();
}
return nullptr;
}
Commit Message: Fix SVG crash... | 0 | 28,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 HTMLMediaElement::didAddTrackElement(HTMLTrackElement* trackElement) {
TextTrack* textTrack = trackElement->track();
if (!textTrack)
return;
textTracks()->append(textTrack);
if (isFinishedParsingChildren())
scheduleTextTrackResourceLoad();
}
Commit Message: [Blink>Media] Allow autoplay mut... | 0 | 24,086 |
Analyze the following 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 VaapiVideoDecodeAccelerator::VaapiH264Accelerator::FillVARefFramesFromDPB(
const H264DPB& dpb,
VAPictureH264* va_pics,
int num_pics) {
H264Picture::Vector::const_reverse_iterator rit;
int i;
for (rit = dpb.rbegin(), i = 0; rit != dpb.rend() && i < num_pics; ++rit) {
if ((*rit)->re... | 1 | 6,004 |
Analyze the following 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_cavlc_parse_8x8block_left_available(WORD16 *pi2_coeff_block,
UWORD32 u4_sub_block_strd,
UWORD32 u4_isdc,
dec_struct_t * ps_dec,
UWORD8 *pu1_top_nnz,
... | 0 | 24,230 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: LayoutUnit RenderBlock::logicalRightSelectionOffset(RenderBlock* rootBlock, LayoutUnit position)
{
if (rootBlock != this)
return containingBlock()->logicalRightSelectionOffset(rootBlock, position + logicalTop());
return logicalRightOffsetForContent();
}
Commit Message: Separate repaint and layout... | 0 | 22,211 |
Analyze the following 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 convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
return;
}
TestObjec... | 0 | 12,270 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: monitor_sync(struct monitor *pmonitor)
{
if (options.compression) {
/* The member allocation is not visible, so sync it */
mm_share_sync(&pmonitor->m_zlib, &pmonitor->m_zback);
}
}
Commit Message: set sshpam_ctxt to NULL after free
Avoids use-after-free in monitor when privsep child is compromised.
Report... | 0 | 2,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: static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(obj TSRMLS_CC);
zval *tmp, *storage;
int name_len;
char *zname;
zend_class_entry *base;
*is_temp = 0;
if (!intern->std.properties) {
rebui... | 0 | 13,582 |
Analyze the following 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 vol_prc_lib_create(const effect_uuid_t *uuid,
int32_t session_id,
int32_t io_id,
effect_handle_t *p_handle)
{
int itt = 0;
vol_listener_context_t *context = NULL;
ALOGV("volume_prc_lib_create .. called ..");
if (lib_init() != 0) {
return init_status;
}
if (p_handle == NULL || uuid == NU... | 0 | 19,945 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: IW_IMPL(int) iw_parse_int(const char *s)
{
double result;
int charsread;
iw_parse_number_internal(s, &result, &charsread);
return iw_round_to_int(result);
}
Commit Message: Trying to fix some invalid left shift operations
Fixes issue #16
CWE ID: CWE-682 | 0 | 19,237 |
Analyze the following 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 RELOC_PTRS_WITH(device_reloc_ptrs, gx_device *dev)
{
dev->parent = gx_device_reloc_ptr(dev->parent, gcst);
dev->child = gx_device_reloc_ptr(dev->child, gcst);
}
Commit Message:
CWE ID: CWE-78 | 0 | 12,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: const char* RendererSchedulerImpl::VirtualTimePolicyToString(
VirtualTimePolicy virtual_time_policy) {
switch (virtual_time_policy) {
case VirtualTimePolicy::kAdvance:
return "ADVANCE";
case VirtualTimePolicy::kPause:
return "PAUSE";
case VirtualTimePolicy::kDeterministicLoading:
... | 0 | 27,042 |
Analyze the following 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 cma_init_ud_qp(struct rdma_id_private *id_priv, struct ib_qp *qp)
{
struct ib_qp_attr qp_attr;
int qp_attr_mask, ret;
qp_attr.qp_state = IB_QPS_INIT;
ret = rdma_init_qp_attr(&id_priv->id, &qp_attr, &qp_attr_mask);
if (ret)
return ret;
ret = ib_modify_qp(qp, &qp_attr, qp_attr_mask);
if (ret)
... | 0 | 9,267 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: free_pixmap_pattern(
gs_memory_t * pmem,
void * pvpinst,
client_name_t cname
)
{
gs_pattern1_instance_t *pinst = (gs_pattern1_instance_t *)pvpinst;
pixmap_info *ppmap = pinst->templat.client_data;
ppmap->free_proc(pmem, pvpinst, cname);
gs_free_obj... | 0 | 27,608 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: GF_Err gf_isom_lhvc_config_update(GF_ISOFile *the_file, u32 trackNumber, u32 DescriptionIndex, GF_HEVCConfig *cfg, GF_ISOMLHEVCTrackType track_type)
{
if (cfg) cfg->is_lhvc = GF_TRUE;
switch (track_type) {
case GF_ISOM_LEHVC_ONLY:
return gf_isom_hevc_config_update_ex(the_file, trackNumber, DescriptionIndex, ... | 0 | 12,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: static void fx_init(struct kvm_vcpu *vcpu)
{
fpstate_init(&vcpu->arch.guest_fpu.state);
if (cpu_has_xsaves)
vcpu->arch.guest_fpu.state.xsave.header.xcomp_bv =
host_xcr0 | XSTATE_COMPACTION_ENABLED;
/*
* Ensure guest xcr0 is valid for loading
*/
vcpu->arch.xcr0 = XFEATURE_MASK_FP;
vcpu->arch.cr0 |=... | 0 | 18,425 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: PPB_Widget_Impl::~PPB_Widget_Impl() {
}
Commit Message: Maintain a map of all resources in the resource tracker and clear instance back pointers when needed,
BUG=85808
Review URL: http://codereview.chromium.org/7196001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89746 0039d316-1c4b-4281-b951-d872f2087c... | 0 | 6,384 |
Analyze the following 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 webkit_web_view_real_undo(WebKitWebView* webView)
{
Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
frame->editor()->command("Undo").execute();
}
Commit Message: 2011-06-02 Joone Hur <joone.hur@collabora.co.uk>
Reviewed by Martin Robinson.
[GTK] Only... | 0 | 3,634 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: drive_detach_completed_cb (DBusGMethodInvocation *context,
Device *device,
gboolean job_was_cancelled,
int status,
const char *stderr,
const char *stdout,
... | 0 | 16,894 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ImportSingleTIFF_SShort ( const TIFF_Manager::TagInfo & tagInfo, const bool nativeEndian,
SXMPMeta * xmp, const char * xmpNS, const char * xmpProp )
{
try { // Don't let errors with one stop the others.
XMP_Int16 binValue = *((XMP_Int16*)tagInfo.dataPtr);
if ( ! nativeEndian ) Flip2 ( &binValue );
... | 0 | 18,108 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static v8::Handle<v8::Value> classMethodCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.classMethod");
TestObj::classMethod();
return v8::Handle<v8::Value>();
}
Commit Message: [V8] Pass Isolate to throwNotEnoughArgumentsError()
https://bugs.webkit.org/show_bug.cgi?id=86983
Reviewed by ... | 0 | 5,293 |
Analyze the following 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 GLES2DecoderImpl::SetForceShaderNameHashingForTest(bool force) {
force_shader_name_hashing_for_test = force;
}
Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM
This makes the query of GL_COMPLETION_STATUS_KHR to programs much
cheaper by minimizing the round-trip to the GPU thread.
Bug: 881152, 9... | 0 | 21,139 |
Analyze the following 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::PreHandleGestureEvent(
const blink::WebGestureEvent& event) {
return delegate_ && delegate_->PreHandleGestureEvent(this, event);
}
Commit Message: Don't call WebContents::DownloadImage() callback if the WebContents were deleted
BUG=583718
Review URL: https://codereview.chromium.org/... | 0 | 26,909 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void Browser::OpenClearBrowsingDataDialog() {
UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_ShowDlg"));
ShowOptionsTab(chrome::kClearBrowserDataSubPage);
}
Commit Message: Implement a bubble that appears at the top of the screen when a tab enters
fullscreen mode via webkitRequestFullScreen(... | 0 | 29,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: static int ocfs2_dio_end_io(struct kiocb *iocb,
loff_t offset,
ssize_t bytes,
void *private)
{
struct inode *inode = file_inode(iocb->ki_filp);
int level;
int ret = 0;
/* this io's submitter should not have unlocked this before we could */
BUG_ON(!ocfs2_iocb_is_rw_locked(iocb));
if (b... | 0 | 27,491 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void php_mysqlnd_greet_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
{
MYSQLND_PACKET_GREET *p= (MYSQLND_PACKET_GREET *) _packet;
if (p->server_version) {
efree(p->server_version);
p->server_version = NULL;
}
if (p->auth_plugin_data && p->auth_plugin_data != p->intern_auth_plugin_data) {
... | 0 | 3,763 |
Analyze the following 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 test_lshift(BIO *bp, BN_CTX *ctx, BIGNUM *a_)
{
BIGNUM *a, *b, *c, *d;
int i;
b = BN_new();
c = BN_new();
d = BN_new();
BN_one(c);
if (a_)
a = a_;
else {
a = BN_new();
BN_bntest_rand(a, 200, 0, 0);
a->neg = rand_neg();
}
for (i = 0; i <... | 0 | 7,701 |
Analyze the following 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 DOMPatchSupport::patchDocument(const String& markup)
{
RefPtr<HTMLDocument> newDocument = HTMLDocument::create(0, KURL());
RefPtr<DocumentParser> parser = HTMLDocumentParser::create(newDocument.get(), false);
parser->insert(markup); // Use insert() so that the parser will not yield.
parser->f... | 0 | 24,091 |
Analyze the following 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::setActiveElement(PassRefPtr<Element> newActiveElement)
{
if (!newActiveElement) {
m_activeElement.clear();
return;
}
m_activeElement = newActiveElement;
}
Commit Message: Refactoring: Move m_mayDisplaySeamlesslyWithParent down to Document
The member is used only in Do... | 0 | 28,678 |
Analyze the following 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 vmw_surface_gb_priv_define(struct drm_device *dev,
uint32_t user_accounting_size,
uint32_t svga3d_flags,
SVGA3dSurfaceFormat format,
bool for_scanout,
uint32_t num_mip_levels,
uint32_t multisample_count,
uint32_t array_size,
struc... | 0 | 18,728 |
Analyze the following 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 QuotaTaskObserver::RegisterTask(QuotaTask* task) {
running_quota_tasks_.insert(task);
}
Commit Message: Quota double-delete fix
BUG=142310
Review URL: https://chromiumcodereview.appspot.com/10832407
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152532 0039d316-1c4b-4281-b951-d872f2087c98
CWE ID:... | 0 | 21,623 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: PPB_ImageData_API* PPB_ImageData_Impl::AsPPB_ImageData_API() {
return this;
}
Commit Message: Security fix: integer overflow on checking image size
Test is left in another CL (codereview.chromiu,.org/11274036) to avoid conflict there. Hope it's fine.
BUG=160926
Review URL: https://chromiumcodereview.appsp... | 0 | 14,093 |
Analyze the following 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 HTMLImportsController::Dispose() {
for (const auto& loader : loaders_)
loader->Dispose();
loaders_.clear();
if (root_) {
root_->Dispose();
root_.Clear();
}
}
Commit Message: Speculative fix for crashes in HTMLImportsController::Dispose().
Copy the loaders_ vector before iterating i... | 1 | 8,734 |
Analyze the following 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 alloc_kvm_area(void)
{
int cpu;
for_each_possible_cpu(cpu) {
struct vmcs *vmcs;
vmcs = alloc_vmcs_cpu(cpu);
if (!vmcs) {
free_kvm_area();
return -ENOMEM;
}
per_cpu(vmxarea, cpu) = vmcs;
}
return 0;
}
Commit Message: x86,kvm,vmx: Preserve CR4 across VM entry
CR4 isn't con... | 0 | 1,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 int move_iovec_hdr(struct iovec *from, struct iovec *to,
size_t len, int iov_count)
{
int seg = 0;
size_t size;
while (len && seg < iov_count) {
size = min(from->iov_len, len);
to->iov_base = from->iov_base;
to->iov_len = size;
from->iov_len -= size;
from->iov_base += size;
len -= size... | 0 | 15,697 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static struct device_node *of_get_regulator(struct device *dev, const char *supply)
{
struct device_node *regnode = NULL;
char prop_name[32]; /* 32 is max size of property name */
dev_dbg(dev, "Looking up %s-supply from device tree\n", supply);
snprintf(prop_name, 32, "%s-supply", supply);
regnode = of_par... | 0 | 2,731 |
Analyze the following 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 WorkerThread::stopInternal()
{
MutexLocker lock(m_threadStateMutex);
if (m_terminated)
return;
m_terminated = true;
if (m_shutdownEvent)
m_shutdownEvent->signal();
if (m_shutdown)
return;
if (!m_workerGlobalScope) {
m_terminationEvent->signal();
... | 0 | 26,357 |
Analyze the following 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 boolean ReadComment(j_decompress_ptr jpeg_info)
{
ErrorManager
*error_manager;
Image
*image;
register unsigned char
*p;
register ssize_t
i;
size_t
length;
StringInfo
*comment;
/*
Determine length of comment.
*/
error_manager=(ErrorManager *) jpeg_info->cl... | 0 | 20,480 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.