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: int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages)
{
int i;
for (i = 0; i < KVM_NR_PAGE_SIZES; ++i) {
unsigned long ugfn;
int lpages;
int level = i + 1;
lpages = gfn_to_index(slot->base_gfn + npages - 1,
slot->base_gfn, level) + 1;
slot->arch.rmap[i] =
kvm_... | 0 | 33,271 |
Analyze the following 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 pl022_xfer(PL022State *s)
{
int i;
int o;
int val;
if ((s->cr1 & PL022_CR1_SSE) == 0) {
pl022_update(s);
DPRINTF("Disabled\n");
return;
}
DPRINTF("Maybe xfer %d/%d\n", s->tx_fifo_len, s->rx_fifo_len);
i = (s->tx_fifo_head - s->tx_fifo_len) & 7;
... | 0 | 15,744 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: netdutils::Status XfrmController::deleteSecurityAssociation(const XfrmId& record,
const XfrmSocket& sock) {
xfrm_usersa_id said{};
nlattr_xfrm_mark xfrmmark{};
enum { NLMSG_HDR, USERSAID, USERSAID_PAD, MARK, MARK_PAD };
std::vector<iovec> iov = {
{NULL, 0}, // reserved for the eventual addition o... | 0 | 162,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: long long Chapters::Atom::GetStartTime(const Chapters* pChapters) const {
return GetTime(pChapters, m_start_timecode);
}
Commit Message: external/libvpx/libwebm: Update snapshot
Update libwebm snapshot. This update contains security fixes from upstream.
Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5... | 0 | 160,797 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: check_gss_callback_principal(struct nfs_client *clp, struct svc_rqst *rqstp)
{
char *p = rqstp->rq_cred.cr_principal;
if (rqstp->rq_authop->flavour != RPC_AUTH_GSS)
return 1;
/* No RPC_AUTH_GSS on NFSv4.1 back channel yet */
if (clp->cl_minorversion != 0)
return 0;
/*
* It might just be a normal user... | 0 | 65,240 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: updateDevice(const struct header * headers, time_t t)
{
struct device ** pp = &devlist;
struct device * p = *pp; /* = devlist; */
while(p)
{
if( p->headers[HEADER_NT].l == headers[HEADER_NT].l
&& (0==memcmp(p->headers[HEADER_NT].p, headers[HEADER_NT].p, headers[HEADER_NT].l))
&& p->headers[HEADER_U... | 1 | 169,669 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: PHP_METHOD(SoapServer, setPersistence)
{
soapServicePtr service;
long value;
SOAP_SERVER_BEGIN_CODE();
FETCH_THIS_SERVICE(service);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) != FAILURE) {
if (service->type == SOAP_CLASS) {
if (value == SOAP_PERSISTENCE_SESSION ||
value == ... | 0 | 14,862 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: invoke_NPN_ReleaseObject(NPObject *npobj)
{
npw_return_val_if_fail(rpc_method_invoke_possible(g_rpc_connection),
npobj->referenceCount);
int error = rpc_method_invoke(g_rpc_connection,
RPC_METHOD_NPN_RELEASE_OBJECT,
RPC_TYPE_NP_OBJECT, npobj,
RPC_TYPE_INVALID);
if (error != ... | 0 | 27,136 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: kauth_print(netdissect_options *ndo,
register const u_char *bp, int length)
{
int kauth_op;
if (length <= (int)sizeof(struct rx_header))
return;
if (ndo->ndo_snapend - bp + 1 <= (int)(sizeof(struct rx_header) + sizeof(int32_t))) {
goto trunc;
}
/*
* Print out the afs call we're invoking.... | 0 | 62,275 |
Analyze the following 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 zgetfilename(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
uint fnlen;
gs_const_string pfname;
stream *s;
byte *sbody;
int code;
check_ostack(1);
check_read_type(*op, t_file);
s = (op)->value.pfile;
code = sfilename(s, &pfname);
if (code < 0) {
pfname.size ... | 0 | 6,633 |
Analyze the following 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::SetSurface(
const scoped_refptr<gfx::GLSurface>& surface) {
DCHECK(context_->IsCurrent(NULL));
DCHECK(surface_.get());
surface_ = surface;
RestoreCurrentFramebufferBindings();
}
Commit Message: Fix SafeAdd and SafeMultiply
BUG=145648,145544
Review URL: https://chromiumcodere... | 0 | 103,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: static int igmp_mc_seq_show(struct seq_file *seq, void *v)
{
if (v == SEQ_START_TOKEN)
seq_puts(seq,
"Idx\tDevice : Count Querier\tGroup Users Timer\tReporter\n");
else {
struct ip_mc_list *im = (struct ip_mc_list *)v;
struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq);
char *querie... | 0 | 21,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: void VideoCaptureImpl::DidFinishConsumingFrame(
const media::VideoFrameMetadata* metadata,
BufferFinishedCallback callback_to_io_thread) {
double consumer_resource_utilization = -1.0;
if (!metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION,
&consumer_resourc... | 0 | 149,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: static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
{
struct vmcs12 *vmcs12;
struct vcpu_vmx *vmx = to_vmx(vcpu);
u32 interrupt_shadow = vmx_get_interrupt_shadow(vcpu);
u32 exit_qual;
int ret;
if (!nested_vmx_check_permission(vcpu))
return 1;
if (!nested_vmx_check_vmcs12(vcpu))
goto out;
... | 0 | 63,012 |
Analyze the following 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 NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL(
RenderFrameHostImpl* render_frame_host,
const GURL& url) {
int enabled_bindings = render_frame_host->GetEnabledBindings();
bool is_allowed_in_web_ui_renderer =
WebUIControllerFactoryRegistry::GetInstance()->IsURLAcceptableForWebUI(
... | 0 | 143,804 |
Analyze the following 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 Element::nodeName() const
{
return m_tagName.toString();
}
Commit Message: Set Attr.ownerDocument in Element#setAttributeNode()
Attr objects can move across documents by setAttributeNode().
So It needs to reset ownerDocument through TreeScopeAdoptr::adoptIfNeeded().
BUG=248950
TEST=set-attribute-nod... | 0 | 112,313 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: RList *r_bin_wasm_get_elements (RBinWasmObj *bin) {
RBinWasmSection *element = NULL;
RList *elements = NULL;
if (!bin || !bin->g_sections) {
return NULL;
}
if (bin->g_elements) {
return bin->g_elements;
}
if (!(elements = r_bin_wasm_get_sections_by_id (bin->g_sections,
R_BIN_WASM_SECTION_ELEME... | 0 | 67,077 |
Analyze the following 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 long lookup_entry(struct hash_table_entry *hash_table[], long long start)
{
int hash = CALCULATE_HASH(start);
struct hash_table_entry *hash_table_entry;
for(hash_table_entry = hash_table[hash]; hash_table_entry;
hash_table_entry = hash_table_entry->next)
if(hash_table_entry->start == start)
ret... | 0 | 74,274 |
Analyze the following 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::Replace(const base::string16& word) {
RenderFrameHost* focused_frame = GetFocusedFrame();
if (!focused_frame)
return;
focused_frame->Send(new InputMsg_Replace(
focused_frame->GetRoutingID(), word));
}
Commit Message: Don't call WebContents::DownloadImage() callback if the W... | 0 | 131,967 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: const CompressedFormatInfo* GetCompressedFormatInfo(GLenum format) {
for (size_t i = 0; i < arraysize(kCompressedFormatInfoArray); i++) {
if (kCompressedFormatInfoArray[i].format == format) {
return &kCompressedFormatInfoArray[i];
}
}
return nullptr;
}
Commit Message: Implement immutable text... | 0 | 145,891 |
Analyze the following 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* CMSEXPORT cmsIT8GetSheetType(cmsHANDLE hIT8)
{
return GetTable((cmsIT8*) hIT8)->SheetType;
}
Commit Message: Upgrade Visual studio 2017 15.8
- Upgrade to 15.8
- Add check on CGATS memory allocation (thanks to Quang Nguyen for
pointing out this)
CWE ID: CWE-190 | 0 | 78,072 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: unsigned char* lodepng_chunk_next(unsigned char* chunk)
{
unsigned total_chunk_length = lodepng_chunk_length(chunk) + 12;
return &chunk[total_chunk_length];
}
Commit Message: Fixed #5645: realloc return handling
CWE ID: CWE-772 | 0 | 87,512 |
Analyze the following 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 DownloadItemImpl::Completed() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << __func__ << "() " << DebugString(false);
DCHECK(AllDataSaved());
destination_info_.end_time = base::Time::Now();
TransitionTo(COMPLETE_INTERNAL);
bool is_parallelizable = job_ && job_->IsParallelizable();
Re... | 0 | 146,281 |
Analyze the following 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 WriteVirtIODeviceRegister(ULONG_PTR ulRegister, u32 ulValue)
{
DPrintf(6, ("[%s]R[%x]=%x\n", __FUNCTION__, (ULONG)ulRegister, ulValue) );
NdisRawWritePortUlong(ulRegister, ulValue);
}
Commit Message: NetKVM: BZ#1169718: More rigoruous testing of incoming packet
Signed-off-by: Joseph Hindin <yhindi... | 0 | 74,412 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget& eventTarget, CanvasRenderingContext2D* context, int sx, int sy, int sw, int sh, ExceptionState& exceptionState)
{
return createImageBitmap(eventTarget, context->canvas(), sx, sy, sw, sh, exceptionState);
}
Commit Message: Fix crash when creat... | 0 | 115,109 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void brcmf_cfg80211_crit_proto_stop(struct wiphy *wiphy,
struct wireless_dev *wdev)
{
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
struct brcmf_cfg80211_vif *vif;
vif = container_of(wdev, struct brcmf_cfg80211_vif, wdev);
brcmf_btcoex_set_mode(vif, BRCMF_BTCOEX_ENABLED, 0);
clear_b... | 0 | 49,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: static int tsc210x_load(QEMUFile *f, void *opaque, int version_id)
{
TSC210xState *s = (TSC210xState *) opaque;
int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
int i;
s->x = qemu_get_be16(f);
s->y = qemu_get_be16(f);
s->pressure = qemu_get_byte(f);
s->state = qemu_get_byte(f);
... | 1 | 165,356 |
Analyze the following 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 vcpu_stat_clear_per_vm(void *data, u64 val)
{
int i;
struct kvm_stat_data *stat_data = (struct kvm_stat_data *)data;
struct kvm_vcpu *vcpu;
if (val)
return -EINVAL;
kvm_for_each_vcpu(i, vcpu, stat_data->kvm)
*(u64 *)((void *)vcpu + stat_data->offset) = 0;
return 0;
}
Commit Message: kvm: ... | 0 | 91,604 |
Analyze the following 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 DoCheckFakeData(uint8* audio_data, size_t length) {
Type* output = reinterpret_cast<Type*>(audio_data);
for (size_t i = 0; i < length; i++) {
EXPECT_TRUE(algorithm_.is_muted() || output[i] != 0);
}
}
Commit Message: Protect AudioRendererAlgorithm from invalid step sizes.
BUG=165430
T... | 1 | 171,531 |
Analyze the following 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 ion_dma_buf_release(struct dma_buf *dmabuf)
{
struct ion_buffer *buffer = dmabuf->priv;
ion_buffer_put(buffer);
}
Commit Message: staging/android/ion : fix a race condition in the ion driver
There is a use-after-free problem in the ion driver.
This is caused by a race condition in the ion_ioctl()... | 0 | 48,546 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: setpassfilter(argv)
char **argv;
{
pcap_t *pc;
int ret = 1;
pc = pcap_open_dead(DLT_PPP_PPPD, 65535);
if (pcap_compile(pc, &pass_filter, *argv, 1, netmask) == -1) {
option_error("error in pass-filter expression: %s\n",
pcap_geterr(pc));
ret = 0;
}
pcap_close(pc);
return ... | 0 | 38,177 |
Analyze the following 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 PasswordAutofillAgent::ClearPreview(WebInputElement* username,
WebInputElement* password) {
if (!username->IsNull() && !username->SuggestedValue().IsEmpty()) {
username->SetSuggestedValue(WebString());
username->SetAutofillState(username_autofill_state_);
... | 0 | 137,600 |
Analyze the following 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 WebLocalFrameImpl::SetDevToolsAgentClient(
WebDevToolsAgentClient* dev_tools_client) {
DCHECK(dev_tools_client);
dev_tools_agent_ = WebDevToolsAgentImpl::Create(this, dev_tools_client);
}
Commit Message: Inherit CSP when we inherit the security origin
This prevents attacks that use main window navi... | 0 | 134,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: polkit_backend_session_monitor_new (void)
{
PolkitBackendSessionMonitor *monitor;
monitor = POLKIT_BACKEND_SESSION_MONITOR (g_object_new (POLKIT_BACKEND_TYPE_SESSION_MONITOR, NULL));
return monitor;
}
Commit Message:
CWE ID: CWE-200 | 0 | 14,591 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static long kvm_vm_ioctl(struct file *filp,
unsigned int ioctl, unsigned long arg)
{
struct kvm *kvm = filp->private_data;
void __user *argp = (void __user *)arg;
int r;
if (kvm->mm != current->mm)
return -EIO;
switch (ioctl) {
case KVM_CREATE_VCPU:
r = kvm_vm_ioctl_create_vcpu(kvm, arg);
if (r... | 0 | 29,104 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void ACodec::ExecutingState::stateEntered() {
ALOGV("[%s] Now Executing", mCodec->mComponentName.c_str());
mCodec->mRenderTracker.clear(systemTime(CLOCK_MONOTONIC));
mCodec->processDeferredMessages();
}
Commit Message: Fix initialization of AAC presentation struct
Otherwise the new size checks trip... | 0 | 164,165 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: evutil_socketpair(int family, int type, int protocol, evutil_socket_t fd[2])
{
#ifndef _WIN32
return socketpair(family, type, protocol, fd);
#else
return evutil_ersatz_socketpair_(family, type, protocol, fd);
#endif
}
Commit Message: evutil_parse_sockaddr_port(): fix buffer overflow
@asn-the-goblin-slayer:
... | 0 | 70,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: static inline int build_open_flags(int flags, umode_t mode, struct open_flags *op)
{
int lookup_flags = 0;
int acc_mode = ACC_MODE(flags);
if (flags & (O_CREAT | __O_TMPFILE))
op->mode = (mode & S_IALLUGO) | S_IFREG;
else
op->mode = 0;
/* Must never be set by userspace */
flags &= ~FMODE_NONOTIFY & ~O... | 0 | 94,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 ChildProcessSecurityPolicyImpl::AddChild(int child_id) {
if (security_state_.count(child_id) != 0) {
NOTREACHED() << "Add child process at most once.";
return;
}
security_state_[child_id] = std::make_unique<SecurityState>();
}
Commit Message: Lock down blob/filesystem URL creation with a stro... | 0 | 143,703 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: buf_add_chunk_with_capacity(buf_t *buf, size_t capacity, int capped)
{
chunk_t *chunk;
struct timeval now;
if (CHUNK_ALLOC_SIZE(capacity) < buf->default_chunk_size) {
chunk = chunk_new_with_alloc_size(buf->default_chunk_size);
} else if (capped && CHUNK_ALLOC_SIZE(capacity) > MAX_CHUNK_ALLOC) {
ch... | 0 | 73,140 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: BrowserWindowGtk::GetActiveTabPermissionGranter() {
TabContents* tab = GetDisplayedTab();
if (!tab)
return NULL;
return extensions::TabHelper::FromWebContents(tab->web_contents())->
active_tab_permission_granter();
}
Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt... | 0 | 117,922 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: QPointF QQuickWebViewPrivate::FlickableAxisLocker::adjust(const QPointF& position)
{
if (m_allowedDirection == QQuickFlickable::HorizontalFlick)
return QPointF(position.x(), m_lockReferencePosition.y());
if (m_allowedDirection == QQuickFlickable::VerticalFlick)
return QPointF(m_lockRefere... | 0 | 107,968 |
Analyze the following 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 rds_ib_send_clear_ring(struct rds_ib_connection *ic)
{
struct rds_ib_send_work *send;
u32 i;
for (i = 0, send = ic->i_sends; i < ic->i_send_ring.w_nr; i++, send++) {
if (send->s_op && send->s_wr.opcode != 0xdead)
rds_ib_send_unmap_op(ic, send, IB_WC_WR_FLUSH_ERR);
}
}
Commit Message: rds: prevent ... | 0 | 27,762 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int mem_cgroup_move_charge_pte_range(pmd_t *pmd,
unsigned long addr, unsigned long end,
struct mm_walk *walk)
{
int ret = 0;
struct vm_area_struct *vma = walk->private;
pte_t *pte;
spinlock_t *ptl;
split_huge_page_pmd(walk->mm, pmd);
retry:
pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &p... | 0 | 21,435 |
Analyze the following 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 posix_acl *f2fs_acl_from_disk(const char *value, size_t size)
{
int i, count;
struct posix_acl *acl;
struct f2fs_acl_header *hdr = (struct f2fs_acl_header *)value;
struct f2fs_acl_entry *entry = (struct f2fs_acl_entry *)(hdr + 1);
const char *end = value + size;
if (hdr->a_version != cpu_to_l... | 0 | 50,336 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: SPL_METHOD(SplObjectStorage, getInfo)
{
spl_SplObjectStorageElement *element;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) == NULL) {
return;
}
ZV... | 0 | 73,679 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: smp_fetch_url32_src(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw)
{
struct chunk *temp;
struct connection *cli_conn = objt_conn(l4->si[0].end);
if (!smp_fetch_url32(px, l4, l7, opt, args, smp, kw))
return 0;... | 0 | 9,864 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: APIPermission* CreateAPIPermission(const APIPermissionInfo* permission) {
return new T(permission);
}
Commit Message: DIAL (Discovery and Launch protocol) extension API skeleton.
This implements the skeleton for a new Chrome extension API for local device discovery. The API will first be restricted to whiteli... | 0 | 113,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: static unsigned rb_calculate_event_length(unsigned length)
{
struct ring_buffer_event event; /* Used only for sizeof array */
/* zero length can cause confusions */
if (!length)
length++;
if (length > RB_MAX_SMALL_DATA || RB_FORCE_8BYTE_ALIGNMENT)
length += sizeof(event.array[0]);
length += RB_EVNT_HD... | 0 | 72,519 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void *__kmalloc_node_track_caller(size_t size, gfp_t flags,
int node, unsigned long caller)
{
return __do_kmalloc_node(size, flags, node, caller);
}
Commit Message: mm/slab.c: fix SLAB freelist randomization duplicate entries
This patch fixes a bug in the freelist randomization code. When a high
random numb... | 0 | 68,819 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: OMX_ERRORTYPE SoftAVC::setAirParams() {
ive_ctl_set_air_params_ip_t s_air_ip;
ive_ctl_set_air_params_op_t s_air_op;
IV_STATUS_T status;
s_air_ip.e_cmd = IVE_CMD_VIDEO_CTL;
s_air_ip.e_sub_cmd = IVE_CMD_CTL_SET_AIR_PARAMS;
s_air_ip.e_air_mode = mAIRMode;
s_air_ip.u4_air_refresh_period = mAIR... | 0 | 163,961 |
Analyze the following 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 ContentSecurityPolicy::UrlMatchesSelf(const KURL& url) const {
return self_source_->MatchesAsSelf(url);
}
Commit Message: Inherit the navigation initiator when navigating instead of the parent/opener
Spec PR: https://github.com/w3c/webappsec-csp/pull/358
Bug: 905301, 894228, 836148
Change-Id: I43ada2266... | 0 | 152,537 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: FrameFocusedObserver::FrameFocusedObserver(RenderFrameHost* owner_host)
: impl_(new FrameTreeNodeObserverImpl(
static_cast<RenderFrameHostImpl*>(owner_host)->frame_tree_node())) {}
Commit Message: Apply ExtensionNavigationThrottle filesystem/blob checks to all frames.
BUG=836858
Change-Id: I34333... | 0 | 156,062 |
Analyze the following 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 lxc_create_tty(const char *name, struct lxc_conf *conf)
{
struct lxc_tty_info *tty_info = &conf->tty_info;
int i, ret;
/* no tty in the configuration */
if (!conf->tty)
return 0;
tty_info->pty_info =
malloc(sizeof(*tty_info->pty_info)*conf->tty);
if (!tty_info->pty_info) {
SYSERROR("failed to al... | 0 | 44,596 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: advance_file_pointer(struct archive_read_filter *filter, int64_t request)
{
int64_t bytes_skipped, total_bytes_skipped = 0;
ssize_t bytes_read;
size_t min;
if (filter->fatal)
return (-1);
/* Use up the copy buffer first. */
if (filter->avail > 0) {
min = (size_t)minimum(request, (int64_t)filter->avail... | 0 | 50,011 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void WebContentsImpl::MediaStartedPlaying(
const WebContentsObserver::MediaPlayerInfo& media_info,
const WebContentsObserver::MediaPlayerId& id) {
if (media_info.has_video)
currently_playing_video_count_++;
for (auto& observer : observers_)
observer.MediaStartedPlaying(media_info, id);
}
Com... | 0 | 135,767 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void WebPluginDelegateProxy::OnResolveProxy(const GURL& url,
bool* result,
std::string* proxy_list) {
*result = false;
RenderThreadImpl::current()->Send(
new ViewHostMsg_ResolveProxy(url, result, proxy_list));
}
Com... | 0 | 107,144 |
Analyze the following 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 sched_open(struct inode *inode, struct file *filp)
{
return single_open(filp, sched_show, inode);
}
Commit Message: proc: restrict access to /proc/PID/io
/proc/PID/io may be used for gathering private information. E.g. for
openssh and vsftpd daemons wchars/rchars may be used to learn the
precise p... | 0 | 26,907 |
Analyze the following 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_init_csi(fz_context *ctx, pdf_csi *csi, pdf_document *doc, pdf_obj *rdb, pdf_lexbuf *buf, fz_cookie *cookie)
{
memset(csi, 0, sizeof *csi);
csi->doc = doc;
csi->rdb = rdb;
csi->buf = buf;
csi->cookie = cookie;
}
Commit Message:
CWE ID: CWE-20 | 0 | 575 |
Analyze the following 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 DevToolsUIBindings::AgentHostClosed(
content::DevToolsAgentHost* agent_host,
bool replaced_with_another_client) {
DCHECK(agent_host == agent_host_.get());
agent_host_ = NULL;
delegate_->InspectedContentsClosing();
}
Commit Message: DevTools: move front-end URL handling to DevToolsUIBindingds
... | 0 | 138,286 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: pk_copy_error(krb5_context context,
hx509_context hx509ctx,
int hxret,
const char *fmt,
...)
{
va_list va;
char *s, *f;
int ret;
va_start(va, fmt);
ret = vasprintf(&f, fmt, va);
va_end(va);
if (ret == -1 || f == NULL) {
krb5_clear_error_message(context);
... | 0 | 89,973 |
Analyze the following 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 GLES2DecoderPassthroughImpl::DoTexImage3D(GLenum target,
GLint level,
GLint internalformat,
GLsizei width,
... | 0 | 142,124 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ext4_can_extents_be_merged(struct inode *inode, struct ext4_extent *ex1,
struct ext4_extent *ex2)
{
unsigned short ext1_ee_len, ext2_ee_len;
if (ext4_ext_is_unwritten(ex1) != ext4_ext_is_unwritten(ex2))
return 0;
ext1_ee_len = ext4_ext_get_actual_len(ex1);
ext2_ee_len = ext4_ext_get_actual_len(ex2);
... | 0 | 90,155 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem)
{
replace_item_in_object(object, string, newitem, false);
}
Commit Message: Fix crash of cJSON_GetObjectItemCaseSensitive when calling it on arrays
CWE ID: CWE-754 | 0 | 87,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: h_delay()
{
int r;
job j;
usec now;
int i;
tube t;
now = now_usec();
while ((j = delay_q_peek())) {
if (j->deadline_at > now) break;
j = delay_q_take();
r = enqueue_job(j, 0, 0);
if (r < 1) bury_job(j, 0); /* out of memory, so bury it */
}
for ... | 0 | 18,148 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: unsigned venc_dev::venc_stop( void)
{
struct venc_msg venc_msg;
struct v4l2_requestbuffers bufreq;
int rc = 0, ret = 0;
if (!stopped) {
enum v4l2_buf_type cap_type;
if (streaming[OUTPUT_PORT]) {
cap_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
rc = ioctl(m_nDriver_fd, VIDIOC_STREAMOFF... | 0 | 159,317 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: Render_Stroke( int num_indices,
int first_index )
{
int start_x, start_y, step_x, step_y, x, y;
int i;
FT_Size size;
FT_Stroker stroker = NULL;
error = FTDemo_Get_Size( handle, &size );
if ( error )
{
/* probably a non-existent bitma... | 0 | 10,056 |
Analyze the following 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 snro_dump(GF_Box *a, FILE * trace)
{
GF_SeqOffHintEntryBox *p;
p = (GF_SeqOffHintEntryBox *)a;
gf_isom_box_dump_start(a, "PacketSequenceOffsetBox", trace);
fprintf(trace, "SeqNumOffset=\"%d\">\n", p->SeqOffset);
gf_isom_box_dump_done("PacketSequenceOffsetBox", a, trace);
return GF_OK;
}
Commit Messa... | 0 | 80,845 |
Analyze the following 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 server_change_nick(SERVER_REC *server, const char *nick)
{
g_free(server->nick);
server->nick = g_strdup(nick);
signal_emit("server nick changed", 1, server);
}
Commit Message: Check if an SSL certificate matches the hostname of the server we are connecting to
git-svn-id: http://svn.irssi.org/repos/irs... | 0 | 18,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: void BrowserViewRenderer::CalculateTileMemoryPolicy() {
base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
bool client_hard_limit_bytes_overridden =
cl->HasSwitch(switches::kForceGpuMemAvailableMb);
if (client_hard_limit_bytes_overridden) {
base::StringToUint64(
base::Command... | 0 | 119,509 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesA(PCredHandle phCredential, ULONG ulAttribute, void* pBuffer)
{
char* Name;
SECURITY_STATUS status;
SecurityFunctionTableA* table;
Name = (char*) sspi_SecureHandleGetUpperPointer(phCredential);
if (!Name)
return SEC_E_SECPKG_NOT_FOUND;
table = sspi_Ge... | 0 | 58,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: bool CheckMenuItem(int depth, const PP_Flash_MenuItem* item) {
if (item->type == PP_FLASH_MENUITEM_TYPE_SUBMENU)
return CheckMenu(depth, item->submenu);
return true;
}
Commit Message: IPC: defend against excessive number of submenu entries in PPAPI message.
BUG=168710
Review URL: https://codereview.chro... | 0 | 115,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: void svcinfo_death(struct binder_state *bs, void *ptr)
{
struct svcinfo *si = (struct svcinfo* ) ptr;
ALOGI("service '%s' died\n", str8(si->name, si->len));
if (si->handle) {
binder_release(bs, si->handle);
si->handle = 0;
}
}
Commit Message: ServiceManager: Allow system services running ... | 0 | 158,127 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: mrb_f_block_given_p_m(mrb_state *mrb, mrb_value self)
{
mrb_callinfo *ci = &mrb->c->ci[-1];
mrb_callinfo *cibase = mrb->c->cibase;
mrb_value *bp;
struct RProc *p;
if (ci <= cibase) {
/* toplevel does not have block */
return mrb_false_value();
}
p = ci->proc;
/* search method/class/module... | 0 | 82,176 |
Analyze the following 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 u32 perf_event_tid(struct perf_event *event, struct task_struct *p)
{
/*
* only top level events have the pid namespace they were created in
*/
if (event->parent)
event = event->parent;
return task_pid_nr_ns(p, event->ns);
}
Commit Message: perf: Remove the nmi parameter from the swevent and ove... | 0 | 26,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: input_userauth_ext_info(int type, u_int32_t seqnr, void *ctxt)
{
return kex_input_ext_info(type, seqnr, active_state);
}
Commit Message: Remove support for pre-authentication compression. Doing compression
early in the protocol probably seemed reasonable in the 1990s, but
today it's clearly a bad idea in terms ... | 0 | 72,246 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static enum oom_constraint constrained_alloc(struct zonelist *zonelist,
gfp_t gfp_mask, nodemask_t *nodemask,
unsigned long *totalpages)
{
struct zone *zone;
struct zoneref *z;
enum zone_type high_zoneidx = gfp_zone(gfp_mask);
bool cpuset_limited = false;
int nid;
/* Default to all available memory... | 0 | 24,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: GF_Err dac3_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_AC3ConfigBox *ptr = (GF_AC3ConfigBox *)s;
if (ptr->cfg.is_ec3) s->type = GF_ISOM_BOX_TYPE_DEC3;
e = gf_isom_box_write_header(s, bs);
if (ptr->cfg.is_ec3) s->type = GF_ISOM_BOX_TYPE_DAC3;
if (e) return e;
if (ptr->cfg.is_ec3) {
u32 i;
gf_bs... | 0 | 80,038 |
Analyze the following 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 longLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
TestObjectPythonV8Internal::longLongAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
... | 0 | 122,391 |
Analyze the following 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 write_mmio(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes, void *val)
{
trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, bytes, gpa, *(u64 *)val);
return vcpu_mmio_write(vcpu, gpa, bytes, val);
}
Commit Message: KVM: Ensure all vcpus are consistent with in-kernel irqchip settings
(cherry picked from commit 3e5157... | 0 | 20,899 |
Analyze the following 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 DevToolsUIBindings::AttachTo(
const scoped_refptr<content::DevToolsAgentHost>& agent_host) {
if (agent_host_.get())
Detach();
agent_host_ = agent_host;
agent_host_->ForceAttachClient(this);
}
Commit Message: DevTools: move front-end URL handling to DevToolsUIBindingds
BUG=662859
Review-Url: ... | 0 | 138,289 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: application_unhandled_file_install (GtkDialog *dialog,
gint response_id,
ActivateParametersInstall *parameters_install)
{
char *mime_type;
gtk_widget_destroy (GTK_WIDGET (dialog));
parameters... | 0 | 61,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: int gdImageColorResolve (gdImagePtr im, int r, int g, int b)
{
return gdImageColorResolveAlpha(im, r, g, b, gdAlphaOpaque);
}
Commit Message: iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
CWE ID: CWE-190 | 0 | 51,428 |
Analyze the following 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 SocketStream::DoResolveHost() {
next_state_ = STATE_RESOLVE_HOST_COMPLETE;
DCHECK(!proxy_info_.is_empty());
if (proxy_info_.is_direct())
proxy_mode_ = kDirectConnection;
else if (proxy_info_.proxy_server().is_socks())
proxy_mode_ = kSOCKSProxy;
else
proxy_mode_ = kTunnelProxy;
HostPo... | 0 | 112,680 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ExtensionInfo::~ExtensionInfo() {}
Commit Message: Extend TTS extension API to support richer events returned from the engine
to the client. Previously we just had a completed event; this adds start,
word boundary, sentence boundary, and marker boundary. In addition,
interrupted and canceled, which were previous... | 0 | 99,785 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: StorageHandler::IndexedDBObserver* StorageHandler::GetIndexedDBObserver() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!indexed_db_observer_) {
indexed_db_observer_ = std::make_unique<IndexedDBObserver>(
weak_ptr_factory_.GetWeakPtr(),
static_cast<IndexedDBContextImpl*>(
pr... | 1 | 172,772 |
Analyze the following 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 UDPSocketLibevent::Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) {
return SendToOrWrite(buf, buf_len, NULL, callback);
}
Commit Message: Map posix error codes in bind better, and fix one windows mapping.
r=wtc
BUG=330233
R... | 0 | 113,429 |
Analyze the following 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_each_text(PG_FUNCTION_ARGS)
{
return each_worker(fcinfo, true);
}
Commit Message:
CWE ID: CWE-119 | 0 | 2,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 _waiter_init (uint32_t jobid)
{
if (!waiters)
waiters = list_create((ListDelF) _waiter_destroy);
/*
* Exit this thread if another thread is waiting on job
*/
if (list_find_first (waiters, (ListFindF) _find_waiter, &jobid))
return SLURM_ERROR;
else
list_append(waiters, _waiter_create(job... | 0 | 72,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: static int amd_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
{
unsigned long flags;
u32 pin_reg;
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
spin_lock_irqsave(&gpio_dev->lock, flags);
pin_reg = readl(gpio_dev->base + offset * 4);
pin_reg &= ~BIT(OUTPUT_ENABLE_OFF);
writel(pin_reg, gpi... | 0 | 86,157 |
Analyze the following 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 trans_t* AllocTrans( char *original, char *translated[MAX_LANGUAGES] ) {
trans_t *t;
int i;
t = malloc( sizeof( trans_t ) );
memset( t, 0, sizeof( trans_t ) );
if ( original ) {
strncpy( t->original, original, MAX_TRANS_STRING );
}
if ( translated ) {
for ( i = 0; i < MAX_LANGUAGES; i++ )
... | 0 | 95,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 void oz_hcd_endpoint_reset(struct usb_hcd *hcd,
struct usb_host_endpoint *ep)
{
}
Commit Message: ozwpan: Use unsigned ints to prevent heap overflow
Using signed integers, the subtraction between required_size and offset
could wind up being negative, resulting in a memcpy into a heap buffer
with a ne... | 0 | 43,184 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void Document::resetLastHandledUserGestureTimestamp()
{
m_lastHandledUserGestureTimestamp = currentTime();
}
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@chrom... | 0 | 102,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: AffineTransform LayoutSVGViewportContainer::viewportTransform() const
{
ASSERT(element());
if (isSVGSVGElement(*element())) {
SVGSVGElement* svg = toSVGSVGElement(element());
return svg->viewBoxToViewTransform(m_viewport.width(), m_viewport.height());
}
return AffineTransform();
... | 0 | 121,142 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: gs_nulldevice(gs_gstate * pgs)
{
int code = 0;
if (pgs->device == 0 || !gx_device_is_null(pgs->device)) {
gx_device *ndev;
code = gs_copydevice(&ndev, (const gx_device *)&gs_null_device,
pgs->memory);
if (code < 0)
return code;... | 1 | 164,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: PlatformSensorFusionTest() {
provider_ = std::make_unique<FakePlatformSensorProvider>();
PlatformSensorProvider::SetProviderForTesting(provider_.get());
}
Commit Message: android: Fix sensors in device service.
This patch fixes a bug that prevented more than one sensor data
to be available at once w... | 0 | 148,966 |
Analyze the following 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_object_storage_debug_info(zval *obj, int *is_temp) /* {{{ */
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(obj);
spl_SplObjectStorageElement *element;
HashTable *props;
zval tmp, storage;
zend_string *md5str;
zend_string *zname;
HashTable *debug_info;
*is_temp = 1;
props = Z_... | 0 | 73,700 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: Response PageHandler::Enable() {
enabled_ = true;
if (GetWebContents() && GetWebContents()->ShowingInterstitialPage())
frontend_->InterstitialShown();
return Response::FallThrough();
}
Commit Message: [DevTools] Do not allow Page.setDownloadBehavior for extensions
Bug: 866426
Change-Id: I71b672978e1a8... | 0 | 143,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: static PHP_FUNCTION(session_status)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_LONG(PS(session_status));
}
Commit Message:
CWE ID: CWE-416 | 0 | 9,594 |
Analyze the following 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 sg_clean(struct usb_sg_request *io)
{
if (io->urbs) {
while (io->entries--)
usb_free_urb(io->urbs[io->entries]);
kfree(io->urbs);
io->urbs = NULL;
}
io->dev = NULL;
}
Commit Message: USB: core: harden cdc_parse_cdc_header
Andrey Konovalov reported a possible out-of-bounds problem for the... | 0 | 59,760 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.