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: PassRefPtr<DocumentParser> Document::createParser()
{
if (isHTMLDocument()) {
bool reportErrors = InspectorInstrumentation::collectingHTMLParseErrors(this->page());
return HTMLDocumentParser::create(toHTMLDocument(this), reportErrors);
}
return XMLDocumentParser::create(this, view());
... | 0 | 102,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 mipspmu_start(struct perf_event *event, int flags)
{
struct hw_perf_event *hwc = &event->hw;
if (!mipspmu)
return;
if (flags & PERF_EF_RELOAD)
WARN_ON_ONCE(!(hwc->state & PERF_HES_UPTODATE));
hwc->state = 0;
/* Set the period for the event. */
mipspmu_event_set_period(event, hwc, hwc->id... | 0 | 25,379 |
Analyze the following 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_get(void *_offset, u64 *val)
{
unsigned offset = (long)_offset;
struct kvm *kvm;
struct kvm_vcpu *vcpu;
int i;
*val = 0;
spin_lock(&kvm_lock);
list_for_each_entry(kvm, &vm_list, vm_list)
kvm_for_each_vcpu(i, vcpu, kvm)
*val += *(u32 *)((void *)vcpu + offset);
spin_unlock(&kvm_l... | 0 | 29,363 |
Analyze the following 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 mm_init_owner(struct mm_struct *mm, struct task_struct *p)
{
mm->owner = p;
}
Commit Message: Move "exit_robust_list" into mm_release()
We don't want to get rid of the futexes just at exit() time, we want to
drop them when doing an execve() too, since that gets rid of the
previous VM image too.
Doing it ... | 0 | 22,173 |
Analyze the following 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 tg3_init_hw(struct tg3 *tp, int reset_phy)
{
tg3_switch_clocks(tp);
tw32(TG3PCI_MEM_WIN_BASE_ADDR, 0);
return tg3_reset_hw(tp, reset_phy);
}
Commit Message: tg3: fix length overflow in VPD firmware parsing
Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version
when present") i... | 0 | 32,592 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: double AffineTransform::yScale() const
{
return sqrt(m_transform[2] * m_transform[2] + m_transform[3] * m_transform[3]);
}
Commit Message: Avoid using forced layout to trigger paint invalidation for SVG containers
Currently, SVG containers in the LayoutObject hierarchy force layout of
their children if t... | 1 | 171,670 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void blkcg_print_blkgs(struct seq_file *sf, struct blkcg *blkcg,
u64 (*prfill)(struct seq_file *,
struct blkg_policy_data *, int),
const struct blkcg_policy *pol, int data,
bool show_total)
{
struct blkcg_gq *blkg;
u64 total = 0;
rcu_read_lock();
hlist_for_each_entry_rcu(b... | 0 | 84,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: gfx::Rect RenderViewTest::GetElementBounds(const std::string& element_id) {
std::vector<std::string> params;
params.push_back(element_id);
std::string script =
base::ReplaceStringPlaceholders(kGetCoordinatesScript, params, NULL);
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope h... | 0 | 123,070 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int __init dccp_v4_init(void)
{
int err = proto_register(&dccp_v4_prot, 1);
if (err != 0)
goto out;
err = inet_add_protocol(&dccp_v4_protocol, IPPROTO_DCCP);
if (err != 0)
goto out_proto_unregister;
inet_register_protosw(&dccp_v4_protosw);
err = register_pernet_subsys(&dccp_v4_ops);
if (err)... | 0 | 18,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: exsltDateSecondsFunction (xmlXPathParserContextPtr ctxt, int nargs)
{
xmlChar *str = NULL;
double ret;
if (nargs > 1) {
xmlXPathSetArityError(ctxt);
return;
}
if (nargs == 1) {
str = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt)) {
xmlXPathSetTypeError(ctxt);
return;
... | 0 | 156,628 |
Analyze the following 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 BN_set_word(BIGNUM *a, BN_ULONG w)
{
bn_check_top(a);
if (bn_expand(a,(int)sizeof(BN_ULONG)*8) == NULL) return(0);
a->neg = 0;
a->d[0] = w;
a->top = (w ? 1 : 0);
bn_check_top(a);
return(1);
}
Commit Message:
CWE ID: CWE-310 | 0 | 14,558 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void CommandBufferProxyImpl::SetChannelErrorCallback(
const base::Closure& callback) {
channel_error_callback_ = callback;
}
Commit Message: Convert plugin and GPU process to brokered handle duplication.
BUG=119250
Review URL: https://chromiumcodereview.appspot.com/9958034
git-svn-id: svn://svn.chromium.... | 0 | 106,736 |
Analyze the following 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 RenderView::didReceiveResponse(
WebFrame* frame, unsigned identifier, const WebURLResponse& response) {
SiteIsolationMetrics::LogMimeTypeForCrossOriginRequest(frame,
identifier,
response);... | 0 | 99,020 |
Analyze the following 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 PaymentHandlerWebFlowViewController::LoadProgressChanged(
content::WebContents* source,
double progress) {
DCHECK(source == web_contents());
progress_bar_->SetValue(progress);
if (progress == 1.0 && show_progress_bar_) {
show_progress_bar_ = false;
UpdateHeaderContentSeparatorView();
... | 0 | 151,121 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: std::string ExtensionWebContentsObserver::GetExtensionIdFromFrame(
content::RenderFrameHost* render_frame_host) const {
content::SiteInstance* site_instance = render_frame_host->GetSiteInstance();
GURL url = render_frame_host->GetLastCommittedURL();
if (!url.is_empty()) {
if (site_instance->GetSiteU... | 0 | 125,187 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: int ext4_orphan_add(handle_t *handle, struct inode *inode)
{
struct super_block *sb = inode->i_sb;
struct ext4_iloc iloc;
int err = 0, rc;
if (!EXT4_SB(sb)->s_journal)
return 0;
mutex_lock(&EXT4_SB(sb)->s_orphan_lock);
if (!list_empty(&EXT4_I(inode)->i_orphan))
goto out_unlock;
/*
* Orphan handlin... | 0 | 32,294 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: RenderFrameDevToolsAgentHost* FindAgentHost(FrameTreeNode* frame_tree_node) {
if (!g_agent_host_instances.IsCreated())
return nullptr;
auto it = g_agent_host_instances.Get().find(frame_tree_node);
return it == g_agent_host_instances.Get().end() ? nullptr : it->second;
}
Commit Message: [DevTools] Do no... | 0 | 143,651 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: std::string caption() { return caption_; }
Commit Message: [Contextual Search] Change "Now on Tap" to "Contextual Cards"
BUG=644934
Review-Url: https://codereview.chromium.org/2361163003
Cr-Commit-Position: refs/heads/master@{#420899}
CWE ID: | 0 | 120,235 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void iov_iter_init(struct iov_iter *i, int direction,
const struct iovec *iov, unsigned long nr_segs,
size_t count)
{
/* It will get better. Eventually... */
if (segment_eq(get_fs(), KERNEL_DS)) {
direction |= ITER_KVEC;
i->type = direction;
i->kvec = (struct kvec *)iov;
} else {
i->type = direc... | 0 | 68,742 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int do_cmdtest_ioctl(struct comedi_device *dev,
struct comedi_cmd __user *arg, void *file)
{
struct comedi_cmd user_cmd;
struct comedi_subdevice *s;
int ret = 0;
unsigned int *chanlist = NULL;
unsigned int __user *chanlist_saver = NULL;
if (copy_from_user(&user_cmd, arg, sizeof(struct comedi_... | 0 | 41,299 |
Analyze the following 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 check_excludes(struct perf_event **ctrs, unsigned int cflags[],
int n_prev, int n_new)
{
int eu = 0, ek = 0, eh = 0;
int i, n, first;
struct perf_event *event;
n = n_prev + n_new;
if (n <= 1)
return 0;
first = 1;
for (i = 0; i < n; ++i) {
if (cflags[i] & PPMU_LIMITED_PMC_OK) {
cfla... | 0 | 22,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: ssize_t iov_iter_get_pages(struct iov_iter *i,
struct page **pages, size_t maxsize, unsigned maxpages,
size_t *start)
{
if (maxsize > i->count)
maxsize = i->count;
if (unlikely(i->type & ITER_PIPE))
return pipe_get_pages(i, pages, maxsize, maxpages, start);
iterate_all_kinds(i, maxsize, v, ({
... | 0 | 68,740 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: _tiffSeekProc(thandle_t fd, toff_t off, int whence)
{
return ((toff_t) lseek((int) fd, (off_t) off, whence));
}
Commit Message: * libtiff/tif_{unix,vms,win32}.c (_TIFFmalloc): ANSI C does not
require malloc() to return NULL pointer if requested allocation
size is zero. Assure that _TIFFmalloc does.
CWE ID: CWE... | 0 | 86,792 |
Analyze the following 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 npidentifier_cache_add_int(NPIdentifier ident, int32_t value)
{
if (G_UNLIKELY(g_npidentifier_cache == NULL))
return;
NPIdentifierInfo *npi = npidentifier_info_new();
if (G_UNLIKELY(npi == NULL))
return;
npi->string_len = 0;
npi->u.value = value;
g_hash_table_insert(g_npidentifier_cache,... | 0 | 27,151 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: Element* HTMLFormElement::ElementFromPastNamesMap(
const AtomicString& past_name) {
if (past_name.IsEmpty() || !past_names_map_)
return nullptr;
Element* element = past_names_map_->at(past_name);
#if DCHECK_IS_ON()
if (!element)
return nullptr;
SECURITY_DCHECK(ToHTMLElement(element)->formOwner... | 0 | 152,216 |
Analyze the following 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 BrowserRenderProcessHost::SetBackgrounded(bool backgrounded) {
backgrounded_ = backgrounded;
if (!child_process_launcher_.get() || child_process_launcher_->IsStarting())
return;
#if defined(OS_WIN)
if (GetModuleHandle(L"cbstext.dll"))
return;
#endif // OS_WIN
child_process_launcher_->SetPr... | 0 | 98,809 |
Analyze the following 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(SoapClient, __getTypes)
{
sdlPtr sdl;
HashPosition pos;
FETCH_THIS_SDL(sdl);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (sdl) {
sdlTypePtr *type;
smart_str buf = {0};
array_init(return_value);
if (sdl->types) {
zend_hash_internal_pointer_reset_ex(sdl->types, &po... | 0 | 14,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: void WebContext::init(
const QWeakPointer<WebContextProxyClient::IOClient>& io_client) {
delegate_->Init(io_client);
}
Commit Message:
CWE ID: CWE-20 | 0 | 16,990 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: release_bmc_device(struct device *dev)
{
kfree(to_bmc_device(dev));
}
Commit Message: ipmi: fix use-after-free of user->release_barrier.rda
When we do the following test, we got oops in ipmi_msghandler driver
while((1))
do
service ipmievd restart & service ipmievd restart
done
-------------------------------... | 0 | 91,315 |
Analyze the following 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::TabDetachedAtImpl(content::WebContents* contents,
bool was_active,
DetachType type) {
if (type == DETACH_TYPE_DETACH) {
if (was_active) {
LocationBar* location_bar = window()->GetLocationBar();
if (location_bar)
... | 0 | 146,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: static enum bp_state update_schedule(enum bp_state state)
{
if (state == BP_WAIT)
return BP_WAIT;
if (state == BP_ECANCELED)
return BP_ECANCELED;
if (state == BP_DONE) {
balloon_stats.schedule_delay = 1;
balloon_stats.retry_count = 1;
return BP_DONE;
}
++balloon_stats.retry_count;
if (balloon_... | 0 | 87,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: int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
struct kvm_sregs *sregs)
{
return -EINVAL;
}
Commit Message: KVM: Ensure all vcpus are consistent with in-kernel irqchip settings
(cherry picked from commit 3e515705a1f46beb1c942bb8043c16f8ac7b1e9e)
If some vcpus are created before KVM_CREATE_IRQCHIP... | 0 | 20,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: static bool vmx_get_nmi_mask(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
bool masked;
if (!enable_vnmi)
return vmx->loaded_vmcs->soft_vnmi_blocked;
if (vmx->loaded_vmcs->nmi_known_unmasked)
return false;
masked = vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & GUEST_INTR_STATE_NMI;
vmx->lo... | 0 | 81,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: GF_Err sgpd_Read(GF_Box *s, GF_BitStream *bs)
{
u32 entry_count;
GF_SampleGroupDescriptionBox *p = (GF_SampleGroupDescriptionBox *)s;
p->grouping_type = gf_bs_read_u32(bs);
ISOM_DECREASE_SIZE(p, 4);
if (p->version>=1) {
p->default_length = gf_bs_read_u32(bs);
ISOM_DECREASE_SIZE(p, 4);
}
if (p->versio... | 0 | 80,401 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: bool StartInputMethodDaemon() {
should_launch_ime_ = true;
return MaybeLaunchInputMethodDaemon();
}
Commit Message: Remove use of libcros from InputMethodLibrary.
BUG=chromium-os:16238
TEST==confirm that input methods work as before on the netbook. Also confirm that the chrome builds and works on t... | 0 | 100,847 |
Analyze the following 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 AppListControllerDelegate::ShowOptionsPage(
Profile* profile,
const std::string& app_id) {
const extensions::Extension* extension = GetExtension(profile, app_id);
if (!extension)
return;
OpenURL(profile,
extensions::OptionsPageInfo::GetOptionsPage(extension),
ui::PAGE_T... | 0 | 123,865 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: AtomicString DateTimeFieldElement::localeIdentifier() const
{
return m_fieldOwner ? m_fieldOwner->localeIdentifier() : nullAtom;
}
Commit Message: INPUT_MULTIPLE_FIELDS_UI: Inconsistent value of aria-valuetext attribute
https://bugs.webkit.org/show_bug.cgi?id=107897
Reviewed by Kentaro Hara.
Source/WebCore... | 0 | 103,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 void VoidMethodPromiseArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestObject* impl = V8TestObject::ToImpl(info.Holder());
if (UNLIKELY(info.Length() < 1)) {
V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodPromiseArg", "TestObject",... | 0 | 135,461 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: invoke_NPN_SetValue(PluginInstance *plugin, NPPVariable variable, void *value)
{
switch (rpc_type_of_NPPVariable(variable)) {
case RPC_TYPE_BOOLEAN:
break;
default:
D(bug("WARNING: unhandled variable %d in NPN_SetValue()\n", variable));
return NPERR_INVALID_PARAM;
}
npw_return_val_if_fail(rpc_method... | 0 | 27,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: gss_pseudo_random (OM_uint32 *minor_status,
gss_ctx_id_t context_handle,
int prf_key,
const gss_buffer_t prf_in,
ssize_t desired_output_len,
gss_buffer_t prf_out)
{
OM_uint32 status;
gss_union_ctx_id_t ctx;
gss_mechanism mech;
if (minor... | 1 | 168,018 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: crm_diff_update(const char *event, xmlNode * msg)
{
int rc = -1;
long now = time(NULL);
const char *op = NULL;
print_dot();
if (current_cib != NULL) {
xmlNode *cib_last = current_cib;
current_cib = NULL;
rc = cib_apply_patch_event(msg, cib_last, ¤t_cib, LOG_DEB... | 0 | 33,935 |
Analyze the following 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 P2PQuicStreamImpl::Reset() {
if (rst_sent()) {
return;
}
quic::QuicStream::Reset(quic::QuicRstStreamErrorCode::QUIC_STREAM_CANCELLED);
}
Commit Message: P2PQuicStream write functionality.
This adds the P2PQuicStream::WriteData function and adds tests. It also
adds the concept of a write buffe... | 0 | 132,712 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: Cluster::Cluster(
Segment* pSegment,
long idx,
long long element_start
/* long long element_size */ ) :
m_pSegment(pSegment),
m_element_start(element_start),
m_index(idx),
m_pos(element_start),
m_element_size(-1 /* element_size */ ),
m_timecode(-1),
m_entries(NULL),
... | 1 | 174,249 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: AllSamplesPassedQuery::AllSamplesPassedQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset,
GLuint service_id)
: Query(manager, target, shm_id, shm_offset),
service_id_(service_id) {
}
Commit Message: Add bounds validation to AsyncPixelTransfersCompletedQuery::End
BUG=... | 0 | 121,424 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: gio_poll_dispatch_add(enum qb_loop_priority p, int32_t fd, int32_t evts,
void *data, qb_ipcs_dispatch_fn_t fn)
{
struct gio_to_qb_poll *adaptor;
GIOChannel *channel;
int32_t res = 0;
res = qb_array_index(gio_map, fd, (void**)&adaptor);
if (res < 0) {
crm_err("Array l... | 0 | 33,903 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: sctp_disposition_t sctp_sf_do_asconf_ack(struct net *net,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type, void *arg,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *asconf_ack = arg;
struct sctp_chunk *last_asconf = asoc->addip_last_asconf;
... | 0 | 31,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: static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
struct tg3 *tp = netdev_priv(dev);
if (tg3_flag(tp, USE_PHYLIB)) {
struct phy_device *phydev;
if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED))
return -EAGAIN;
phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
return phy_et... | 0 | 32,574 |
Analyze the following 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 sock_edemux(struct sk_buff *skb)
{
struct sock *sk = skb->sk;
#ifdef CONFIG_INET
if (sk->sk_state == TCP_TIME_WAIT)
inet_twsk_put(inet_twsk(sk));
else
#endif
sock_put(sk);
}
Commit Message: net: guard tcp_set_keepalive() to tcp sockets
Its possible to use RAW sockets to get a crash in
tcp_set_keepa... | 0 | 41,076 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int tls1_alpn_handle_client_hello_late(SSL *s, int *ret, int *al)
{
const unsigned char *selected = NULL;
unsigned char selected_len = 0;
if (s->ctx->alpn_select_cb != NULL && s->cert->alpn_proposed != NULL) {
int r = s->ctx->alpn_select_cb(s, &selected, &selected_len,
... | 0 | 12,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: setup_sam(void)
{
return krb5_c_make_random_key(kdc_context, ENCTYPE_DES_CBC_MD5, &psr_key);
}
Commit Message: Multi-realm KDC null deref [CVE-2013-1418]
If a KDC serves multiple realms, certain requests can cause
setup_server_realm() to dereference a null pointer, crashing the KDC.
CVSSv2: AV:N/AC:M/Au:N/... | 0 | 28,283 |
Analyze the following 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::GetNavigationHistory(
int* current_index,
std::unique_ptr<NavigationEntries>* entries) {
WebContentsImpl* web_contents = GetWebContents();
if (!web_contents)
return Response::InternalError();
NavigationController& controller = web_contents->GetController();
*current_inde... | 0 | 143,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: void WebGL2RenderingContextBase::deleteFramebuffer(
WebGLFramebuffer* framebuffer) {
if (!DeleteObject(framebuffer))
return;
GLenum target = 0;
if (framebuffer == framebuffer_binding_) {
if (framebuffer == read_framebuffer_binding_) {
target = GL_FRAMEBUFFER;
framebuffer_binding_ = n... | 0 | 133,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: int bprm_change_interp(char *interp, struct linux_binprm *bprm)
{
/* If a binfmt changed the interp, free it first. */
if (bprm->interp != bprm->filename)
kfree(bprm->interp);
bprm->interp = kstrdup(interp, GFP_KERNEL);
if (!bprm->interp)
return -ENOMEM;
return 0;
}
Commit Message: exec/ptrace: fix get_... | 0 | 30,886 |
Analyze the following 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_cod_dumpparms(jpc_ms_t *ms, FILE *out)
{
jpc_cod_t *cod = &ms->parms.cod;
int i;
fprintf(out, "csty = 0x%02x;\n", cod->compparms.csty);
fprintf(out, "numdlvls = %d; qmfbid = %d; mctrans = %d\n",
cod->compparms.numdlvls, cod->compparms.qmfbid, cod->mctrans);
fprintf(out, "prg = %d; numlyrs =... | 0 | 72,836 |
Analyze the following 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 gdImageAABlend (gdImagePtr im)
{
float p_alpha, old_alpha;
int color = im->AA_color, color_red, color_green, color_blue;
int old_color, old_red, old_green, old_blue;
int p_color, p_red, p_green, p_blue;
int px, py;
color_red = gdImageRed(im, color);
color_green = gdImageGreen(im, color);
color_blue ... | 0 | 51,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: char *auth_server(int f_in, int f_out, int module, const char *host,
const char *addr, const char *leader)
{
char *users = lp_auth_users(module);
char challenge[MAX_DIGEST_LEN*2];
char line[BIGPATHBUFLEN];
char **auth_uid_groups = NULL;
int auth_uid_groups_cnt = -1;
const char *err = NULL;
int group_ma... | 1 | 164,641 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ScopedJavaLocalRef<jstring> WebContentsAndroid::GetVisibleURL(
JNIEnv* env, jobject obj) const {
return base::android::ConvertUTF8ToJavaString(
env, web_contents_->GetVisibleURL().spec());
}
Commit Message: Revert "Load web contents after tab is created."
This reverts commit 4c55f398def3214369aefa9f... | 0 | 109,884 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: test_bson_append_general (void)
{
uint8_t bytes[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x23, 0x45};
bson_oid_t oid;
bson_t *bson;
bson_t *array;
bson_t *subdoc;
bson = bson_new ();
BSON_ASSERT (bson_append_int32 (bson, "int", -1, 1));
BSON_ASSERT_BSON_EQUAL_FILE (bson, "test1.bson");
... | 0 | 77,882 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static const struct rule *next_rule(void)
{
struct rule *rule;
/* Open conf file if we didn't do it yet */
if (!G.parser && G.filename) {
dbg("config_open('%s')", G.filename);
G.parser = config_open2(G.filename, fopen_for_read);
G.filename = NULL;
}
if (G.rule_vec) {
/* mdev -s */
/* Do we have r... | 0 | 3,871 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: util_fatal(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
fprintf(stderr, "error: ");
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\nAborting.\n");
va_end(ap);
sc_notify_close();
exit(1);
}
Commit Message: fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting t... | 0 | 78,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: void QQuickWebViewPrivate::setContentPos(const QPointF& pos)
{
Q_Q(QQuickWebView);
q->setContentX(pos.x());
q->setContentY(pos.y());
}
Commit Message: [Qt][WK2] There's no way to test the gesture tap on WTR
https://bugs.webkit.org/show_bug.cgi?id=92895
Reviewed by Kenneth Rohde Christiansen.
Source... | 0 | 108,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: static int validatecieaspace(i_ctx_t * i_ctx_p, ref **r)
{
int code;
float value[9];
ref CIEdict, *CIEspace = *r, *tempref;
if (!r_is_array(CIEspace))
return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(CIEspace) != 2)
... | 0 | 3,161 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: apprentice_load(struct magic_set *ms, const char *fn, int action)
{
int errs = 0;
uint32_t i, j;
size_t files = 0, maxfiles = 0;
char **filearr = NULL, *mfn;
struct stat st;
struct magic_map *map;
struct magic_entry_set mset[MAGIC_SETS];
DIR *dir;
struct dirent *d;
memset(mset, 0, sizeof(mset));
ms->f... | 0 | 37,956 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void BookmarksExportFunction::FileSelected(const base::FilePath& path,
int index,
void* params) {
#if !defined(OS_ANDROID)
bookmark_html_writer::WriteBookmarks(profile(), path, NULL);
#endif
Release(); // Balanced in Bookma... | 0 | 115,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 Textfield::ExtendSelectionAndDelete(size_t before, size_t after) {
gfx::Range range = GetRenderText()->selection();
DCHECK_GE(range.start(), before);
range.set_start(range.start() - before);
range.set_end(range.end() + after);
gfx::Range text_range;
if (GetTextRange(&text_range) && text_range.Co... | 0 | 126,309 |
Analyze the following 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 _safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset)
{
return perealloc(ptr, safe_address(nmemb, size, offset), 1);
}
Commit Message: Fix bug #72742 - memory allocator fails to realloc small block to large one
CWE ID: CWE-190 | 0 | 50,160 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ResourceDispatcherHostImpl::LoadInfo::~LoadInfo() {}
Commit Message: When turning a download into a navigation, navigate the right frame
Code changes from Nate Chapin <japhet@chromium.org>
Bug: 926105
Change-Id: I098599394e6ebe7d2fce5af838014297a337d294
Reviewed-on: https://chromium-review.googlesource.com/c/1... | 0 | 152,055 |
Analyze the following 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 rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer)
{
struct buffer_page *reader = cpu_buffer->reader_page;
struct buffer_page *head = rb_set_head_page(cpu_buffer);
struct buffer_page *commit = cpu_buffer->commit_page;
/* In case of error, head will be NULL */
if (unlikely(!head))
return ... | 0 | 72,568 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: uriPathTest(const char *filename ATTRIBUTE_UNUSED,
const char *result ATTRIBUTE_UNUSED,
const char *err ATTRIBUTE_UNUSED,
int options ATTRIBUTE_UNUSED) {
int parsed;
int failures = 0;
/*
* register the new I/O handlers
*/
if (xmlRegisterInputCallba... | 0 | 59,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: void ChromeClientImpl::UnregisterPopupOpeningObserver(
PopupOpeningObserver* observer) {
size_t index = popup_opening_observers_.Find(observer);
DCHECK_NE(index, kNotFound);
popup_opening_observers_.erase(index);
}
Commit Message: If a page shows a popup, end fullscreen.
This was implemented in Blink ... | 0 | 150,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: void RenderFrameImpl::OnTextTrackSettingsChanged(
const FrameMsg_TextTrackSettings_Params& params) {
DCHECK(!frame_->parent());
if (!render_view_->webview())
return;
if (params.text_tracks_enabled) {
render_view_->webview()->settings()->setTextTrackKindUserPreference(
WebSettings::T... | 0 | 123,178 |
Analyze the following 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::shouldSendCSPHeader(Resource::Type type) const {
for (const auto& policy : m_policies) {
if (policy->shouldSendCSPHeader(type))
return true;
}
return false;
}
Commit Message: CSP: Strip the fragment from reported URLs.
We should have been stripping the fragment from t... | 0 | 136,806 |
Analyze the following 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 dispatchSimAuthentication(Parcel &p, RequestInfo *pRI)
{
RIL_SimAuthentication pf;
int32_t t;
status_t status;
memset(&pf, 0, sizeof(pf));
status = p.readInt32(&t);
pf.authContext = (int) t;
pf.authData = strdupReadString(p);
pf.aid = strdupReadString(p);
startRequest... | 0 | 162,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: sp<AMessage> NuPlayer::GenericSource::getTrackInfo(size_t trackIndex) const {
size_t trackCount = mSources.size();
if (trackIndex >= trackCount) {
return NULL;
}
sp<AMessage> format = new AMessage();
sp<MetaData> meta = mSources.itemAt(trackIndex)->getFormat();
const char *mime;
CHECK(meta->fin... | 0 | 160,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: void ff_mpv_report_decode_progress(MpegEncContext *s)
{
if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->er.error_occurred)
ff_thread_report_progress(&s->current_picture_ptr->tf, s->mb_y, 0);
}
Commit Message: avcodec/idctdsp: Transmit studio_profile to init instead of using AVCo... | 0 | 81,741 |
Analyze the following 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 xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
struct nlattr **attrs)
{
struct net *net = sock_net(skb->sk);
struct xfrm_usersa_info *p = nlmsg_data(nlh);
struct xfrm_state *x;
int err;
struct km_event c;
uid_t loginuid = audit_get_loginuid(current);
u32 sessionid = audit_get_sessionid... | 0 | 33,133 |
Analyze the following 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_xcr(struct kvm_vcpu *vcpu, u32 index, u64 xcr)
{
u64 xcr0 = xcr;
u64 old_xcr0 = vcpu->arch.xcr0;
u64 valid_bits;
/* Only support XCR_XFEATURE_ENABLED_MASK(xcr0) now */
if (index != XCR_XFEATURE_ENABLED_MASK)
return 1;
if (!(xcr0 & XSTATE_FP))
return 1;
if ((xcr0 & XSTATE_YMM) && !(xcr0 ... | 0 | 35,752 |
Analyze the following 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 HTMLInputElement::IsOutOfRange() const {
return willValidate() && input_type_->IsOutOfRange(value());
}
Commit Message: MacViews: Enable secure text input for password Textfields.
In Cocoa the NSTextInputContext automatically enables secure text input
when activated and it's in the secure text entry mode... | 0 | 126,050 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static unsigned int __ctrblk_init(u8 *ctrptr, unsigned int nbytes)
{
unsigned int i, n;
/* align to block size, max. PAGE_SIZE */
n = (nbytes > PAGE_SIZE) ? PAGE_SIZE : nbytes & ~(DES_BLOCK_SIZE - 1);
for (i = DES_BLOCK_SIZE; i < n; i += DES_BLOCK_SIZE) {
memcpy(ctrptr + i, ctrptr + i - DES_BLOCK_SIZE, DES... | 0 | 46,684 |
Analyze the following 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 jslSeekToP(JslCharPos *seekToChar) {
if (lex->it.var) jsvLockAgain(lex->it.var); // see jslGetNextCh
jsvStringIteratorFree(&lex->it);
lex->it = jsvStringIteratorClone(&seekToChar->it);
jsvUnLock(lex->it.var); // see jslGetNextCh
lex->currCh = seekToChar->currCh;
lex->tokenStart.it.var = 0;
lex-... | 0 | 82,543 |
Analyze the following 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 NavigationRequest::OnFailureChecksComplete(
RenderFrameHostImpl* render_frame_host,
NavigationThrottle::ThrottleCheckResult result) {
DCHECK(result.action() != NavigationThrottle::DEFER);
net_error_ = result.net_error_code();
navigation_handle_->set_net_error_code(static_cast<net::Error>(net_e... | 0 | 144,122 |
Analyze the following 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 CustomButton::OnMouseDragged(const ui::MouseEvent& event) {
if (state_ != STATE_DISABLED) {
if (HitTestPoint(event.location()))
SetState(ShouldEnterPushedState(event) ? STATE_PRESSED : STATE_HOVERED);
else
SetState(STATE_NORMAL);
}
return true;
}
Commit Message: Custom buttons shou... | 0 | 132,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: gss_wrap_aead (minor_status,
context_handle,
conf_req_flag,
qop_req,
input_assoc_buffer,
input_payload_buffer,
conf_state,
output_message_buffer)
OM_uint32 * minor_status;
gss_ctx_id_t context_handle;
int conf_req_flag;... | 1 | 168,028 |
Analyze the following 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 InputDispatcherThread::threadLoop() {
mDispatcher->dispatchOnce();
return true;
}
Commit Message: Add new MotionEvent flag for partially obscured windows.
Due to more complex window layouts resulting in lots of overlapping
windows, the policy around FLAG_WINDOW_IS_OBSCURED has changed to
only be set w... | 0 | 163,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: ProcXF86DRIOpenConnection(register ClientPtr client)
{
xXF86DRIOpenConnectionReply rep;
drm_handle_t hSAREA;
char *busIdString;
CARD32 busIdStringLength = 0;
REQUEST(xXF86DRIOpenConnectionReq);
REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq);
if (stuff->screen >= screenInfo.numScreens) ... | 0 | 17,741 |
Analyze the following 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 Ins_ISECT( INS_ARG )
{
Long point, /* are these Ints or Longs? */
a0, a1,
b0, b1;
TT_F26Dot6 discriminant;
TT_F26Dot6 dx, dy,
dax, day,
dbx, dby;
TT_F26Dot6 val;
TT_Vector R;
point = args[0];
a0... | 0 | 5,398 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: struct key *request_key_auth_new(struct key *target, const void *callout_info,
size_t callout_len, struct key *dest_keyring)
{
struct request_key_auth *rka, *irka;
const struct cred *cred = current->cred;
struct key *authkey = NULL;
char desc[20];
int ret = -ENOMEM;
kenter("%d,", target->serial);
/*... | 0 | 60,287 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ScriptedAnimationController& Document::ensureScriptedAnimationController()
{
if (!m_scriptedAnimationController) {
m_scriptedAnimationController = ScriptedAnimationController::create(this);
if (!page())
m_scriptedAnimationController->suspend();
}
return *m_scriptedAnimation... | 0 | 102,718 |
Analyze the following 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 unicast_flush_resp(struct sock *sk, const struct sadb_msg *ihdr)
{
struct sk_buff *skb;
struct sadb_msg *hdr;
skb = alloc_skb(sizeof(struct sadb_msg) + 16, GFP_ATOMIC);
if (!skb)
return -ENOBUFS;
hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg));
memcpy(hdr, ihdr, sizeof(struct ... | 0 | 31,484 |
Analyze the following 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 BlinkTestRunner::EvaluateInWebInspector(long call_id,
const std::string& script) {
WebDevToolsAgent* agent =
render_view()->GetMainRenderFrame()->GetWebFrame()->devToolsAgent();
if (agent)
agent->evaluateInWebInspector(call_id, WebString::fromUTF8(sc... | 0 | 123,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: static int check_map_func_compatibility(struct bpf_verifier_env *env,
struct bpf_map *map, int func_id)
{
if (!map)
return 0;
/* We need a two way check, first is from map perspective ... */
switch (map->map_type) {
case BPF_MAP_TYPE_PROG_ARRAY:
if (func_id != BPF_FUNC_tail_call)
goto error;
br... | 0 | 76,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: UserInitiatedInfo CreateUserInitiatedInfo(
content::NavigationHandle* navigation_handle,
PageLoadTracker* committed_load) {
if (!navigation_handle->IsRendererInitiated())
return UserInitiatedInfo::BrowserInitiated();
return UserInitiatedInfo::RenderInitiated(
navigation_handle->HasUserGe... | 1 | 172,495 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: bool netlink_net_capable(const struct sk_buff *skb, int cap)
{
return netlink_ns_capable(skb, sock_net(skb->sk)->user_ns, cap);
}
Commit Message: netlink: Fix dump skb leak/double free
When we free cb->skb after a dump, we do it after releasing the
lock. This means that a new dump could have started in the ti... | 0 | 47,756 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: struct sk_buff *tcp_get_timestamping_opt_stats(const struct sock *sk)
{
const struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *stats;
struct tcp_info info;
stats = alloc_skb(3 * nla_total_size_64bit(sizeof(u64)), GFP_ATOMIC);
if (!stats)
return NULL;
tcp_get_info_chrono_stats(tp, &info);
nla_put_u64_6... | 0 | 68,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 int PC4500_writerid(struct airo_info *ai, u16 rid,
const void *pBuf, int len, int lock)
{
u16 status;
int rc = SUCCESS;
*(__le16*)pBuf = cpu_to_le16((u16)len);
if (lock) {
if (down_interruptible(&ai->sem))
return ERROR;
}
if (test_bit(FLAG_MPI,&ai->flags)) {
Cmd cmd;
Resp rsp;
if ... | 0 | 23,937 |
Analyze the following 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 vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
{
struct file *eventfp, *filep = NULL;
bool pollstart = false, pollstop = false;
struct eventfd_ctx *ctx = NULL;
u32 __user *idxp = argp;
struct vhost_virtqueue *vq;
struct vhost_vring_state s;
struct vhost_vring_file f;
struct... | 0 | 33,805 |
Analyze the following 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 CLASS ljpeg_diff (ushort *huff)
{
int len, diff;
len = gethuff(huff);
if (len == 16 && (!dng_version || dng_version >= 0x1010000))
return -32768;
diff = getbits(len);
if ((diff & (1 << (len-1))) == 0)
diff -= (1 << len) - 1;
return diff;
}
Commit Message: Avoid overflow in ljpeg_start().... | 0 | 43,310 |
Analyze the following 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_gf2m_mod_mul(BIO *bp,BN_CTX *ctx)
{
BIGNUM *a,*b[2],*c,*d,*e,*f,*g,*h;
int i, j, ret = 0;
int p0[] = {163,7,6,3,0,-1};
int p1[] = {193,15,0,-1};
a=BN_new();
b[0]=BN_new();
b[1]=BN_new();
c=BN_new();
d=BN_new();
e=BN_new();
f=BN_new();
g=BN_new();
h=BN_new();
BN_GF2m_arr2poly(p0, b[0]);
... | 0 | 46,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: Extension::ManifestData* Extension::GetManifestData(const std::string& key)
const {
DCHECK(finished_parsing_manifest_ || thread_checker_.CalledOnValidThread());
ManifestDataMap::const_iterator iter = manifest_data_.find(key);
if (iter != manifest_data_.end())
return iter->second.get();
return NULL... | 0 | 114,299 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: vrrp_gglobal_tracking_handler(__attribute__((unused)) vector_t *strvec)
{
vrrp_sgroup_t *vgroup = LIST_TAIL_DATA(vrrp_data->vrrp_sync_group);
report_config_error(CONFIG_GENERAL_ERROR, "(%s) global_tracking is deprecated. Use track_interface/script/file on the sync group", vgroup->gname);
vgroup->sgroup_tracki... | 0 | 75,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.