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: static ssize_t port_fops_splice_write(struct pipe_inode_info *pipe,
struct file *filp, loff_t *ppos,
size_t len, unsigned int flags)
{
struct port *port = filp->private_data;
struct sg_list sgl;
ssize_t ret;
struct port_buffer *buf;
struct splice_desc sd = {
.total_len = len,
.flags =... | 0 | 66,608 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: XML_SetExternalEntityRefHandler(XML_Parser parser,
XML_ExternalEntityRefHandler handler)
{
if (parser != NULL)
parser->m_externalEntityRefHandler = handler;
}
Commit Message: xmlparse.c: Fix extraction of namespace prefix from XML name (#186)
CWE ID: CWE-611 | 0 | 92,280 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: xsmp_get_discard_command (GsmClient *client)
{
SmProp *prop;
prop = find_property (GSM_XSMP_CLIENT (client), SmDiscardCommand, NULL);
if (!prop || strcmp (prop->type, SmLISTofARRAY8) != 0) {
return NULL;
}
return prop_to_command (prop);
}
Commit Message:... | 0 | 63,583 |
Analyze the following 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_set_mode(struct inode *inode, umode_t mode)
{
int error = 0;
if (mode != inode->i_mode) {
struct iattr iattr;
iattr.ia_valid = ATTR_MODE | ATTR_CTIME;
iattr.ia_mode = mode;
iattr.ia_ctime = current_fs_time(inode->i_sb);
error = -xfs_setattr_nonsize(XFS_I(inode), &iattr, XFS_ATTR_NOACL);
}
re... | 0 | 21,933 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void BackendImpl::ReportError(int error) {
STRESS_DCHECK(!error || error == ERR_PREVIOUS_CRASH ||
error == ERR_CACHE_CREATED);
DCHECK_LE(error, 0);
CACHE_UMA(CACHE_ERROR, "Error", 0, error * -1);
}
Commit Message: Blockfile cache: fix long-standing sparse + evict reentrancy problem
Thanks... | 0 | 147,269 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: _exsltDateParseGDay (exsltDateValDatePtr dt, const xmlChar **str)
{
const xmlChar *cur = *str;
int ret = 0;
PARSE_2_DIGITS(dt->day, cur, VALID_DAY, ret);
if (ret != 0)
return ret;
*str = cur;
#ifdef DEBUG_EXSLT_DATE
xsltGenericDebug(xsltGenericDebugContext,
"Parsed day %02i\n", ... | 0 | 156,583 |
Analyze the following 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 nl80211_send_scan_aborted(struct cfg80211_registered_device *rdev,
struct net_device *netdev)
{
struct sk_buff *msg;
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg)
return;
if (nl80211_send_scan_msg(msg, rdev, netdev, 0, 0, 0,
NL80211_CMD_SCAN_ABORTED) < 0) {
nlmsg_free(m... | 0 | 26,749 |
Analyze the following 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 tun_sendmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *m, size_t total_len)
{
struct tun_struct *tun = container_of(sock, struct tun_struct, socket);
return tun_get_user(tun, m->msg_iov, total_len,
m->msg_flags & MSG_DONTWAIT);
}
Commit Message: net: Audit drivers to ide... | 0 | 23,874 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: GBool GfxResources::lookupMarkedContentNF(char *name, Object *obj) {
GfxResources *resPtr;
for (resPtr = this; resPtr; resPtr = resPtr->next) {
if (resPtr->propertiesDict.isDict()) {
if (!resPtr->propertiesDict.dictLookupNF(name, obj)->isNull())
return gTrue;
obj->free();
}
}
error(-... | 0 | 8,101 |
Analyze the following 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 WebSocketJob::OnSentSpdyData(int amount_sent) {
DCHECK_NE(INITIALIZED, state_);
DCHECK_NE(CONNECTING, state_);
if (state_ == CLOSED)
return;
if (!spdy_websocket_stream_.get())
return;
OnSentData(socket_, amount_sent);
}
Commit Message: Use ScopedRunnableMethodFactory in WebSocketJob
Don't... | 0 | 98,384 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int srpt_rx_mgmt_fn_tag(struct srpt_send_ioctx *ioctx, u64 tag)
{
struct srpt_device *sdev;
struct srpt_rdma_ch *ch;
struct srpt_send_ioctx *target;
int ret, i;
ret = -EINVAL;
ch = ioctx->ch;
BUG_ON(!ch);
BUG_ON(!ch->sport);
sdev = ch->sport->sdev;
BUG_ON(!sdev);
spin_lock_irq(&sdev->spinlock);
... | 1 | 167,001 |
Analyze the following 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 OutOfProcessInstance::DidOpen(int32_t result) {
if (result == PP_OK) {
if (!engine_->HandleDocumentLoad(embed_loader_)) {
document_load_state_ = LOAD_STATE_LOADING;
DocumentLoadFailed();
}
} else if (result != PP_ERROR_ABORTED) { // Can happen in tests.
NOTREACHED();
Document... | 0 | 129,415 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: tcp_sendf (server *serv, const char *fmt, ...)
{
va_list args;
/* keep this buffer in BSS. Converting UTF-8 to ISO-8859-x might make the
string shorter, so allow alot more than 512 for now. */
static char send_buf[1540]; /* good code hey (no it's not overflowable) */
int len;
va_start (args, fmt);
le... | 0 | 58,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: void XMLHttpRequest::abortError()
{
genericError();
if (!m_uploadComplete) {
m_uploadComplete = true;
if (m_upload && m_uploadEventsAllowed)
m_upload->dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().abortEvent));
}
m_progressEventThrottle.disp... | 1 | 171,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: feed_table(struct table *tbl, char *line, struct table_mode *mode,
int width, int internal)
{
int i;
char *p;
Str tmp;
struct table_linfo *linfo = &tbl->linfo;
if (*line == '<' && line[1] && REALLY_THE_BEGINNING_OF_A_TAG(line)) {
struct parsed_tag *tag;
p = line;
tag = parse_tag(&p, in... | 0 | 84,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: BufferMeta(const sp<GraphicBuffer> &graphicBuffer, OMX_U32 portIndex)
: mGraphicBuffer(graphicBuffer),
mIsBackup(false),
mPortIndex(portIndex) {
}
Commit Message: DO NOT MERGE: IOMX: work against metadata buffer spoofing
- Prohibit direct set/getParam/Settings for extensio... | 1 | 174,126 |
Analyze the following 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 vhost_dev_reset_owner(struct vhost_dev *dev, struct vhost_memory *memory)
{
int i;
vhost_dev_cleanup(dev, true);
/* Restore memory to default empty mapping. */
memory->nregions = 0;
dev->memory = memory;
/* We don't need VQ locks below since vhost_dev_cleanup makes sure
* VQs aren't running.
*/
... | 0 | 42,213 |
Analyze the following 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 sc_pkcs15emu_sc_hsm_read_tokeninfo (sc_pkcs15_card_t * p15card)
{
sc_card_t *card = p15card->card;
int r;
u8 efbin[512];
size_t len;
LOG_FUNC_CALLED(card->ctx);
/* Read token info */
len = sizeof efbin;
r = read_file(p15card, (u8 *) "\x2F\x03", efbin, &len, 1);
LOG_TEST_RET(card->ctx, r, "Sk... | 0 | 78,816 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: BluetoothAdapter::~BluetoothAdapter() {
if (set_powered_callbacks_)
set_powered_callbacks_->error_callback.Run();
}
Commit Message: bluetooth: Implement getAvailability()
This change implements the getAvailability() method for
navigator.bluetooth as defined in the specification.
Bug: 707640
Change-Id: I9... | 0 | 138,212 |
Analyze the following 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 s32 vmci_transport_error_to_vsock_error(s32 vmci_error)
{
int err;
switch (vmci_error) {
case VMCI_ERROR_NO_MEM:
err = ENOMEM;
break;
case VMCI_ERROR_DUPLICATE_ENTRY:
case VMCI_ERROR_ALREADY_EXISTS:
err = EADDRINUSE;
break;
case VMCI_ERROR_NO_ACCESS:
err = EPERM;
break;
case VMCI_ERROR_... | 0 | 30,375 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static u32 srpt_sess_get_index(struct se_session *se_sess)
{
return 0;
}
Commit Message: IB/srpt: Simplify srpt_handle_tsk_mgmt()
Let the target core check task existence instead of the SRP target
driver. Additionally, let the target core check the validity of the
task management request instead of the ib_srpt... | 0 | 50,699 |
Analyze the following 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 TemplateURLRef::IsValid(const SearchTermsData& search_terms_data) const {
ParseIfNecessary(search_terms_data);
return valid_;
}
Commit Message: [Contextual Search] Change "Now on Tap" to "Contextual Cards"
BUG=644934
Review-Url: https://codereview.chromium.org/2361163003
Cr-Commit-Position: refs/heads... | 0 | 120,299 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static bool check_same_owner(struct task_struct *p)
{
const struct cred *cred = current_cred(), *pcred;
bool match;
rcu_read_lock();
pcred = __task_cred(p);
if (cred->user->user_ns == pcred->user->user_ns)
match = (cred->euid == pcred->euid ||
cred->euid == pcred->uid);
else
match = false;
rcu_rea... | 0 | 26,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: static int php_zip_ops_flush(php_stream *stream TSRMLS_DC)
{
if (!stream) {
return 0;
}
return 0;
}
Commit Message:
CWE ID: CWE-119 | 0 | 9,511 |
Analyze the following 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 TextureManager::MarkMipmapsGenerated(TextureManager::TextureInfo* info) {
DCHECK(info);
if (!info->CanRender(feature_info_)) {
DCHECK_NE(0, num_unrenderable_textures_);
--num_unrenderable_textures_;
}
if (!info->SafeToRenderFrom()) {
DCHECK_NE(0, num_unsafe_textures_);
--num_unsafe_te... | 0 | 103,730 |
Analyze the following 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 dispatchDataCall(Parcel& p, RequestInfo *pRI) {
const int numParamsRilV3 = 6;
int pos = p.dataPosition();
int numParams = p.readInt32();
if (s_callbacks.version < 4 && numParams > numParamsRilV3) {
Parcel p2;
p2.appendFrom(&p, 0, pos);
p2.writeInt32(numParamsRilV3);
for(int i = 0; ... | 0 | 162,093 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int tcp_try_undo_loss(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
if (tcp_may_undo(tp)) {
struct sk_buff *skb;
tcp_for_write_queue(skb, sk) {
if (skb == tcp_send_head(sk))
break;
TCP_SKB_CB(skb)->sacked &= ~TCPCB_LOST;
}
tcp_clear_all_retrans_hints(tp);
DBGUNDO(sk, "partia... | 0 | 41,224 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: FontSelector* OffscreenCanvas::GetFontSelector() {
if (auto* document = DynamicTo<Document>(GetExecutionContext())) {
return document->GetStyleEngine().GetFontSelector();
}
return To<WorkerGlobalScope>(GetExecutionContext())->GetFontSelector();
}
Commit Message: Clean up CanvasResourceDispatcher on fin... | 0 | 152,142 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static inline void get_lowest_part_y(H264Context *h, int refs[2][48], int n,
int height, int y_offset, int list0,
int list1, int *nrefs)
{
int my;
y_offset += 16 * (h->mb_y >> MB_FIELD(h));
if (list0) {
int ref_n = ... | 0 | 28,243 |
Analyze the following 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 hid_free_report(struct hid_report *report)
{
unsigned n;
for (n = 0; n < report->maxfield; n++)
kfree(report->field[n]);
kfree(report);
}
Commit Message: HID: core: prevent out-of-bound readings
Plugging a Logitech DJ receiver with KASAN activated raises a bunch of
out-of-bound readings.
The ... | 0 | 49,493 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: g_utf8_strlen (const gchar * p, gssize max)
{
glong len = 0;
const gchar *start = p;
g_return_val_if_fail (p != NULL || max == 0, 0);
if (max < 0)
{
while (*p)
{
p = g_utf8_next_char (p);
++len;
}
}
else
{
if (max == 0 || !*p)
return 0;
p = g_utf8_next_char (p);
... | 0 | 4,771 |
Analyze the following 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 virtio_device_set_child_bus_name(VirtIODevice *vdev, char *bus_name)
{
if (vdev->bus_name) {
g_free(vdev->bus_name);
vdev->bus_name = NULL;
}
if (bus_name) {
vdev->bus_name = g_strdup(bus_name);
}
}
Commit Message:
CWE ID: CWE-119 | 0 | 14,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: RenderProcessHostImpl::GetRemoteInterfaces() {
return child_connection_->GetRemoteInterfaces();
}
Commit Message: Switching AudioOutputAuthorizationHandler from using AudioManager interface to AudioSystem one.
BUG=672468
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tr... | 0 | 128,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: void HTMLInputElement::resetListAttributeTargetObserver()
{
if (inDocument())
m_listAttributeTargetObserver = ListAttributeTargetObserver::create(fastGetAttribute(listAttr), this);
else
m_listAttributeTargetObserver = nullptr;
}
Commit Message: Setting input.x-webkit-speech should not cau... | 0 | 112,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: uint16_t smb1cli_conn_server_security_mode(struct smbXcli_conn *conn)
{
return conn->smb1.server.security_mode;
}
Commit Message:
CWE ID: CWE-20 | 0 | 2,400 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void IndexedDBDispatcher::RequestIDBFactoryOpen(
const string16& name,
WebIDBCallbacks* callbacks_ptr,
const string16& origin,
WebFrame* web_frame) {
ResetCursorPrefetchCaches();
scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
if (!CurrentWorkerId() &&
!ChildThread::current()->I... | 0 | 108,705 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: nfs4_stat_to_errno(int stat)
{
int i;
for (i = 0; nfs_errtbl[i].stat != -1; i++) {
if (nfs_errtbl[i].stat == stat)
return nfs_errtbl[i].errno;
}
if (stat <= 10000 || stat > 10100) {
/* The server is looney tunes. */
return -EREMOTEIO;
}
/* If we cannot translate the error, the recovery routines sho... | 0 | 23,403 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: PanoramiXFindIDByScrnum(RESTYPE type, XID id, int screen)
{
PanoramiXSearchData data;
void *val;
if (!screen) {
dixLookupResourceByType(&val, id, type, serverClient, DixReadAccess);
return val;
}
data.screen = screen;
data.id = id;
return LookupClientResourceComplex(... | 0 | 17,370 |
Analyze the following 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 WebContentsImpl::GetEmbeddedInstanceID() const {
BrowserPluginGuest* guest = GetBrowserPluginGuest();
if (guest)
return guest->instance_id();
return 0;
}
Commit Message: Cancel JavaScript dialogs when an interstitial appears.
BUG=295695
TEST=See bug for repro steps.
Review URL: https://chromiumco... | 0 | 110,633 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: ~XCustomCursor() {
XcursorImageDestroy(image_);
XFreeCursor(GetXDisplay(), cursor_);
}
Commit Message: Make shared memory segments writable only by their rightful owners.
BUG=143859
TEST=Chrome's UI still works on Linux and Chrome OS
Review URL: https://chromiumcodereview.appspot.com/1085424... | 0 | 119,236 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static ssize_t ext4_attr_store(struct kobject *kobj,
struct attribute *attr,
const char *buf, size_t len)
{
struct ext4_sb_info *sbi = container_of(kobj, struct ext4_sb_info,
s_kobj);
struct ext4_attr *a = container_of(attr, struct ext4_attr, attr);
return a->store ? a->store(a, sbi,... | 0 | 20,446 |
Analyze the following 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 perf_event_output(struct perf_event *event,
struct perf_sample_data *data,
struct pt_regs *regs)
{
struct perf_output_handle handle;
struct perf_event_header header;
/* protect the callchain buffers */
rcu_read_lock();
perf_prepare_sample(&header, data, event, regs);
if (perf_output_begin(&han... | 0 | 56,090 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void GLES2DecoderImpl::DoBindVertexArrayOES(GLuint client_id) {
VertexAttribManager* vao = nullptr;
if (client_id != 0) {
vao = GetVertexAttribManager(client_id);
if (!vao) {
LOCAL_SET_GL_ERROR(
GL_INVALID_OPERATION,
"glBindVertexArrayOES", "bad vertex array id.");
curr... | 0 | 141,270 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: Track::~Track() {
Info& info = const_cast<Info&>(m_info);
info.Clear();
ContentEncoding** i = content_encoding_entries_;
ContentEncoding** const j = content_encoding_entries_end_;
while (i != j) {
ContentEncoding* const encoding = *i++;
delete encoding;
}
delete[] content_encoding_entries_;
}
Commit... | 0 | 160,865 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void WebDevToolsAgentImpl::didCreateScriptContext(WebLocalFrameImpl* webframe, int worldId)
{
if (worldId)
return;
if (WebCore::LocalFrame* frame = webframe->frame())
frame->script().setContextDebugId(m_hostId);
}
Commit Message: [4/4] Process clearBrowserCahce/cookies commands in browser... | 0 | 114,200 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void CWebServer::CleanSessions() {
m_sql.safe_query(
"DELETE FROM UserSessions WHERE ExpirationDate < datetime('now', 'localtime')");
}
Commit Message: Fixed possible SQL Injection Vulnerability (Thanks to Fabio Carretto!)
CWE ID: CWE-89 | 0 | 90,960 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
u8 key_idx, bool pairwise, const u8 *mac_addr,
struct key_params *params)
{
struct brcmf_if *ifp = netdev_priv(ndev);
struct brcmf_wsec_key *key;
s32 val;
s32 wsec;
s32 err;
u8 keybuf[8];
bool ext_key;
brcmf_dbg(TRACE,... | 0 | 48,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: hashTableDestroy(HASH_TABLE *table)
{
size_t i;
for (i = 0; i < table->size; i++)
table->mem->free_fcn(table->v[i]);
table->mem->free_fcn(table->v);
}
Commit Message: xmlparse.c: Fix extraction of namespace prefix from XML name (#186)
CWE ID: CWE-611 | 0 | 92,336 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags) /* {{{ */
{
if (*traverse_pointer_ptr) {
spl_ptr_llist_element *old = *traverse_pointer_ptr;
if (flags & SPL_DLLIST_IT_LIFO) {
*traverse_pointer_ptr = o... | 0 | 54,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: void RenderFrameHostImpl::OnRenderProcessGone(int status, int exit_code) {
base::TerminationStatus termination_status =
static_cast<base::TerminationStatus>(status);
if (frame_tree_node_->IsMainFrame()) {
render_view_host_->render_view_termination_status_ = termination_status;
}
if (base::Feat... | 0 | 153,119 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: keyboard::KeyboardController* LockContentsView::GetKeyboardController() const {
return GetWidget() ? GetKeyboardControllerForWidget(GetWidget()) : nullptr;
}
Commit Message: cros: Check initial auth type when showing views login.
Bug: 859611
Change-Id: I0298db9bbf4aed6bd40600aef2e1c5794e8cd058
Reviewed-on: ht... | 0 | 131,503 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void RenameFile(const DownloadId& id,
const FilePath& new_path,
const FilePath& unique_path,
net::Error rename_error,
RenameFileState state,
RenameFileOverwrite should_overwrite) {
MockDownloadFile* file = download_fil... | 1 | 170,881 |
Analyze the following 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 Textfield::OnMousePressed(const ui::MouseEvent& event) {
const bool had_focus = HasFocus();
bool handled = controller_ && controller_->HandleMouseEvent(this, event);
if (!handled &&
(event.IsOnlyLeftMouseButton() || event.IsOnlyRightMouseButton())) {
if (!had_focus)
RequestFocus();
... | 0 | 126,396 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: R_API bool r_config_save_char(RConfigHold *h, ...) {
va_list ap;
char *key;
if (!h->list_char) {
h->list_char = r_list_newf ((RListFree) free);
if (!h->list_char) {
return false;
}
}
va_start (ap, h);
while ((key = va_arg (ap, char *))) {
RConfigHoldChar *hc = R_NEW0 (RConfigHoldChar);
if (!hc)... | 0 | 64,490 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: cifs_get_tcp_session(struct smb_vol *volume_info)
{
struct TCP_Server_Info *tcp_ses = NULL;
int rc;
cifs_dbg(FYI, "UNC: %s\n", volume_info->UNC);
/* see if we already have a matching tcp_ses */
tcp_ses = cifs_find_tcp_session(volume_info);
if (tcp_ses)
return tcp_ses;
tcp_ses = kzalloc(sizeof(struct T... | 0 | 29,818 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: htc_request_check_host_hdr(struct http *hp)
{
int u;
int seen_host = 0;
for (u = HTTP_HDR_FIRST; u < hp->nhd; u++) {
if (hp->hd[u].b == NULL)
continue;
AN(hp->hd[u].b);
AN(hp->hd[u].e);
if (http_IsHdr(&hp->hd[u], H_Host)) {
if (seen_host) {
return (400);
}
seen_host = 1;
... | 1 | 167,478 |
Analyze the following 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 Document::ThreadedParsingEnabledForTesting() {
return g_threaded_parsing_enabled_for_testing;
}
Commit Message: Cleanup and remove dead code in SetFocusedElement
This early-out was added in:
https://crrev.com/ce8ea3446283965c7eabab592cbffe223b1cf2bc
Back then, we applied fragment focus in LayoutUpdated... | 0 | 129,899 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: handle_role_request(struct ofconn *ofconn, const struct ofp_header *oh)
{
struct ofputil_role_request request;
struct ofputil_role_request reply;
struct ofpbuf *buf;
enum ofperr error;
error = ofputil_decode_role_message(oh, &request);
if (error) {
return error;
}
if (req... | 0 | 77,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: get_opthdr_from_block_data(pcap_t *p, struct block_cursor *cursor, char *errbuf)
{
struct option_header *opthdr;
opthdr = get_from_block_data(cursor, sizeof(*opthdr), errbuf);
if (opthdr == NULL) {
/*
* Option header is cut short.
*/
return (NULL);
}
/*
* Byte-swap it if necessary.
*/
if (p-... | 0 | 88,400 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: bool PaintLayerScrollableArea::HasBeenDisposed() const {
return !layer_;
}
Commit Message: Always call UpdateCompositedScrollOffset, not just for the root layer
Bug: 927560
Change-Id: I1d5522aae4f11dd3f5b8947bb089bac1bf19bdb4
Reviewed-on: https://chromium-review.googlesource.com/c/1452701
Reviewed-by: Chris H... | 0 | 130,052 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void TextureManager::StopTracking(TextureManager::TextureInfo* texture) {
--texture_info_count_;
if (!texture->CanRender(feature_info_)) {
DCHECK_NE(0, num_unrenderable_textures_);
--num_unrenderable_textures_;
}
if (!texture->SafeToRenderFrom()) {
DCHECK_NE(0, num_unsafe_textures_);
--num... | 0 | 103,741 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void btif_hl_release_mcl_sockets(UINT8 app_idx, UINT8 mcl_idx){
UINT8 i;
btif_hl_mdl_cb_t *p_dcb;
BOOLEAN found= FALSE;
BTIF_TRACE_DEBUG("%s", __FUNCTION__);
for (i=0; i < BTA_HL_NUM_MDLS_PER_MCL ; i ++)
{
p_dcb = BTIF_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, i);
if (p... | 0 | 158,740 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static inline int handle_dots(struct nameidata *nd, int type)
{
if (type == LAST_DOTDOT) {
if (nd->flags & LOOKUP_RCU) {
return follow_dotdot_rcu(nd);
} else
follow_dotdot(nd);
}
return 0;
}
Commit Message: vfs: Test for and handle paths that are unreachable from their mnt_root
In rare cases ... | 1 | 166,637 |
Analyze the following 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 sched_domain *__build_smt_sched_domain(struct s_data *d,
const struct cpumask *cpu_map, struct sched_domain_attr *attr,
struct sched_domain *parent, int i)
{
struct sched_domain *sd = parent;
#ifdef CONFIG_SCHED_SMT
sd = &per_cpu(cpu_domains, i).sd;
SD_INIT(sd, SIBLING);
set_domain_attribute(s... | 0 | 22,298 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees,
const int bgColor)
{
float _angle = ((float) (-degrees / 180.0f) * (float)M_PI);
const int src_w = gdImageSX(src);
const int src_h = gdImageSY(src);
const unsigned int new_width = (unsigned int)(abs((int)(src_w *... | 0 | 56,344 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static inline bool vmx_control_verify(u32 control, u32 low, u32 high)
{
return fixed_bits_valid(control, low, high);
}
Commit Message: kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF)
When L2 exits to L0 due to "exception or NMI", software exceptions
(#BP and #OF) for which L1 has requested a... | 0 | 48,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: DiceResponseHandler* DiceResponseHandler::GetForProfile(Profile* profile) {
return DiceResponseHandlerFactory::GetForProfile(profile);
}
Commit Message: [signin] Add metrics to track the source for refresh token updated events
This CL add a source for update and revoke credentials operations. It then
surfaces... | 0 | 143,047 |
Analyze the following 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 FilePath& DownloadItemImpl::GetForcedFilePath() const {
return forced_file_path_;
}
Commit Message: Refactors to simplify rename pathway in DownloadFileManager.
This is https://chromiumcodereview.appspot.com/10668004 / r144817 (reverted
due to CrOS failure) with the completion logic moved to after the ... | 0 | 106,089 |
Analyze the following 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 RootWindowHostLinux::UnConfineCursor() {
#if XFIXES_MAJOR >= 5
if (pointer_barriers_.get()) {
XFixesDestroyPointerBarrier(xdisplay_, pointer_barriers_[0]);
XFixesDestroyPointerBarrier(xdisplay_, pointer_barriers_[1]);
XFixesDestroyPointerBarrier(xdisplay_, pointer_barriers_[2]);
XFixesDestr... | 0 | 104,014 |
Analyze the following 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 dexOptMkdir(const char* path, int mode)
{
#ifdef _WIN32
return mkdir(path);
#else
return mkdir(path, mode);
#endif
}
Commit Message: Fix potential buffer overrun.
BUG=27840771
Change-Id: I240f188b2e8f4b45d90138cfb3b14869cf506452
CWE ID: CWE-119 | 0 | 159,752 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void FillGifBackGround(struct ngiflib_gif * g) {
long n = (long)g->width*g->height;
#ifndef NGIFLIB_INDEXED_ONLY
u32 bg_truecolor;
#endif /* NGIFLIB_INDEXED_ONLY */
if((g->frbuff.p8==NULL)||(g->palette==NULL)) return;
#ifndef NGIFLIB_INDEXED_ONLY
if(g->mode & NGIFLIB_MODE_INDEXED) {
#endif /* NGIFLIB_... | 0 | 83,086 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int adev_dump(const audio_hw_device_t *device, int fd)
{
UNUSED(device);
UNUSED(fd);
FNLOG();
return 0;
}
Commit Message: DO NOT MERGE Fix potential DoS caused by delivering signal to BT process
Bug: 28885210
Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360
Conflicts:
btif/co/bta_hh... | 0 | 158,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: static int decode_attr_aclsupport(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
{
__be32 *p;
*res = ACL4_SUPPORT_ALLOW_ACL|ACL4_SUPPORT_DENY_ACL;
if (unlikely(bitmap[0] & (FATTR4_WORD0_ACLSUPPORT - 1U)))
return -EIO;
if (likely(bitmap[0] & FATTR4_WORD0_ACLSUPPORT)) {
p = xdr_inline_decode(xdr,... | 0 | 23,254 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: FindInPageNotificationObserver::FindInPageNotificationObserver(
AutomationProvider* automation, WebContents* parent_tab,
bool reply_with_json, IPC::Message* reply_message)
: automation_(automation->AsWeakPtr()),
active_match_ordinal_(-1),
reply_with_json_(reply_with_json),
reply_mess... | 0 | 117,528 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: LayoutUnit RenderBlockFlow::logicalLeftOffsetForPositioningFloat(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const
{
LayoutUnit offset = fixedOffset;
if (m_floatingObjects && m_floatingObjects->hasLeftObjects())
offset = m_floatingObjects->logi... | 0 | 116,384 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: GLES2Decoder::GLES2Decoder(DecoderClient* client,
CommandBufferServiceBase* command_buffer_service,
Outputter* outputter)
: CommonDecoder(client, command_buffer_service), outputter_(outputter) {
DCHECK(outputter_);
}
Commit Message: Add GL_PROGRAM_COMPL... | 0 | 141,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: static unsigned long emulator_get_cr(struct x86_emulate_ctxt *ctxt, int cr)
{
struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt);
unsigned long value;
switch (cr) {
case 0:
value = kvm_read_cr0(vcpu);
break;
case 2:
value = vcpu->arch.cr2;
break;
case 3:
value = kvm_read_cr3(vcpu);
break;
case 4:
va... | 0 | 20,667 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int __init pcd_init(void)
{
struct pcd_unit *cd;
int unit;
if (disable)
return -EINVAL;
pcd_init_units();
if (pcd_detect())
return -ENODEV;
/* get the atapi capabilities page */
pcd_probe_capabilities();
if (register_blkdev(major, name)) {
for (unit = 0, cd = pcd; unit < PCD_UNITS; un... | 1 | 169,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: WORD32 ih264d_start_of_pic(dec_struct_t *ps_dec,
WORD32 i4_poc,
pocstruct_t *ps_temp_poc,
UWORD16 u2_frame_num,
dec_pic_params_t *ps_pps)
{
pocstruct_t *ps_prev_poc = &ps_dec->s_cur_pic_poc;
pocstruct_t *ps_cur_poc = ps_temp_poc;
pic_buffer_t *pic_buf;
ivd... | 0 | 162,630 |
Analyze the following 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 imap_cmd_idle(struct ImapData *idata)
{
int rc;
if (cmd_start(idata, "IDLE", IMAP_CMD_POLL) < 0)
{
cmd_handle_fatal(idata);
return -1;
}
if ((ImapPollTimeout > 0) && (mutt_socket_poll(idata->conn, ImapPollTimeout)) == 0)
{
mutt_error(_("Connection to %s timed out"), idata->conn->acco... | 0 | 79,567 |
Analyze the following 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 AXTreeSerializerTest::CreateTreeSerializer() {
if (serializer_)
return;
tree0_.reset(new AXSerializableTree(treedata0_));
tree1_.reset(new AXSerializableTree(treedata1_));
tree0_source_.reset(tree0_->CreateTreeSource());
serializer_.reset(new AXTreeSerializer<const AXNode*>(tree0_source_.get(... | 0 | 127,689 |
Analyze the following 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 WebGLRenderingContextBase::PaintRenderingResultsToCanvas(
SourceDrawingBuffer source_buffer) {
if (isContextLost())
return false;
bool must_clear_now = ClearIfComposited() != kSkipped;
if (!marked_canvas_dirty_ && !must_clear_now)
return false;
canvas()->ClearCopiedImage();
marked_can... | 0 | 146,918 |
Analyze the following 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 ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
int offset, int len, int odd, struct sk_buff *skb),
void *from, int length, int transhdrlen,
int hlimit, int tclass, struct ipv6_txoptions *opt, struct flowi6 *fl6,
struct rt6_info *rt, unsigned int flags, int dontfrag)
{
struct inet_sock... | 0 | 97,039 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: loff_t mem_lseek(struct file *file, loff_t offset, int orig)
{
switch (orig) {
case 0:
file->f_pos = offset;
break;
case 1:
file->f_pos += offset;
break;
default:
return -EINVAL;
}
force_successful_syscall_return();
return file->f_pos;
}
Commit Message: proc: restrict access to /proc/PID/io
/pr... | 0 | 26,816 |
Analyze the following 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 cmd_mkdir(void *data, const char *input) {
char *res = r_syscmd_mkdir (input);
if (res) {
r_cons_print (res);
free (res);
}
return 0;
}
Commit Message: Fix #7723 - crash in ext2 GRUB code because of variable size array in stack
CWE ID: CWE-119 | 0 | 64,333 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void __init reserve_crashkernel(void)
{
}
Commit Message: acpi: Disable ACPI table override if securelevel is set
From the kernel documentation (initrd_table_override.txt):
If the ACPI_INITRD_TABLE_OVERRIDE compile option is true, it is possible
to override nearly any ACPI table provided by the BIOS... | 0 | 53,800 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static __init void intel_clovertown_quirk(void)
{
/*
* PEBS is unreliable due to:
*
* AJ67 - PEBS may experience CPL leaks
* AJ68 - PEBS PMI may be delayed by one event
* AJ69 - GLOBAL_STATUS[62] will only be set when DEBUGCTL[12]
* AJ106 - FREEZE_LBRS_ON_PMI doesn't work in combination wi... | 0 | 31,664 |
Analyze the following 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 AppCacheUpdateJob::LogHistogramStats(
ResultType result, const GURL& failed_resource_url) {
AppCacheHistograms::CountUpdateJobResult(result,
url::Origin::Create(manifest_url_));
if (result == UPDATE_OK)
return;
int percent_complete = 0;
if (url_fi... | 0 | 151,426 |
Analyze the following 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 plist_data_hash(const void* key)
{
plist_data_t data = plist_get_data((plist_t) key);
unsigned int hash = data->type;
unsigned int i = 0;
char *buff = NULL;
unsigned int size = 0;
switch (data->type)
{
case PLIST_BOOLEAN:
case PLIST_UINT:
case PLIST_R... | 0 | 68,035 |
Analyze the following 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 AXNodeObject::markers(Vector<DocumentMarker::MarkerType>& markerTypes,
Vector<AXRange>& markerRanges) const {
if (!getNode() || !getDocument() || !getDocument()->view())
return;
DocumentMarkerController& markerController = getDocument()->markers();
DocumentMarkerVector m... | 0 | 127,190 |
Analyze the following 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 TryMatchSearchParam(base::StringPiece text,
base::StringPiece pattern,
std::string* prefix,
std::string* suffix) {
auto pos = text.find(pattern);
if (pos == base::StringPiece::npos)
return false;
text.substr(0, pos).CopyToSt... | 0 | 120,320 |
Analyze the following 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 EnsureCreateFIFO(const base::FilePath& path) {
unlink(path.value().c_str());
CHECK(base::android::CreateFIFO(path, 0666))
<< "Unable to create the Android's FIFO: " << path.value().c_str();
}
Commit Message: Content Shell: Move shell_layout_tests_android into layout_tests/.
BUG=420994
Review URL: ... | 0 | 110,819 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void ExtensionService::GarbageCollectExtensions() {
if (extension_prefs_->pref_service()->ReadOnly())
return;
scoped_ptr<ExtensionPrefs::ExtensionsInfo> info(
extension_prefs_->GetInstalledExtensionsInfo());
std::map<std::string, FilePath> extension_paths;
for (size_t i = 0; i < info->size(); ... | 0 | 98,568 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void MetricsWebContentsObserver::MediaStartedPlaying(
const content::WebContentsObserver::MediaPlayerInfo& video_type,
const content::WebContentsObserver::MediaPlayerId& id) {
if (GetMainFrame(id.render_frame_host) != web_contents()->GetMainFrame()) {
return;
}
if (committed_load_)
committed... | 0 | 140,140 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: __be32 ipv6_select_ident(struct net *net,
const struct in6_addr *daddr,
const struct in6_addr *saddr)
{
static u32 ip6_idents_hashrnd __read_mostly;
u32 id;
net_get_random_once(&ip6_idents_hashrnd, sizeof(ip6_idents_hashrnd));
id = __ipv6_select_ident(net, ip6_idents_hashrnd, daddr, saddr);
re... | 1 | 169,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 TEE_Result get_hkdf_params(const TEE_Attribute *params,
uint32_t param_count,
void **salt, size_t *salt_len, void **info,
size_t *info_len, size_t *okm_len)
{
size_t n;
enum { SALT = 0x1, LENGTH = 0x2, INFO = 0x4 };
uint8_t found = 0;
*salt = *info = NULL;
*salt_len = *info_len = *o... | 0 | 86,835 |
Analyze the following 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 f2fs_freeze(struct super_block *sb)
{
if (f2fs_readonly(sb))
return 0;
/* IO error happened before */
if (unlikely(f2fs_cp_error(F2FS_SB(sb))))
return -EIO;
/* must be clean, since sync_filesystem() was already called */
if (is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY))
return -EINVAL;
retu... | 0 | 63,865 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void addReplyBulkCBuffer(client *c, const void *p, size_t len) {
addReplyLongLongWithPrefix(c,len,'$');
addReplyString(c,p,len);
addReply(c,shared.crlf);
}
Commit Message: Security: Cross Protocol Scripting protection.
This is an attempt at mitigating problems due to cross protocol
scripting, an att... | 0 | 69,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: String WebPagePrivate::findPatternStringForUrl(const KURL& url) const
{
if ((m_webSettings->shouldHandlePatternUrls() && protocolIs(url, "pattern"))
|| protocolIs(url, "tel")
|| protocolIs(url, "wtai")
|| protocolIs(url, "cti")
|| protocolIs(url, "mailto")
... | 0 | 104,207 |
Analyze the following 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 reflectStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
Element* impl = V8Element::toImpl(holder);
v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectstringattributeAttr), info.GetIsolate(... | 1 | 171,597 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.