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: xfs_ioctl_setattr(
xfs_inode_t *ip,
struct fsxattr *fa,
int mask)
{
struct xfs_mount *mp = ip->i_mount;
struct xfs_trans *tp;
unsigned int lock_flags = 0;
struct xfs_dquot *udqp = NULL;
struct xfs_dquot *pdqp = NULL;
struct xfs_dquot *olddquot = NULL;
int code;
trace_xfs_ioctl_setattr(ip);
if... | 1 | 166,322 |
Analyze the following 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 DefaultTabHandler::CreateHistoricalTab(TabContentsWrapper* contents) {
delegate_->AsBrowser()->CreateHistoricalTab(contents);
}
Commit Message: chromeos: fix bug where "aw snap" page replaces first tab if it was a NTP when closing window with > 1 tab.
BUG=chromium-os:12088
TEST=verify bug per bug report.... | 0 | 98,044 |
Analyze the following 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 *charset_client2fs(const char * const string)
{
char *output = NULL, *output_;
size_t inlen, outlen, outlen_;
inlen = strlen(string);
outlen_ = outlen = inlen * (size_t) 4U + (size_t) 1U;
if (outlen <= inlen ||
(output_ = output = calloc(outlen, (size_t) 1U)) == NULL) {
... | 0 | 18,419 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: nvmet_fc_tgtport_get(struct nvmet_fc_tgtport *tgtport)
{
return kref_get_unless_zero(&tgtport->ref);
}
Commit Message: nvmet-fc: ensure target queue id within range.
When searching for queue id's ensure they are within the expected range.
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Ch... | 0 | 93,639 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: gpm_process_mouse(Gpm_Event * event, void *data)
{
int btn = MOUSE_BTN_RESET, x, y;
if (event->type & GPM_UP)
btn = MOUSE_BTN_UP;
else if (event->type & GPM_DOWN) {
switch (event->buttons) {
case GPM_B_LEFT:
btn = MOUSE_BTN1_DOWN;
break;
case GPM_B_MIDDLE:
btn = MOUSE_BTN2_DOWN;
... | 0 | 84,505 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: _zip_dirent_init(zip_dirent_t *de)
{
de->changed = 0;
de->local_extra_fields_read = 0;
de->cloned = 0;
de->crc_valid = true;
de->version_madeby = 63 | (ZIP_OPSYS_DEFAULT << 8);
de->version_needed = 10; /* 1.0 */
de->bitflags = 0;
de->comp_method = ZIP_CM_DEFAULT;
de->last_mod ... | 0 | 62,650 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: FLAC__StreamDecoderTellStatus file_tell_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
{
FLAC__off_t pos;
(void)client_data;
if(decoder->private_->file == stdin)
return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED;
else if((pos = ftello(decoder->private_... | 0 | 161,219 |
Analyze the following 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 AutofillDialogViews::HideErrorBubble() {
if (error_bubble_)
error_bubble_->Hide();
}
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,994 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: png_do_expand(png_row_infop row_info, png_bytep row,
png_color_16p trans_value)
{
int shift, value;
png_bytep sp, dp;
png_uint_32 i;
png_uint_32 row_width=row_info->width;
png_debug(1, "in png_do_expand");
#ifdef PNG_USELESS_TESTS_SUPPORTED
if (row != NULL && row_info != NULL)
#endif
{
... | 0 | 131,358 |
Analyze the following 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 errflush_nomem(void)
{
errflush(mem_err_print);
}
Commit Message:
CWE ID: CWE-20 | 0 | 14,009 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: find_check_match(struct xt_entry_match *m, struct xt_mtchk_param *par)
{
struct xt_match *match;
int ret;
match = xt_request_find_match(NFPROTO_IPV4, m->u.user.name,
m->u.user.revision);
if (IS_ERR(match))
return PTR_ERR(match);
m->u.kernel.match = match;
ret = check_match(m, par);
if (ret)
... | 0 | 84,998 |
Analyze the following 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 sas_phy *sas_get_local_phy(struct domain_device *dev)
{
struct sas_ha_struct *ha = dev->port->ha;
struct sas_phy *phy;
unsigned long flags;
/* a published domain device always has a valid phy, it may be
* stale, but it is never NULL
*/
BUG_ON(!dev->phy);
spin_lock_irqsave(&ha->phy_port_lock, fl... | 0 | 83,264 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static inline int flexarray_get_bin(struct flexarray *flex, int index)
{
int i;
(void)flex;
for (i = 0; i < ARRAY_SIZE(bin_offset); i++)
if (index < bin_offset[i])
return i - 1;
return -1;
}
Commit Message: jpeg: Fix another possible buffer overrun
Found via the clang libfuzz... | 0 | 82,979 |
Analyze the following 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 snd_seq_ioctl_set_client_info(struct snd_seq_client *client,
void *arg)
{
struct snd_seq_client_info *client_info = arg;
/* it is not allowed to set the info fields for an another client */
if (client->number != client_info->client)
return -EPERM;
/* also client type must be set now */
if... | 0 | 60,602 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void OnSwapOutACKHelper(int render_process_id, int render_view_id) {
RenderViewHostImpl* rvh = RenderViewHostImpl::FromID(render_process_id,
render_view_id);
if (rvh)
rvh->OnSwapOutACK();
}
Commit Message: Make chrome.appWindow.create() provide acces... | 0 | 105,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 unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
struct msghdr *msg, size_t len)
{
struct sock_iocb *siocb = kiocb_to_siocb(kiocb);
struct sock *sk = sock->sk;
struct net *net = sock_net(sk);
struct unix_sock *u = unix_sk(sk);
struct sockaddr_un *sunaddr = msg->msg_name;
stru... | 0 | 40,735 |
Analyze the following 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 FileBrowserPrivateSearchDriveFunction::OnEntryDefinitionList(
const GURL& next_link,
scoped_ptr<SearchResultInfoList> search_result_info_list,
scoped_ptr<EntryDefinitionList> entry_definition_list) {
DCHECK_EQ(search_result_info_list->size(), entry_definition_list->size());
base::ListValue* e... | 0 | 111,767 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: const views::Widget* ShellWindowViews::GetWidget() const {
return window_;
}
Commit Message: [views] Remove header bar on shell windows created with {frame: none}.
BUG=130182
R=ben@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10597003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1... | 0 | 103,177 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void AffiliationFetcher::SetFactoryForTesting(
TestAffiliationFetcherFactory* factory) {
g_testing_factory = factory;
}
Commit Message: Update AffiliationFetcher to use new Affiliation API wire format.
The new format is not backward compatible with the old one, therefore this CL updates the client side pr... | 0 | 110,127 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: int mbedtls_ecp_copy( mbedtls_ecp_point *P, const mbedtls_ecp_point *Q )
{
int ret;
MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &P->X, &Q->X ) );
MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &P->Y, &Q->Y ) );
MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &P->Z, &Q->Z ) );
cleanup:
return( ret );
}
Commit Message: Merge ... | 0 | 96,565 |
Analyze the following 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 IOThread::InitializeNetworkSessionParams(
net::HttpNetworkSession::Params* params) {
params->host_resolver = globals_->host_resolver.get();
params->cert_verifier = globals_->cert_verifier.get();
params->server_bound_cert_service =
globals_->system_server_bound_cert_service.get();
params->tr... | 0 | 113,519 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: struct dm_md_mempools *dm_alloc_md_mempools(struct mapped_device *md, enum dm_queue_mode type,
unsigned integrity, unsigned per_io_data_size)
{
struct dm_md_mempools *pools = kzalloc_node(sizeof(*pools), GFP_KERNEL, md->numa_node_id);
unsigned int pool_size = 0;
unsigned int front_pad;
if (!pools)
... | 0 | 85,868 |
Analyze the following 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 FocusFirstNameField() {
bool result = false;
ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
GetRenderViewHost(),
"if (document.readyState === 'complete')"
" document.getElementById('firstname').focus();"
"else"
" domAutomationController.send(false);",
... | 0 | 112,159 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) {}
Commit Message: sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c
Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the
scheduler under high loads, starting at around the v4.18 time frame,
and Zhipeng Xie trac... | 0 | 92,587 |
Analyze the following 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 rpc_init_priority_wait_queue(struct rpc_wait_queue *queue, const char *qname)
{
__rpc_init_priority_wait_queue(queue, qname, RPC_NR_PRIORITY);
}
Commit Message: NLM: Don't hang forever on NLM unlock requests
If the NLM daemon is killed on the NFS server, we can currently end up
hanging forever on an 'unlo... | 0 | 34,962 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: virtual WebString message() { return WebString::fromUTF8(msg); }
Commit Message: DevTools: move DevToolsAgent/Client into content.
BUG=84078
TEST=
Review URL: http://codereview.chromium.org/7461019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93596 0039d316-1c4b-4281-b951-d872f2087c98
CWE ID: CWE-20 | 0 | 98,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: static int compat_raw_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen)
{
if (level != SOL_RAW)
return compat_ip_getsockopt(sk, level, optname, optval, optlen);
return do_raw_getsockopt(sk, level, optname, optval, optlen);
}
Commit Message: inet: add RCU protec... | 0 | 18,941 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: int gdTransformAffineBoundingBox(gdRectPtr src, const double affine[6], gdRectPtr bbox)
{
gdPointF extent[4], min, max, point;
int i;
extent[0].x=0.0;
extent[0].y=0.0;
extent[1].x=(double) src->width;
extent[1].y=0.0;
extent[2].x=(double) src->width;
extent[2].y=(double) src->height;
extent[3].x=0.0;
e... | 0 | 95,068 |
Analyze the following 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 Automation::SetCookie(const std::string& url,
DictionaryValue* cookie_dict,
Error** error) {
std::string error_msg;
if (!SendSetCookieJSONRequest(automation(), url, cookie_dict, &error_msg))
*error = new Error(kUnknownError, error_msg);
}
Commit ... | 0 | 100,723 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ofputil_group_stats_to_ofp11(const struct ofputil_group_stats *gs,
struct ofp11_group_stats *gs11, size_t length,
struct ofp11_bucket_counter bucket_cnts[])
{
memset(gs11, 0, sizeof *gs11);
gs11->length = htons(length);
gs11->group_id = htonl(g... | 0 | 77,621 |
Analyze the following 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 unix_may_send(struct sock *sk, struct sock *osk)
{
return unix_peer(osk) == NULL || unix_our_peer(sk, osk);
}
Commit Message: af_netlink: force credentials passing [CVE-2012-3520]
Pablo Neira Ayuso discovered that avahi and
potentially NetworkManager accept spoofed Netlink messages because of... | 0 | 19,307 |
Analyze the following 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 do_perf_sw_event(enum perf_type_id type, u32 event_id,
u64 nr,
struct perf_sample_data *data,
struct pt_regs *regs)
{
struct swevent_htable *swhash = this_cpu_ptr(&swevent_htable);
struct perf_event *event;
struct hlist_head *head;
rcu_read_lock();
head = find_swevent_hea... | 0 | 50,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: invalidate_persistent (void)
{
DEBUGP (("Disabling further reuse of socket %d.\n", pconn.socket));
pconn_active = false;
fd_close (pconn.socket);
xfree (pconn.host);
xzero (pconn);
}
Commit Message:
CWE ID: CWE-20 | 0 | 15,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 PluginObserver::OnCrashedPlugin(const FilePath& plugin_path) {
DCHECK(!plugin_path.value().empty());
string16 plugin_name = plugin_path.LossyDisplayName();
webkit::npapi::WebPluginInfo plugin_info;
if (webkit::npapi::PluginList::Singleton()->GetPluginInfoByPath(
plugin_path, &plugin_info) ... | 0 | 97,963 |
Analyze the following 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 FrameView::frameRectsChanged()
{
if (layoutSizeFixedToFrameSize())
setLayoutSizeInternal(frameRect().size());
ScrollView::frameRectsChanged();
}
Commit Message: Defer call to updateWidgetPositions() outside of RenderLayerScrollableArea.
updateWidgetPositions() can destroy the render tree, ... | 0 | 119,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: static void fill_elf_header(struct elfhdr *elf, int segs,
u16 machine, u32 flags, u8 osabi)
{
memset(elf, 0, sizeof(*elf));
memcpy(elf->e_ident, ELFMAG, SELFMAG);
elf->e_ident[EI_CLASS] = ELF_CLASS;
elf->e_ident[EI_DATA] = ELF_DATA;
elf->e_ident[EI_VERSION] = EV_CURRENT;
elf->e_ident[EI_OSABI] = ELF... | 0 | 21,449 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: LIBOPENMPT_MODPLUG_API char ModPlug_ExportIT(ModPlugFile* file, const char* filepath)
{
(void)file;
/* not implemented */
fprintf(stderr,"libopenmpt-modplug: error: ModPlug_ExportIT(%s) not implemented.\n",filepath);
return 0;
}
Commit Message: [Fix] libmodplug: C API: Limit the length of strings copied to t... | 0 | 87,623 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static jpc_fix_t jpc_calcabsstepsize(int stepsize, int numbits)
{
jpc_fix_t absstepsize;
int n;
absstepsize = jpc_inttofix(1);
n = JPC_FIX_FRACBITS - 11;
absstepsize |= (n >= 0) ? (JPC_QCX_GETMANT(stepsize) << n) :
(JPC_QCX_GETMANT(stepsize) >> (-n));
n = numbits - JPC_QCX_GETEXPN(stepsize);
absstepsiz... | 0 | 70,404 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static inline void ep_set_ffd(struct epoll_filefd *ffd,
struct file *file, int fd)
{
ffd->file = file;
ffd->fd = fd;
}
Commit Message: epoll: clear the tfile_check_list on -ELOOP
An epoll_ctl(,EPOLL_CTL_ADD,,) operation can return '-ELOOP' to prevent
circular epoll dependencies from being created. H... | 0 | 19,585 |
Analyze the following 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 __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
int proto)
{
struct sock *sk;
struct udphdr *uh;
unsigned short ulen;
struct rtable *rt = skb_rtable(skb);
__be32 saddr, daddr;
struct net *net = dev_net(skb->dev);
/*
* Validate the packet.
*/
if (!pskb_may_pull(skb, sizeof(st... | 0 | 19,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 int read_wrapper_data (WavpackContext *wpc, WavpackMetadata *wpmd)
{
if ((wpc->open_flags & OPEN_WRAPPER) && wpc->wrapper_bytes < MAX_WRAPPER_BYTES && wpmd->byte_length) {
wpc->wrapper_data = realloc (wpc->wrapper_data, wpc->wrapper_bytes + wpmd->byte_length);
if (!wpc->wrapper_data)
retu... | 0 | 70,900 |
Analyze the following 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 ecryptfs_init_lower_file(struct dentry *dentry,
struct file **lower_file)
{
const struct cred *cred = current_cred();
struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);
struct vfsmount *lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry);
int rc;
rc = ecryptfs_privileged_open(lo... | 0 | 27,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: MagickExport Cache ReferencePixelCache(Cache cache)
{
CacheInfo
*magick_restrict cache_info;
assert(cache != (Cache *) NULL);
cache_info=(CacheInfo *) cache;
assert(cache_info->signature == MagickSignature);
LockSemaphoreInfo(cache_info->semaphore);
cache_info->reference_count++;
UnlockSemaphor... | 0 | 73,504 |
Analyze the following 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 InspectorCSSOMWrappers::collectFromStyleSheetIfNeeded(CSSStyleSheet* styleSheet)
{
if (!m_styleRuleToCSSOMWrapperMap.isEmpty())
collect(styleSheet);
}
Commit Message: Remove the Simple Default Stylesheet, it's just a foot-gun.
We've been bitten by the Simple Default Stylesheet being out
of sync... | 0 | 118,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: get_modifiers(char *buf, int16 *weight, bool *prefix)
{
*weight = 0;
*prefix = false;
if (!t_iseq(buf, ':'))
return buf;
buf++;
while (*buf && pg_mblen(buf) == 1)
{
switch (*buf)
{
case 'a':
case 'A':
*weight |= 1 << 3;
break;
case 'b':
case 'B':
*weight |= 1 << 2;
break;... | 0 | 39,021 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: bool EditorClientBlackBerry::isSelectTrailingWhitespaceEnabled()
{
if (m_webPagePrivate->m_dumpRenderTree)
return m_webPagePrivate->m_dumpRenderTree->isSelectTrailingWhitespaceEnabled();
return false;
}
Commit Message: [BlackBerry] Prevent text selection inside Colour and Date/Time input fields
h... | 0 | 104,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: static int ok_to_run(const char *program) {
if (strstr(program, "/")) {
if (access(program, X_OK) == 0) // it will also dereference symlinks
return 1;
}
else { // search $PATH
char *path1 = getenv("PATH");
if (path1) {
if (arg_debug)
printf("Searching $PATH for %s\n", program);
char *path2 =... | 0 | 89,760 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int __init init_nlm(void)
{
int err;
#ifdef CONFIG_SYSCTL
err = -ENOMEM;
nlm_sysctl_table = register_sysctl_table(nlm_sysctl_root);
if (nlm_sysctl_table == NULL)
goto err_sysctl;
#endif
err = register_pernet_subsys(&lockd_net_ops);
if (err)
goto err_pernet;
err = lockd_create_procfs();
if (er... | 0 | 65,195 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: cib_send_tls(gnutls_session * session, xmlNode * msg)
{
char *xml_text = NULL;
# if 0
const char *name = crm_element_name(msg);
if (safe_str_neq(name, "cib_command")) {
xmlNodeSetName(msg, "cib_result");
}
# endif
xml_text = dump_xml_unformatted(msg);
if (xml_text != NULL) {
... | 1 | 166,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: static void voidMethodLongLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongLongArg", "TestObjectPython", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
exceptionState.throwTypeErro... | 0 | 122,844 |
Analyze the following 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 FileUtilProxy::ReadDirectory(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
const FilePath& file_path,
ReadDirectoryCallback* callback) {
return Start(FROM_HERE, message_loop_proxy, new RelayReadDirectory(
file_path, callback));
}
Commit Message: Fix a small leak in FileUt... | 0 | 97,642 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: evdns_search_add(const char *domain) {
evdns_base_search_add(current_base, domain);
}
Commit Message: evdns: fix searching empty hostnames
From #332:
Here follows a bug report by **Guido Vranken** via the _Tor bug bounty program_. Please credit Guido accordingly.
## Bug report
The DNS code of Libevent ... | 0 | 70,638 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: status_t Parcel::writeString16Vector(
const std::unique_ptr<std::vector<std::unique_ptr<String16>>>& val)
{
return writeNullableTypedVector(val, &Parcel::writeString16);
}
Commit Message: Add bound checks to utf16_to_utf8
Bug: 29250543
Change-Id: I518e7b2fe10aaa3f1c1987586a09b1110aff7e1a
(cherry picked from c... | 0 | 163,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: av_cold int ff_h263_decode_init(AVCodecContext *avctx)
{
MpegEncContext *s = avctx->priv_data;
int ret;
s->out_format = FMT_H263;
ff_mpv_decode_defaults(s);
ff_mpv_decode_init(s, avctx);
s->quant_precision = 5;
s->decode_mb = ff_h263_decode_mb;
s->low_delay = 1;... | 0 | 79,880 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: FindInPageControllerTest() {
EnableDOMAutomation();
#if defined(TOOLKIT_VIEWS)
DropdownBarHost::disable_animations_during_testing_ = true;
#elif defined(TOOLKIT_GTK)
SlideAnimatorGtk::SetAnimationsForTesting(false);
#elif defined(OS_MACOSX)
FindBarBridge::disable_animations_during_testing_ = tr... | 0 | 102,083 |
Analyze the following 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 HTMLFormControlElement::setAutofilled(bool autofilled)
{
if (autofilled == m_isAutofilled)
return;
m_isAutofilled = autofilled;
setNeedsStyleRecalc();
}
Commit Message: Add HTMLFormControlElement::supportsAutofocus to fix a FIXME comment.
This virtual function should return true if ... | 0 | 113,936 |
Analyze the following 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::OnUserMetricsRecordAction(
const std::string& action) {
UserMetrics::RecordComputedAction(action);
}
Commit Message: DevTools: move DevToolsAgent/Client into content.
BUG=84078
TEST=
Review URL: http://codereview.chromium.org/7461019
git-svn-id: svn://svn.chromium.org/chro... | 0 | 98,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: static TEE_Result get_prop_tee_sys_time_prot_level(
struct tee_ta_session *sess __unused,
void *buf, size_t *blen)
{
uint32_t prot;
if (*blen < sizeof(prot)) {
*blen = sizeof(prot);
return TEE_ERROR_SHORT_BUFFER;
}
*blen = sizeof(prot);
prot = tee_time_get_sys_time_protection_level();
return tee_... | 0 | 86,909 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int dcbnl_setall(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{
int ret;
if (!tb[DCB_ATTR_SET_ALL])
return -EINVAL;
if (!netdev->dcbnl_ops->setall)
return -EOPNOTSUPP;
ret = nla_put_u8(skb, DCB_ATTR_SET_ALL,
netdev->dcbnl_ops->setall(n... | 0 | 31,112 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void Document::ExecuteScriptsWaitingForResources() {
if (!IsScriptExecutionReady())
return;
if (ScriptableDocumentParser* parser = GetScriptableDocumentParser())
parser->ExecuteScriptsWaitingForResources();
}
Commit Message: Cleanup and remove dead code in SetFocusedElement
This early-out was added ... | 0 | 129,703 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int wa_fill_descr(struct wahc *wa)
{
int result;
struct device *dev = &wa->usb_iface->dev;
char *itr;
struct usb_device *usb_dev = wa->usb_dev;
struct usb_descriptor_header *hdr;
struct usb_wa_descriptor *wa_descr;
size_t itr_size, actconfig_idx;
actconfig_idx = (usb_dev->actconfig - usb_dev->conf... | 0 | 75,594 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ikev2_n_print(netdissect_options *ndo, u_char tpay _U_,
const struct isakmp_gen *ext,
u_int item_len, const u_char *ep,
uint32_t phase _U_, uint32_t doi _U_,
uint32_t proto _U_, int depth _U_)
{
const struct ikev2_n *p;
struct ikev2_n n;
const u_char *cp;
u_char showspi, showdata, showsomedata;
c... | 1 | 167,927 |
Analyze the following 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 regulator_suspend_prepare(suspend_state_t state)
{
struct regulator_dev *rdev;
int ret = 0;
/* ON is handled by regulator active state */
if (state == PM_SUSPEND_ON)
return -EINVAL;
mutex_lock(®ulator_list_mutex);
list_for_each_entry(rdev, ®ulator_list, list) {
mutex_lock(&rdev->mutex);
r... | 0 | 74,551 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: InputDispatcher::Connection::Connection(const sp<InputChannel>& inputChannel,
const sp<InputWindowHandle>& inputWindowHandle, bool monitor) :
status(STATUS_NORMAL), inputChannel(inputChannel), inputWindowHandle(inputWindowHandle),
monitor(monitor),
inputPublisher(inputChannel), inputPubli... | 0 | 163,710 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: lseg_eq(PG_FUNCTION_ARGS)
{
LSEG *l1 = PG_GETARG_LSEG_P(0);
LSEG *l2 = PG_GETARG_LSEG_P(1);
PG_RETURN_BOOL(FPeq(l1->p[0].x, l2->p[0].x) &&
FPeq(l1->p[0].y, l2->p[0].y) &&
FPeq(l1->p[1].x, l2->p[1].x) &&
FPeq(l1->p[1].y, l2->p[1].y));
}
Commit Message: Predict integer overflow to av... | 0 | 38,917 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void WebContentsImpl::OnDocumentLoadedInFrame() {
if (!HasValidFrameSource())
return;
RenderFrameHostImpl* rfh =
static_cast<RenderFrameHostImpl*>(render_frame_message_source_);
FOR_EACH_OBSERVER(
WebContentsObserver, observers_, DocumentLoadedInFrame(rfh));
}
Commit Message: Don't call We... | 0 | 131,922 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: cJSON *cJSON_CreateIntArray(const int *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!n){cJSON_Delete(a);return 0;}if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
Commit Message: fix buffer overflow (#30)
CWE ID: CWE-125 | 0 | 93,700 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static WebURLRequest::RequestContext DetermineRequestContextFromNavigationType(
const NavigationType navigation_type) {
switch (navigation_type) {
case kNavigationTypeLinkClicked:
return WebURLRequest::kRequestContextHyperlink;
case kNavigationTypeOther:
return WebURLRequest::kRequestCo... | 0 | 125,787 |
Analyze the following 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 ftrace_mod_cmd_init(void)
{
return register_ftrace_command(&ftrace_mod_cmd);
}
Commit Message: tracing: Fix possible NULL pointer dereferences
Currently set_ftrace_pid and set_graph_function files use seq_lseek
for their fops. However seq_open() is called only for FMODE_READ in
the fops->ope... | 0 | 30,180 |
Analyze the following 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 fill_elf_header(struct elfhdr *elf, int segs,
u16 machine, u32 flags)
{
memset(elf, 0, sizeof(*elf));
memcpy(elf->e_ident, ELFMAG, SELFMAG);
elf->e_ident[EI_CLASS] = ELF_CLASS;
elf->e_ident[EI_DATA] = ELF_DATA;
elf->e_ident[EI_VERSION] = EV_CURRENT;
elf->e_ident[EI_OSABI] = ELF_OSABI;
... | 0 | 44,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: bool DevToolsConfirmInfoBarDelegate::Accept() {
callback_.Run(true);
callback_.Reset();
return true;
}
Commit Message: DevTools: handle devtools renderer unresponsiveness during beforeunload event interception
This patch fixes the crash which happenes under the following conditions:
1. DevTools window is ... | 0 | 113,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: gfx::ImageSkia BrowserView::GetWindowIcon() {
if (browser_->is_app())
return browser_->GetCurrentPageIcon().AsImageSkia();
return gfx::ImageSkia();
}
Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt.
BUG=107201
TEST=no visible change
Review URL: https://chromiumcodereview.a... | 0 | 118,377 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void HTMLMediaElement::setLoop(bool b) {
BLINK_MEDIA_LOG << "setLoop(" << (void*)this << ", " << boolString(b) << ")";
setBooleanAttribute(loopAttr, b);
}
Commit Message: [Blink>Media] Allow autoplay muted on Android by default
There was a mistake causing autoplay muted is shipped on Android
but it will be ... | 0 | 128,911 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: xfs_ioc_setxflags(
xfs_inode_t *ip,
struct file *filp,
void __user *arg)
{
struct fsxattr fa;
unsigned int flags;
unsigned int mask;
int error;
if (copy_from_user(&flags, arg, sizeof(flags)))
return -EFAULT;
if (flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | \
FS_NOATIME_FL | FS_NODUMP_FL ... | 0 | 36,923 |
Analyze the following 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 __net_exit default_device_exit(struct net *net)
{
struct net_device *dev, *aux;
/*
* Push all migratable network devices back to the
* initial network namespace
*/
rtnl_lock();
for_each_netdev_safe(net, dev, aux) {
int err;
char fb_name[IFNAMSIZ];
/* Ignore unmoveable devices (i.e. lo... | 0 | 48,770 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: R_API int r_core_cmd_foreach3(RCore *core, const char *cmd, char *each) { // "@@@"
RDebug *dbg = core->dbg;
RList *list, *head;
RListIter *iter;
int i;
const char *filter = NULL;
if (each[1] == ':') {
filter = each + 2;
}
switch (each[0]) {
case '=':
foreach_pairs (core, cmd, each + 1);
break;
c... | 0 | 87,814 |
Analyze the following 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 fib6_node * fib6_lookup(struct fib6_node *root, const struct in6_addr *daddr,
const struct in6_addr *saddr)
{
struct fib6_node *fn;
struct lookup_args args[] = {
{
.offset = offsetof(struct rt6_info, rt6i_dst),
.addr = daddr,
},
#ifdef CONFIG_IPV6_SUBTREES
{
.offset = offsetof(st... | 0 | 28,417 |
Analyze the following 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 ieee80211_set_multicast_list(struct net_device *dev)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = sdata->local;
int allmulti, promisc, sdata_allmulti, sdata_promisc;
allmulti = !!(dev->flags & IFF_ALLMULTI);
promisc = !!(dev->flags & IFF_P... | 0 | 24,335 |
Analyze the following 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 *path_name(const struct name_path *path, const char *name)
{
const struct name_path *p;
char *n, *m;
int nlen = strlen(name);
int len = nlen + 1;
for (p = path; p; p = p->up) {
if (p->elem_len)
len += p->elem_len + 1;
}
n = xmalloc(len);
m = n + len - (nlen + 1);
strcpy(m, name);
for (p =... | 1 | 167,429 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void GLES2Implementation::Viewport(GLint x,
GLint y,
GLsizei width,
GLsizei height) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glViewport(" << x << ", " << y
... | 0 | 141,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: LayoutTestContentRendererClient::OverrideCreateMIDIAccessor(
WebMIDIAccessorClient* client) {
WebTestInterfaces* interfaces =
LayoutTestRenderProcessObserver::GetInstance()->test_interfaces();
return interfaces->CreateMIDIAccessor(client);
}
Commit Message: content: Rename webkit_test_helpers.{cc,h... | 0 | 123,618 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: sc_parse_ef_gdo(struct sc_card *card,
unsigned char *iccsn, size_t *iccsn_len,
unsigned char *chn, size_t *chn_len)
{
struct sc_context *ctx;
struct sc_path path;
struct sc_file *file;
unsigned char *gdo = NULL;
size_t gdo_len = 0;
int r;
if (!card)
return SC_ERROR_INVALID_ARGUMENTS;
ctx = card->c... | 0 | 78,708 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: archive_read_format_lha_read_data_skip(struct archive_read *a)
{
struct lha *lha;
int64_t bytes_skipped;
lha = (struct lha *)(a->format->data);
if (lha->entry_unconsumed) {
/* Consume as much as the decompressor actually used. */
__archive_read_consume(a, lha->entry_unconsumed);
lha->entry_unconsumed ... | 0 | 68,621 |
Analyze the following 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 kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu,
struct kvm_vcpu_events *events)
{
process_nmi(vcpu);
events->exception.injected =
vcpu->arch.exception.pending &&
!kvm_exception_is_soft(vcpu->arch.exception.nr);
events->exception.nr = vcpu->arch.exception.nr;
events->excep... | 0 | 57,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 PHP_FUNCTION(xmlwriter_start_cdata)
{
zval *pind;
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
int retval;
#ifdef ZEND_ENGINE_2
zval *this = getThis();
if (this) {
XMLWRITER_FROM_OBJECT(intern, this);
} else
#endif
{
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILU... | 0 | 15,307 |
Analyze the following 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 RunCallbacksWithDisabled(LogoCallbacks callbacks) {
if (callbacks.on_cached_encoded_logo_available) {
std::move(callbacks.on_cached_encoded_logo_available)
.Run(LogoCallbackReason::DISABLED, base::nullopt);
}
if (callbacks.on_cached_decoded_logo_available) {
std::move(callbacks.on_cache... | 1 | 171,958 |
Analyze the following 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 llcp_sock_poll(struct file *file, struct socket *sock,
poll_table *wait)
{
struct sock *sk = sock->sk;
unsigned int mask = 0;
pr_debug("%p\n", sk);
sock_poll_wait(file, sk_sleep(sk), wait);
if (sk->sk_state == LLCP_LISTEN)
return llcp_accept_poll(sk);
if (sk->sk_err || !skb_... | 0 | 30,489 |
Analyze the following 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 sctp_getsockopt_peer_addrs(struct sock *sk, int len,
char __user *optval, int __user *optlen)
{
struct sctp_association *asoc;
int cnt = 0;
struct sctp_getaddrs getaddrs;
struct sctp_transport *from;
void __user *to;
union sctp_addr temp;
struct sctp_sock *sp = sctp_sk(sk);
int addrle... | 0 | 43,546 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void MeasureAsLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::ToImpl(holder);
V8SetReturnValueInt(info, impl->measureAsLongAttribute());
}
Commit Message: bindings: Support "attribute Fro... | 0 | 134,857 |
Analyze the following 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 r_bin_dwarf_row_free(void *p) {
RBinDwarfRow *row = (RBinDwarfRow*)p;
free (row->file);
free (row);
}
Commit Message: Fix #8813 - segfault in dwarf parser
CWE ID: CWE-125 | 0 | 59,719 |
Analyze the following 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 flashgchar(struct airo_info *ai,int matchbyte,int dwelltime){
int rchar;
unsigned char rbyte=0;
do {
rchar = IN4500(ai,SWS1);
if(dwelltime && !(0x8000 & rchar)){
dwelltime -= 10;
mdelay(10);
continue;
}
rbyte = 0xff & rchar;
if( (rbyte == matchbyte) && (0x8000 & rchar... | 0 | 24,029 |
Analyze the following 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 short pmcraid_get_minor(void)
{
int minor;
minor = find_first_zero_bit(pmcraid_minor, sizeof(pmcraid_minor));
__set_bit(minor, pmcraid_minor);
return minor;
}
Commit Message: [SCSI] pmcraid: reject negative request size
There's a code path in pmcraid that can be reached via device ioctl tha... | 0 | 26,450 |
Analyze the following 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 CheckURLIsBlocked(Browser* browser, const std::string& spec) {
GURL url(spec);
ui_test_utils::NavigateToURL(browser, url);
content::WebContents* contents =
browser->tab_strip_model()->GetActiveWebContents();
CheckURLIsBlockedInWebContents(contents, url);
}
Commit Message: Enforce the WebUsbAll... | 0 | 157,016 |
Analyze the following 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 nfs4_proc_unlck(struct nfs4_state *state, int cmd, struct file_lock *request)
{
struct nfs_inode *nfsi = NFS_I(state->inode);
struct nfs_seqid *seqid;
struct nfs4_lock_state *lsp;
struct rpc_task *task;
int status = 0;
unsigned char fl_flags = request->fl_flags;
status = nfs4_set_lock_state(sta... | 0 | 22,905 |
Analyze the following 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 MagickMin(const size_t x,const size_t y)
{
if (x < y)
return(x);
return(y);
}
Commit Message:
CWE ID: CWE-119 | 0 | 71,477 |
Analyze the following 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 *to_led_name(int selector)
{
switch (selector) {
case HUB_LED_AMBER:
return "amber";
case HUB_LED_GREEN:
return "green";
case HUB_LED_OFF:
return "off";
case HUB_LED_AUTO:
return "auto";
default:
return "??";
}
}
Commit Message: USB: fix invalid memory access in hub_activate()
Commi... | 0 | 56,787 |
Analyze the following 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_args_init(
struct xfs_da_args *args,
struct xfs_inode *dp,
const unsigned char *name,
int flags)
{
if (!name)
return -EINVAL;
memset(args, 0, sizeof(*args));
args->geo = dp->i_mount->m_attr_geo;
args->whichfork = XFS_ATTR_FORK;
args->dp = dp;
args->flags = flags;
args->name = name;
args... | 0 | 76,313 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int tgr192_init(struct shash_desc *desc)
{
struct tgr192_ctx *tctx = shash_desc_ctx(desc);
tctx->a = 0x0123456789abcdefULL;
tctx->b = 0xfedcba9876543210ULL;
tctx->c = 0xf096a5b4c3b2e187ULL;
tctx->nblocks = 0;
tctx->count = 0;
return 0;
}
Commit Message: crypto: prefix module autoloading with "cry... | 0 | 47,391 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ArcInputMethodManagerServiceTest()
: arc_service_manager_(std::make_unique<ArcServiceManager>()) {}
Commit Message: Clear |composing_text_| after CommitText() is called.
|composing_text_| of InputConnectionImpl should be cleared after
CommitText() is called. Otherwise, FinishComposingText() will commit ... | 0 | 156,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: PanoramiXRenderTrapezoids(ClientPtr client)
{
PanoramiXRes *src, *dst;
int result = Success, j;
REQUEST(xRenderTrapezoidsReq);
char *extra;
int extra_len;
REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq);
VERIFY_XIN_PICTURE(src, stuff->src, client, DixReadAccess);
VERIFY_XIN_PICTURE(... | 0 | 17,565 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.