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: serverStatus_t *CL_GetServerStatus( netadr_t from ) {
int i, oldest, oldestTime;
for ( i = 0; i < MAX_SERVERSTATUSREQUESTS; i++ ) {
if ( NET_CompareAdr( from, cl_serverStatusList[i].address ) ) {
return &cl_serverStatusList[i];
}
}
for ( i = 0; i < MAX_SERVERSTATUSREQUESTS; i++ ) {
if ( cl_serverSta... | 0 | 95,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: MagickExport MagickBooleanType SetImageColor(Image *image,
const PixelInfo *color,ExceptionInfo *exception)
{
CacheView
*image_view;
MagickBooleanType
status;
ssize_t
y;
assert(image != (Image *) NULL);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModul... | 0 | 94,850 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: int main(int argc, char** argv)
{
/* Kernel starts us with all fd's closed.
* But it's dangerous:
* fprintf(stderr) can dump messages into random fds, etc.
* Ensure that if any of fd 0,1,2 is closed, we open it to /dev/null.
*/
int fd = xopen("/dev/null", O_RDWR);
while (fd < 2)
f... | 1 | 170,135 |
Analyze the following 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 qeth_clean_channel(struct qeth_channel *channel)
{
int cnt;
QETH_DBF_TEXT(SETUP, 2, "freech");
for (cnt = 0; cnt < QETH_CMD_BUFFER_NO; cnt++)
kfree(channel->iob[cnt].data);
}
Commit Message: qeth: avoid buffer overflow in snmp ioctl
Check user-defined length in snmp ioctl request and allow req... | 0 | 28,487 |
Analyze the following 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 LocalSiteCharacteristicsWebContentsObserver::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(navigation_handle);
if (!navigation_handle->IsInMainFrame() ||
navigation_handle->IsSameDocument()) {
return;
}
... | 1 | 172,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 _xml_defaultHandler(void *userData, const XML_Char *s, int len)
{
xml_parser *parser = (xml_parser *)userData;
if (parser && parser->defaultHandler) {
zval *retval, *args[2];
args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(s, len, parser->target_encoding);
if ((retval = x... | 0 | 10,988 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static inline void cow_user_page(struct page *dst, struct page *src, unsigned long va, struct vm_area_struct *vma)
{
/*
* If the source page was a PFN mapping, we don't have
* a "struct page" for it. We do a best-effort copy by
* just copying from the original user address. If that
* fails, we just zero-... | 0 | 21,218 |
Analyze the following 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 ff_init_poc(H264Context *h, int pic_field_poc[2], int *pic_poc)
{
const int max_frame_num = 1 << h->sps.log2_max_frame_num;
int field_poc[2];
h->frame_num_offset = h->prev_frame_num_offset;
if (h->frame_num < h->prev_frame_num)
h->frame_num_offset += max_frame_num;
if (h->sps.poc... | 0 | 28,231 |
Analyze the following 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 list_keys(void)
{
int r, idx = 0;
sc_path_t path;
u8 buf[2048], *p = buf;
size_t keysize, i;
int mod_lens[] = { 512, 768, 1024, 2048 };
size_t sizes[] = { 167, 247, 327, 647 };
r = select_app_df();
if (r)
return 1;
sc_format_path("I1012", &path);
r = sc_select_file(card, &path, NULL);
if ... | 0 | 78,876 |
Analyze the following 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 intel_pmu_enable_fixed(struct hw_perf_event *hwc)
{
int idx = hwc->idx - X86_PMC_IDX_FIXED;
u64 ctrl_val, bits, mask;
/*
* Enable IRQ generation (0x8),
* and enable ring-3 counting (0x2) and ring-0 counting (0x1)
* if requested:
*/
bits = 0x8ULL;
if (hwc->config & ARCH_PERFMON_EVENTSEL_U... | 0 | 25,815 |
Analyze the following 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 close_files(struct files_struct * files)
{
int i, j;
struct fdtable *fdt;
j = 0;
/*
* It is safe to dereference the fd table without RCU or
* ->file_lock because this is the last reference to the
* files structure.
*/
fdt = files_fdtable(files);
for (;;) {
unsigned long set;
i = j ... | 0 | 22,100 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void state(struct connectdata *conn, smtpstate newstate)
{
struct smtp_conn *smtpc = &conn->proto.smtpc;
#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS)
/* for debug purposes */
static const char * const names[] = {
"STOP",
"SERVERGREET",
"EHLO",
"HELO",
"STARTTL... | 0 | 85,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 inline void shmem_unacct_blocks(unsigned long flags, long pages)
{
if (flags & VM_NORESERVE)
vm_unacct_memory(pages * VM_ACCT(PAGE_CACHE_SIZE));
}
Commit Message: tmpfs: fix use-after-free of mempolicy object
The tmpfs remount logic preserves filesystem mempolicy if the mpol=M
option is not specified ... | 0 | 33,554 |
Analyze the following 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 sctp_v4_copy_addrlist(struct list_head *addrlist,
struct net_device *dev)
{
struct in_device *in_dev;
struct in_ifaddr *ifa;
struct sctp_sockaddr_entry *addr;
rcu_read_lock();
if ((in_dev = __in_dev_get_rcu(dev)) == NULL) {
rcu_read_unlock();
return;
}
for (ifa = in_dev->ifa_list; i... | 0 | 42,931 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: sec_parse_crypt_info(STREAM s, uint32 * rc4_key_size,
uint8 ** server_random, uint8 * modulus, uint8 * exponent)
{
uint32 crypt_level, random_len, rsa_info_len;
uint32 cacert_len, cert_len, flags;
RDSSL_CERT *cacert, *server_cert;
RDSSL_RKEY *server_public_key;
uint16 tag, length;
uint8 *next_tag, *e... | 0 | 93,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: void QQuickWebView::mousePressEvent(QMouseEvent* event)
{
Q_D(QQuickWebView);
forceActiveFocus();
d->handleMouseEvent(event);
}
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/WebKit... | 0 | 108,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: static void perf_event_free_bpf_handler(struct perf_event *event)
{
struct bpf_prog *prog = event->prog;
if (!prog)
return;
WRITE_ONCE(event->overflow_handler, event->orig_overflow_handler);
event->prog = NULL;
bpf_prog_put(prog);
}
Commit Message: perf/core: Fix concurrent sys_perf_event_open() vs. 'mo... | 0 | 68,362 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static inline void map_to_unicode(unsigned code, const enc_to_uni *table, unsigned *res)
{
/* only single byte encodings are currently supported; assumed code <= 0xFF */
*res = table->inner[ENT_ENC_TO_UNI_STAGE1(code)]->uni_cp[ENT_ENC_TO_UNI_STAGE2(code)];
}
Commit Message: Fix bug #72135 - don't create string... | 0 | 52,201 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void claim_allocations(int cpu, struct sched_domain *sd)
{
struct sd_data *sdd = sd->private;
WARN_ON_ONCE(*per_cpu_ptr(sdd->sd, cpu) != sd);
*per_cpu_ptr(sdd->sd, cpu) = NULL;
if (atomic_read(&(*per_cpu_ptr(sdd->sg, cpu))->ref))
*per_cpu_ptr(sdd->sg, cpu) = NULL;
if (atomic_read(&(*per_cpu_ptr(s... | 0 | 58,137 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static inline int get_cur_mix_raw(struct usb_mixer_elem_info *cval,
int channel, int *value)
{
return get_ctl_value(cval, UAC_GET_CUR,
(cval->control << 8) | channel,
value);
}
Commit Message: ALSA: usb-audio: Kill stray URB at exiting
USB-audio driver may leave a stray URB for the mixer ... | 0 | 59,975 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: eXosip_listen_addr (struct eXosip_t *excontext, int transport, const char *addr, int port, int family, int secure)
{
int i = -1;
if (excontext->eXtl_transport.enabled > 0) {
/* already set */
OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_ERROR, NULL, "eXosip: already listening somewhere\n"));
... | 0 | 17,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: static void InsertTabContentses(TabStripModel* tabstrip,
TabContentsWrapper* contents1,
TabContentsWrapper* contents2,
TabContentsWrapper* contents3) {
tabstrip->InsertTabContentsAt(GetInsertionIndex(tabstrip, conten... | 0 | 98,164 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void IsPinnedToTaskbarHelper::OnIsPinnedToTaskbarResult(
bool succeeded,
bool is_pinned_to_taskbar) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
result_callback_.Run(succeeded, is_pinned_to_taskbar);
delete this;
}
Commit Message: Validate external protocols before launching on Windows
B... | 0 | 144,676 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ExponentialFunction::ExponentialFunction(const ExponentialFunction *func) : Function(func) {
memcpy(c0, func->c0, funcMaxOutputs * sizeof(double));
memcpy(c1, func->c1, funcMaxOutputs * sizeof(double));
e = func->e;
isLinear = func->isLinear;
ok = func->ok;
}
Commit Message:
CWE ID: CWE-119 | 0 | 4,158 |
Analyze the following 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 blk_queue_exit(struct request_queue *q)
{
percpu_ref_put(&q->q_usage_counter);
}
Commit Message: block: blk_init_allocated_queue() set q->fq as NULL in the fail case
We find the memory use-after-free issue in __blk_drain_queue()
on the kernel 4.14. After read the latest kernel 4.18-rc6 we
think it has the... | 0 | 92,013 |
Analyze the following 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 mem_seek(jas_stream_obj_t *obj, long offset, int origin)
{
jas_stream_memobj_t *m = (jas_stream_memobj_t *)obj;
long newpos;
switch (origin) {
case SEEK_SET:
newpos = offset;
break;
case SEEK_END:
newpos = m->len_ - offset;
break;
case SEEK_CUR:
newpos = m->pos_ + offset;
break;
de... | 0 | 73,211 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int cdrom_ioctl_disc_status(struct cdrom_device_info *cdi)
{
tracktype tracks;
cd_dbg(CD_DO_IOCTL, "entering CDROM_DISC_STATUS\n");
cdrom_count_tracks(cdi, &tracks);
if (tracks.error)
return tracks.error;
/* Policy mode on */
if (tracks.audio > 0) {
if (!tracks.data && !tracks.cdi && !tracks.x... | 0 | 76,229 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: content::WebUI* WebUILoginView::GetWebUI() {
return webui_login_->web_contents()->GetWebUI();
}
Commit Message: [cros] Allow media streaming for OOBE WebUI.
BUG=122764
TEST=Manual with --enable-html5-camera
Review URL: https://chromiumcodereview.appspot.com/10693027
git-svn-id: svn://svn.chromium.org/chro... | 0 | 103,456 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
{
if (!TIFFCheckTile(tif, x, y, z, s))
return ((tmsize_t)(-1));
/*
* NB: A tile size of -1 is used instead of tif_tilesize knowing
* that TIFFWriteEncodedTile will clamp this to the tile size.
* This is done because the ... | 0 | 48,331 |
Analyze the following 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 sd_release(struct gendisk *disk, fmode_t mode)
{
struct scsi_disk *sdkp = scsi_disk(disk);
struct scsi_device *sdev = sdkp->device;
SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, "sd_release\n"));
if (atomic_dec_return(&sdkp->openers) == 0 && sdev->removable) {
if (scsi_block_when_processing_er... | 0 | 94,408 |
Analyze the following 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 handle_apic_access(struct kvm_vcpu *vcpu)
{
if (likely(fasteoi)) {
unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
int access_type, offset;
access_type = exit_qualification & APIC_ACCESS_TYPE;
offset = exit_qualification & APIC_ACCESS_OFFSET;
/*
* Sane guest uses MOV t... | 0 | 48,023 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void put_tty_driver(struct tty_driver *d)
{
tty_driver_kref_put(d);
}
Commit Message: tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)
ioctl(TIOCGETD) retrieves the line discipline id directly from the
ldisc because the line discipline id (c_line) in termios is untrustworthy;
userspace may have set termios ... | 0 | 55,877 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static char *revealextraspc(char * const s_)
{
unsigned char *s = (unsigned char *) s_;
unsigned char *sn;
if (s == NULL) {
return s_;
}
simplify(s_);
while (*s != 0U && isspace(*s)) {
*s++ = '_';
}
if (*s == 0U) {
return s_;
}
sn = s;
do {
... | 0 | 18,421 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes)
{
int offset;
int minforkoff; /* lower limit on valid forkoff locations */
int maxforkoff; /* upper limit on valid forkoff locations */
int dsize;
xfs_mount_t *mp = dp->i_mount;
/* rounded down */
offset = (XFS_LITINO(mp, dp->i_d.di_version) - bytes)... | 0 | 44,953 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: posix_acl_default_exists(struct inode *inode)
{
if (!S_ISDIR(inode->i_mode))
return 0;
return xfs_acl_exists(inode, SGI_ACL_DEFAULT);
}
Commit Message: xfs: validate acl count
This prevents in-memory corruption and possible panics if the on-disk
ACL is badly corrupted.
Signed-off-by: Christoph Hellwig <hch... | 0 | 21,926 |
Analyze the following 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 RenderFrameHostManager::Stop() {
render_frame_host_->Stop();
if (speculative_render_frame_host_ &&
speculative_render_frame_host_->is_loading()) {
speculative_render_frame_host_->Send(
new FrameMsg_Stop(speculative_render_frame_host_->GetRoutingID()));
}
}
Commit Message: Fix issue ... | 0 | 146,848 |
Analyze the following 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 anotherStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
v8SetReturnValueString(info, imp->fastGetAttribute(HTMLNames::ReflectUrlAttributeAsAStringAttr), info.GetIsolate());
}
Commit Message: ... | 0 | 122,132 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void btrfs_writepage_fixup_worker(struct btrfs_work *work)
{
struct btrfs_writepage_fixup *fixup;
struct btrfs_ordered_extent *ordered;
struct extent_state *cached_state = NULL;
struct page *page;
struct inode *inode;
u64 page_start;
u64 page_end;
int ret;
fixup = container_of(work, struct btrfs_... | 0 | 34,367 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void ChromeContentBrowserClient::SiteInstanceDeleting(
SiteInstance* site_instance) {
if (!site_instance->HasProcess())
return;
for (size_t i = 0; i < extra_parts_.size(); ++i)
extra_parts_[i]->SiteInstanceDeleting(site_instance);
}
Commit Message: Move IsDataSaverEnabledByUser to be a static me... | 0 | 142,769 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int ext3_release_dquot(struct dquot *dquot)
{
int ret, err;
handle_t *handle;
handle = ext3_journal_start(dquot_to_inode(dquot),
EXT3_QUOTA_DEL_BLOCKS(dquot->dq_sb));
if (IS_ERR(handle)) {
/* Release dquot anyway to avoid endless cycle in dqput() */
dquot_release(dquot);
return PTR_ERR(hand... | 0 | 32,945 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
MOVStreamContext *sc;
int i, edit_count, version;
if (c->fc->nb_streams < 1 || c->ignore_editlist)
return 0;
sc = c->fc->streams[c->fc->nb_streams-1]->priv_data;
version = avio_r8(pb); /* version */
avio_rb2... | 0 | 61,432 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ScreenSaverExtensionInit(void)
{
ExtensionEntry *extEntry;
int i;
ScreenPtr pScreen;
if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
return;
AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
SaverEventType = CreateNewResourceType(ScreenSaver... | 0 | 17,416 |
Analyze the following 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 RenderWidgetHostImpl::SendScreenRects() {
if (!renderer_initialized_ || waiting_for_screen_rects_ack_)
return;
if (is_hidden_) {
return;
}
if (!view_)
return;
last_view_screen_rect_ = view_->GetViewBounds();
last_window_screen_rect_ = view_->GetBoundsInRootWindow();
Send(new View... | 0 | 114,704 |
Analyze the following 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 php_snmp_read_max_oids(php_snmp_object *snmp_object, zval *retval)
{
if (snmp_object->max_oids > 0) {
ZVAL_LONG(retval, snmp_object->max_oids);
} else {
ZVAL_NULL(retval);
}
return SUCCESS;
}
Commit Message:
CWE ID: CWE-20 | 0 | 11,239 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: LastEventTimeToggleResetFlag(int deviceid, Bool state)
{
lastDeviceEventTime[deviceid].reset = state;
}
Commit Message:
CWE ID: CWE-119 | 0 | 4,856 |
Analyze the following 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 virtqueue_unmap_sg(VirtQueue *vq, const VirtQueueElement *elem,
unsigned int len)
{
unsigned int offset;
int i;
offset = 0;
for (i = 0; i < elem->in_num; i++) {
size_t size = MIN(len - offset, elem->in_sg[i].iov_len);
cpu_physical_memory... | 0 | 9,263 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: sg_proc_init(void)
{
int num_leaves = ARRAY_SIZE(sg_proc_leaf_arr);
int k;
sg_proc_sgp = proc_mkdir(sg_proc_sg_dirname, NULL);
if (!sg_proc_sgp)
return 1;
for (k = 0; k < num_leaves; ++k) {
const struct sg_proc_leaf *leaf = &sg_proc_leaf_arr[k];
umode_t mask = leaf->fops->write ? S_IRUGO | S_IWUSR : S... | 0 | 42,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 GraphicsContext::setLineDash(const DashArray&, float dashOffset)
{
notImplemented();
}
Commit Message: Reviewed by Kevin Ollivier.
[wx] Fix strokeArc and fillRoundedRect drawing, and add clipPath support.
https://bugs.webkit.org/show_bug.cgi?id=60847
git-svn-id: svn://svn.chromium.org/blink... | 0 | 100,106 |
Analyze the following 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 GLES2DecoderImpl::CheckBoundFramebuffersValid(const char* func_name) {
if (!features().chromium_framebuffer_multisample) {
bool valid = CheckFramebufferValid(
framebuffer_state_.bound_draw_framebuffer.get(), GL_FRAMEBUFFER_EXT,
func_name);
if (valid)
OnUseFramebuffer();
... | 0 | 120,753 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: OperationID FileSystemOperationRunner::CreateFile(const FileSystemURL& url,
bool exclusive,
StatusCallback callback) {
base::File::Error error = base::File::FILE_OK;
std::unique_ptr<FileSystemOperation> operati... | 0 | 152,171 |
Analyze the following 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 OneClickSigninHelper::NavigateToPendingEntry(
const GURL& url,
content::NavigationController::ReloadType reload_type) {
VLOG(1) << "OneClickSigninHelper::NavigateToPendingEntry: url=" << url.spec();
const GURL continue_url = signin::GetNextPageURLForPromoURL(
signin::GetPromoURL(signin::SOU... | 0 | 109,829 |
Analyze the following 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 handle_NPP_WriteReady(rpc_connection_t *connection)
{
D(bug("handle_NPP_WriteReady\n"));
PluginInstance *plugin;
NPStream *stream;
int error = rpc_method_get_args(connection,
RPC_TYPE_NPW_PLUGIN_INSTANCE, &plugin,
RPC_TYPE_NP_STREAM, &stream,
RPC_TYPE_INVALID);
... | 0 | 27,110 |
Analyze the following 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::UpdateRequestNavigationParamsHistory() {
NavigationController* navigation_controller =
frame_tree_node_->navigator()->GetController();
request_params_.current_history_list_offset =
navigation_controller->GetCurrentEntryIndex();
request_params_.current_history_list_length ... | 0 | 132,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 int server_socket(const char *interface,
int port,
enum network_transport transport,
FILE *portnumber_file) {
int sfd;
struct linger ling = {0, 0};
struct addrinfo *ai;
struct addrinfo *next;
struct addrinfo hint... | 0 | 75,209 |
Analyze the following 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::RestoreTab() {
UserMetrics::RecordAction(UserMetricsAction("RestoreTab"), profile_);
TabRestoreService* service = profile_->GetTabRestoreService();
if (!service)
return;
service->RestoreMostRecentEntry(tab_restore_service_delegate());
}
Commit Message: chromeos: fix bug where "aw snap"... | 0 | 98,303 |
Analyze the following 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 policy_node(gfp_t gfp, struct mempolicy *policy,
int nd)
{
if (policy->mode == MPOL_PREFERRED && !(policy->flags & MPOL_F_LOCAL))
nd = policy->v.preferred_node;
else {
/*
* __GFP_THISNODE shouldn't even be used with the bind policy
* because we might easily break the expectation to ... | 0 | 83,113 |
Analyze the following 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 file *get_mm_exe_file(struct mm_struct *mm)
{
struct file *exe_file;
/* We need mmap_sem to protect against races with removal of exe_file */
down_read(&mm->mmap_sem);
exe_file = mm->exe_file;
if (exe_file)
get_file(exe_file);
up_read(&mm->mmap_sem);
return exe_file;
}
Commit Message: userns: Do... | 0 | 32,885 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void AudioNode::SetHandler(scoped_refptr<AudioHandler> handler) {
DCHECK(handler);
handler_ = std::move(handler);
#if DEBUG_AUDIONODE_REFERENCES
fprintf(stderr, "[%16p]: %16p: %2d: AudioNode::AudioNode %16p\n", context(),
this, handler_->GetNodeType(), handler_.get());
#endif
}
Commit Message: R... | 0 | 148,825 |
Analyze the following 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 ass_shaper_set_base_direction(ASS_Shaper *shaper, FriBidiParType dir)
{
shaper->base_direction = dir;
}
Commit Message: shaper: fix reallocation
Update the variable that tracks the allocated size. This potentially
improves performance and avoid some side effects, which lead to
undefined behavior in som... | 0 | 73,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 camellia_xts_enc(void *ctx, u128 *dst, const u128 *src, le128 *iv)
{
glue_xts_crypt_128bit_one(ctx, dst, src, iv,
GLUE_FUNC_CAST(camellia_enc_blk));
}
Commit Message: crypto: prefix module autoloading with "crypto-"
This prefixes all crypto module loading with "crypto-" so we never run
the risk of e... | 0 | 46,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: xmlParsePITarget(xmlParserCtxtPtr ctxt) {
const xmlChar *name;
name = xmlParseName(ctxt);
if ((name != NULL) &&
((name[0] == 'x') || (name[0] == 'X')) &&
((name[1] == 'm') || (name[1] == 'M')) &&
((name[2] == 'l') || (name[2] == 'L'))) {
int i;
if ((name[0] == 'x') && (name[... | 0 | 59,510 |
Analyze the following 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 update_bounds_equals(rdpBounds* bounds1, rdpBounds* bounds2)
{
if ((bounds1->left == bounds2->left) && (bounds1->top == bounds2->top) &&
(bounds1->right == bounds2->right) && (bounds1->bottom == bounds2->bottom))
return TRUE;
return FALSE;
}
Commit Message: Fixed CVE-2018-8786
Thanks to Eyal Itki... | 0 | 83,549 |
Analyze the following 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 usbtest_resume(struct usb_interface *intf)
{
return 0;
}
Commit Message: usb: usbtest: fix NULL pointer dereference
If the usbtest driver encounters a device with an IN bulk endpoint but
no OUT bulk endpoint, it will try to dereference a NULL pointer
(out->desc.bEndpointAddress). The problem can be... | 0 | 59,885 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static INLINE void wc_ecc_free_mpint(ecc_key* key, mp_int** mp)
{
if (key && mp && *mp) {
mp_clear(*mp);
XFREE(*mp, key->heap, DYNAMIC_TYPE_BIGINT);
*mp = NULL;
}
}
Commit Message: Change ECDSA signing to use blinding.
CWE ID: CWE-200 | 0 | 81,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: void EglRenderingVDAClient::NotifyResetDone() {
if (decoder_deleted())
return;
if (reset_after_frame_num_ == MID_STREAM_RESET) {
reset_after_frame_num_ = END_OF_STREAM_RESET;
return;
}
if (remaining_play_throughs_) {
encoded_data_next_pos_to_decode_ = 0;
NotifyInitializeDone();
r... | 0 | 106,976 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void sctp_inq_init(struct sctp_inq *queue)
{
INIT_LIST_HEAD(&queue->in_chunk_list);
queue->in_progress = NULL;
/* Create a task for delivering data. */
INIT_WORK(&queue->immediate, NULL);
}
Commit Message: net: sctp: fix remote memory pressure from excessive queueing
This scenario is not limited to ASCONF... | 0 | 37,325 |
Analyze the following 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* Type_Signature_Dup(struct _cms_typehandler_struct* self, const void *Ptr, cmsUInt32Number n)
{
return _cmsDupMem(self ->ContextID, Ptr, n * sizeof(cmsSignature));
}
Commit Message: Added an extra check to MLU bounds
Thanks to Ibrahim el-sayed for spotting the bug
CWE ID: CWE-125 | 0 | 71,052 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ZEND_API void zend_ts_hash_copy(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size)
{
begin_read(source);
begin_write(target);
zend_hash_copy(TS_HASH(target), TS_HASH(source), pCopyConstructor, tmp, size);
end_write(target);
end_read(source);
}
Commit Message: ... | 0 | 7,444 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: vhost_scsi_mapal(struct vhost_scsi_cmd *cmd,
size_t prot_bytes, struct iov_iter *prot_iter,
size_t data_bytes, struct iov_iter *data_iter)
{
int sgl_count, ret;
bool write = (cmd->tvc_data_direction == DMA_FROM_DEVICE);
if (prot_bytes) {
sgl_count = vhost_scsi_calc_sgls(prot_iter, prot_bytes,
V... | 0 | 43,116 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s TSRMLS_DC)
{
return strcmp( ((zend_extension *)(*f)->data)->name,
((zend_extension *)(*s)->data)->name);
}
Commit Message:
CWE ID: CWE-119 | 0 | 7,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: MagickExport VirtualPixelMethod SetImageVirtualPixelMethod(const Image *image,
const VirtualPixelMethod virtual_pixel_method)
{
assert(image != (const Image *) NULL);
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",i... | 0 | 64,538 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: bool ChromeContentBrowserClient::IsValidStoragePartitionId(
content::BrowserContext* browser_context,
const std::string& partition_id) {
if (partition_id.empty())
return true;
return GURL(partition_id).is_valid();
}
Commit Message: Ensure extensions and the Chrome Web Store are loaded in new Bro... | 0 | 115,769 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void WebContentsImpl::UpdateMaxPageIDIfNecessary(RenderViewHost* rvh) {
int max_restored_page_id = controller_.GetMaxRestoredPageID();
if (max_restored_page_id >
GetMaxPageIDForSiteInstance(rvh->GetSiteInstance()))
UpdateMaxPageIDForSiteInstance(rvh->GetSiteInstance(),
... | 0 | 110,802 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static inline void set_socket_blocking(int s, int blocking)
{
int opts;
opts = fcntl(s, F_GETFL);
if (opts<0) APPL_TRACE_ERROR("set blocking (%s)", strerror(errno));
if(blocking)
opts &= ~O_NONBLOCK;
else opts |= O_NONBLOCK;
if (fcntl(s, F_SETFL, opts) < 0)
APPL_TRA... | 1 | 173,466 |
Analyze the following 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 keyctl_instantiate_key_iov(key_serial_t id,
const struct iovec __user *_payload_iov,
unsigned ioc,
key_serial_t ringid)
{
struct iovec iovstack[UIO_FASTIOV], *iov = iovstack;
struct iov_iter from;
long ret;
if (!_payload_iov)
ioc = 0;
ret = import_iovec(WRITE, _payload_iov, ioc,
... | 0 | 57,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: void blkcg_drain_queue(struct request_queue *q)
{
lockdep_assert_held(q->queue_lock);
/*
* @q could be exiting and already have destroyed all blkgs as
* indicated by NULL root_blkg. If so, don't confuse policies.
*/
if (!q->root_blkg)
return;
blk_throtl_drain(q);
}
Commit Message: blkcg: fix doubl... | 0 | 84,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: void MockDownloadController::OnDownloadStarted(
content::DownloadItem* download_item) {
}
Commit Message: Clean up Android DownloadManager code as most download now go through Chrome Network stack
The only exception is OMA DRM download.
And it only applies to context menu download interception.
Clean up ... | 0 | 126,732 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: PHP_METHOD(Phar, offsetGet)
{
char *fname, *error;
int fname_len;
zval *zfname;
phar_entry_info *entry;
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
return;
}
/* security is 0 here so that we can get a better error message than "ent... | 0 | 4,394 |
Analyze the following 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 LayerTreeHostQt::detachLayer(WebGraphicsLayer* layer)
{
m_registeredLayers.remove(layer);
m_shouldSyncFrame = true;
m_webPage->send(Messages::LayerTreeHostProxy::DeleteCompositingLayer(layer->id()));
}
Commit Message: [Qt][WK2] Allow transparent WebViews
https://bugs.webkit.org/show_bug.cgi?id=8... | 0 | 101,837 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: test_toggle_status (void) {
g_assert(!uzbl.behave.show_status);
/* status bar can be toggled on */
parse_cmd_line("toggle_status", NULL);
g_assert(uzbl.behave.show_status);
/* status bar can be toggled back off */
parse_cmd_line("toggle_status", NULL);
g_assert(!uzbl.behave.show_stat... | 0 | 18,318 |
Analyze the following 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 default_file_splice_read(struct file *in, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len,
unsigned int flags)
{
unsigned int nr_pages;
unsigned int nr_freed;
size_t offset;
struct page *pages[PIPE_DEF_BUFFERS];
struct partial_page partial[PIPE_DEF_BUFFERS];
struct iovec *vec, __vec... | 0 | 46,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: static struct ewah_bitmap *lookup_stored_bitmap(struct stored_bitmap *st)
{
struct ewah_bitmap *parent;
struct ewah_bitmap *composed;
if (st->xor == NULL)
return st->root;
composed = ewah_pool_new();
parent = lookup_stored_bitmap(st->xor);
ewah_xor(st->root, parent, composed);
ewah_pool_free(st->root)... | 0 | 54,932 |
Analyze the following 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 f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
struct inode *inode = file_inode(filp);
struct f2fs_inode_info *fi = F2FS_I(inode);
unsigned int flags;
int ret;
switch (cmd) {
case F2FS_IOC_GETFLAGS:
flags = fi->i_flags & FS_FL_USER_VISIBLE;
return put_user(flags, (int __user ... | 0 | 46,312 |
Analyze the following 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 HTMLInputElement::setSize(unsigned size)
{
setUnsignedIntegralAttribute(sizeAttr, size);
}
Commit Message: Add HTMLFormControlElement::supportsAutofocus to fix a FIXME comment.
This virtual function should return true if the form control can hanlde
'autofocucs' attribute if it is specified.
Note: HTML... | 0 | 114,007 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ProcRenderReferenceGlyphSet (ClientPtr client)
{
GlyphSetPtr glyphSet;
int rc;
REQUEST(xRenderReferenceGlyphSetReq);
REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq);
LEGAL_NEW_RESOURCE(stuff->gsid, client);
rc = dixLookupResourceByType((pointer *)&glyphSet, stuff->existing, GlyphSet... | 0 | 14,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: static bool __init sparc64_has_des_opcode(void)
{
unsigned long cfr;
if (!(sparc64_elf_hwcap & HWCAP_SPARC_CRYPTO))
return false;
__asm__ __volatile__("rd %%asr26, %0" : "=r" (cfr));
if (!(cfr & CFR_DES))
return false;
return true;
}
Commit Message: crypto: prefix module autoloading with "crypto-"
T... | 0 | 46,777 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: const OmniboxView* TestBrowserWindow::TestLocationBar::GetOmniboxView() const {
return NULL;
}
Commit Message: Mac: turn popups into new tabs while in fullscreen.
It's platform convention to show popups as new tabs while in
non-HTML5 fullscreen. (Popups cause tabs to lose HTML5 fullscreen.)
This was implemen... | 0 | 155,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: static void FS_ReplaceSeparators( char *path ) {
char *s;
qboolean lastCharWasSep = qfalse;
for ( s = path ; *s ; s++ ) {
if ( *s == '/' || *s == '\\' ) {
if ( !lastCharWasSep ) {
*s = PATH_SEP;
lastCharWasSep = qtrue;
} else {
memmove (s, s + 1, strlen (s));
}
} else {
lastCharWas... | 0 | 96,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: DialogOverlayString::DialogOverlayString() {}
Commit Message: Clear out some minor TODOs.
BUG=none
Review URL: https://codereview.chromium.org/1047063002
Cr-Commit-Position: refs/heads/master@{#322959}
CWE ID: CWE-20 | 0 | 109,915 |
Analyze the following 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 CWebServer::RType_Settings(WebEmSession & session, const request& req, Json::Value &root)
{
std::vector<std::vector<std::string> > result;
char szTmp[100];
result = m_sql.safe_query("SELECT Key, nValue, sValue FROM Preferences");
if (result.empty())
return;
root["status"] = "OK";
r... | 0 | 91,064 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static inline size_t MagickMax(const size_t x,
const size_t y)
{
if (x > y)
return(x);
return(y);
}
Commit Message:
CWE ID: CWE-119 | 0 | 71,640 |
Analyze the following 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_regex_lengths (void)
{
bson_t new = BSON_INITIALIZER;
bson_oid_t oid;
bson_oid_init_from_string (&oid, "1234567890abcdef12345678");
bson_append_oid (&new, "0123456", -1, &oid);
bson_append_regex (&new,
"0_________1_________2_________3___4",
-1... | 0 | 77,925 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void ShellWindowFrameView::ButtonPressed(views::Button* sender,
const views::Event& event) {
if (sender == close_button_)
frame_->Close();
}
Commit Message: [views] Remove header bar on shell windows created with {frame: none}.
BUG=130182
R=ben@chromium.org
... | 1 | 170,709 |
Analyze the following 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 ChromeRenderMessageFilter::OnExtensionRemoveListener(
const std::string& extension_id,
const std::string& event_name) {
content::RenderProcessHost* process =
content::RenderProcessHost::FromID(render_process_id_);
if (!process || !profile_->GetExtensionEventRouter())
return;
profile_... | 0 | 102,108 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static jboolean pinReplyNative(JNIEnv *env, jobject obj, jbyteArray address, jboolean accept,
jint len, jbyteArray pinArray) {
ALOGV("%s:",__FUNCTION__);
jbyte *addr, *pinPtr = NULL;
jboolean result = JNI_FALSE;
if (!sBluetoothInterface) return result;
addr = env-... | 0 | 163,693 |
Analyze the following 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_alloc_rx_data(struct tg3 *tp, struct tg3_rx_prodring_set *tpr,
u32 opaque_key, u32 dest_idx_unmasked,
unsigned int *frag_size)
{
struct tg3_rx_buffer_desc *desc;
struct ring_info *map;
u8 *data;
dma_addr_t mapping;
int skb_size, data_size, dest_idx;
switch (opaque_key) {
cas... | 0 | 32,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: iasecc_match_card(struct sc_card *card)
{
struct sc_context *ctx = card->ctx;
int i;
i = _sc_match_atr(card, iasecc_known_atrs, &card->type);
if (i < 0) {
sc_log(ctx, "card not matched");
return 0;
}
sc_log(ctx, "'%s' card matched", iasecc_known_atrs[i].name);
return 1;
}
Commit Message: fixed out... | 0 | 78,496 |
Analyze the following 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 proc_config_on_close(struct inode *inode, struct file *file)
{
struct proc_data *data = file->private_data;
struct proc_dir_entry *dp = PDE(inode);
struct net_device *dev = dp->data;
struct airo_info *ai = dev->ml_priv;
char *line;
if ( !data->writelen ) return;
readConfigRid(ai, 1);
set_bit... | 0 | 24,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 bool NeedsEffect(const LayoutObject& object) {
const ComputedStyle& style = object.StyleRef();
const bool is_css_isolated_group =
object.IsBoxModelObject() && style.IsStackingContext();
if (!is_css_isolated_group && !object.IsSVG())
return false;
if (object.IsSVG()) {
if (object.Is... | 0 | 125,432 |
Analyze the following 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 md_safemode_timeout(unsigned long data)
{
struct mddev *mddev = (struct mddev *) data;
if (!atomic_read(&mddev->writes_pending)) {
mddev->safemode = 1;
if (mddev->external)
sysfs_notify_dirent_safe(mddev->sysfs_state);
}
md_wakeup_thread(mddev->thread);
}
Commit Message: md: use kzalloc()... | 0 | 42,461 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.