instruction stringclasses 1
value | input stringlengths 64 129k | output int64 0 1 | __index_level_0__ int64 0 30k |
|---|---|---|---|
Analyze the following 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 nls_table *find_nls(char *charset)
{
struct nls_table *nls;
spin_lock(&nls_lock);
for (nls = tables; nls; nls = nls->next) {
if (!strcmp(nls->charset, charset))
break;
if (nls->alias && !strcmp(nls->alias, charset))
break;
}
if (nls && !try_module_get(nls->owner))
nls = NULL;
spin_... | 0 | 20,373 |
Analyze the following 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 multi_shutdown(struct sb_uart_port *port)
{
struct mp_port *mtpt = (struct mp_port *)port;
unsigned long flags;
mtpt->ier = 0;
serial_outp(mtpt, UART_IER, 0);
spin_lock_irqsave(&mtpt->port.lock, flags);
mtpt->port.mctrl &= ~TIOCM_OUT2;
multi_set_mctrl(&mtpt->port, mtpt->port.mctrl);
spin_u... | 0 | 25,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 Document::DispatchBeforeUnloadEvent(ChromeClient& chrome_client,
bool is_reload,
bool& did_allow_navigation) {
if (!dom_window_)
return true;
if (!body())
return true;
if (ProcessingBeforeUnload())
return fa... | 0 | 7,842 |
Analyze the following 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 is_dx_internal_node(struct inode *dir, ext4_lblk_t block,
struct ext4_dir_entry *de)
{
struct super_block *sb = dir->i_sb;
if (!is_dx(dir))
return 0;
if (block == 0)
return 1;
if (de->inode == 0 &&
ext4_rec_len_from_disk(de->rec_len, sb->s_blocksize) ==
sb->s_blocksize)
ret... | 0 | 19,596 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void online_fair_sched_group(struct task_group *tg) { }
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 | 6,915 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: bool LayerTreeHost::SendMessageToMicroBenchmark(
int id,
std::unique_ptr<base::Value> value) {
return micro_benchmark_controller_.SendMessage(id, std::move(value));
}
Commit Message: (Reland) Discard compositor frames from unloaded web content
This is a reland of https://codereview.chromium.org/270724... | 0 | 25,498 |
Analyze the following 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 packet_net_exit(struct net *net)
{
remove_proc_entry("packet", net->proc_net);
}
Commit Message: net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockad... | 0 | 14,327 |
Analyze the following 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 floppy_module_init(void)
{
if (floppy)
parse_floppy_cfg_string(floppy);
return floppy_init();
}
Commit Message: floppy: don't write kernel-only members to FDRAWCMD ioctl output
Do not leak kernel-only floppy_raw_cmd structure members to userspace.
This includes the linked-list pointer and ... | 0 | 23,448 |
Analyze the following 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 Image *ComplexImages(const Image *images,const ComplexOperator op,
ExceptionInfo *exception)
{
#define ComplexImageTag "Complex/Image"
CacheView
*Ai_view,
*Ar_view,
*Bi_view,
*Br_view,
*Ci_view,
*Cr_view;
const char
*artifact;
const Image
*Ai_image,
*Ar... | 1 | 4,275 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static bool ValidMpegAudioFrameHeader(const uint8_t* header,
int header_size,
int* framesize) {
DCHECK_GE(header_size, 4);
*framesize = 0;
BitReader reader(header, 4); // Header can only be 4 bytes long.
RCHECK(ReadBits(&reader,... | 0 | 13,319 |
Analyze the following 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 TriState StateJustifyRight(LocalFrame& frame, Event*) {
return StateStyle(frame, CSSPropertyTextAlign, "right");
}
Commit Message: Move Editor::Transpose() out of Editor class
This patch moves |Editor::Transpose()| out of |Editor| class as preparation of
expanding it into |ExecutTranspose()| in "Editor... | 0 | 5,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: void WebContentsImpl::RemoveBrowserPluginEmbedder() {
if (browser_plugin_embedder_)
browser_plugin_embedder_.reset();
}
Commit Message: Cancel JavaScript dialogs when an interstitial appears.
BUG=295695
TEST=See bug for repro steps.
Review URL: https://chromiumcodereview.appspot.com/24360011
git-svn-id:... | 0 | 12,414 |
Analyze the following 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 unshare_fd(unsigned long unshare_flags, struct files_struct **new_fdp)
{
struct files_struct *fd = current->files;
int error = 0;
if ((unshare_flags & CLONE_FILES) &&
(fd && atomic_read(&fd->count) > 1)) {
*new_fdp = dup_fd(fd, &error);
if (!*new_fdp)
return error;
}
return 0;
}
Com... | 0 | 11,324 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: nfsd(void *vrqstp)
{
struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp;
struct svc_xprt *perm_sock = list_entry(rqstp->rq_server->sv_permsocks.next, typeof(struct svc_xprt), xpt_list);
struct net *net = perm_sock->xpt_net;
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
int err;
/* Lock module and s... | 0 | 25,036 |
Analyze the following 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 ndp_msg_opt_prefix_flag_auto_addr_conf(struct ndp_msg *msg, int offset)
{
struct nd_opt_prefix_info *pi =
ndp_msg_payload_opts_offset(msg, offset);
return pi->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_AUTO;
}
Commit Message: libndp: validate the IPv6 hop limit
None of the NDP messages should ever com... | 0 | 24,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: update_info_drive_adapter (Device *device)
{
Adapter *adapter;
const gchar *adapter_object_path;
adapter_object_path = NULL;
adapter = daemon_local_find_enclosing_adapter (device->priv->daemon, device->priv->native_path);
if (adapter != NULL)
{
adapter_object_path = adapter_local_get_object_... | 0 | 28,085 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: check_compat_entry_size_and_hooks(struct compat_ipt_entry *e,
struct xt_table_info *newinfo,
unsigned int *size,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
const char *name)
{
struct xt_entry_m... | 1 | 26,828 |
Analyze the following 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_v4_parse_md5_keys(struct sock *sk, char __user *optval,
int optlen)
{
struct tcp_md5sig cmd;
struct sockaddr_in *sin = (struct sockaddr_in *)&cmd.tcpm_addr;
if (optlen < sizeof(cmd))
return -EINVAL;
if (copy_from_user(&cmd, optval, sizeof(cmd)))
return -EFAULT;
if (sin->sin_family ... | 0 | 8,931 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: long SSL_SESSION_set_timeout(SSL_SESSION *s, long t)
{
if (s == NULL)
return (0);
s->timeout = t;
return (1);
}
Commit Message:
CWE ID: CWE-190 | 0 | 24,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 QQuickWebView::mouseReleaseEvent(QMouseEvent* event)
{
Q_D(QQuickWebView);
d->handleMouseEvent(event);
}
Commit Message: [Qt][WK2] There's no way to test the gesture tap on WTR
https://bugs.webkit.org/show_bug.cgi?id=92895
Reviewed by Kenneth Rohde Christiansen.
Source/WebKit2:
Add an instance of... | 0 | 6,465 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: MockProcessLauncherDelegate() {}
Commit Message: Validate and report peer's PID to WorkerProcessIpcDelegate so it will be able to duplicate handles to and from the worker process.
As a side effect WorkerProcessLauncher::Delegate is now responsible for retrieving the client's PID and deciding whether a launch... | 0 | 19,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: void RenderProcessHostImpl::FilterURL(bool empty_allowed, GURL* url) {
FilterURL(this, empty_allowed, url);
}
Commit Message: Switching AudioOutputAuthorizationHandler from using AudioManager interface to AudioSystem one.
BUG=672468
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_r... | 0 | 10,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* MapFont(struct _FPDF_SYSFONTINFO*, int weight, int italic,
int charset, int pitch_family, const char* face, int* exact) {
if (!pp::Module::Get())
return nullptr;
pp::BrowserFontDescription description;
if (strcmp(face, "Symbol") == 0)
return nullptr;
if (pitch_family & FXFON... | 0 | 25,431 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void RenderFrameImpl::DidChangeFramePolicy(
blink::WebFrame* child_frame,
blink::WebSandboxFlags flags,
const blink::ParsedFeaturePolicy& container_policy) {
Send(new FrameHostMsg_DidChangeFramePolicy(
routing_id_, RenderFrame::GetRoutingIdForWebFrame(child_frame),
{flags, container_poli... | 0 | 14,294 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: int mkdir_deep(const char *szDirName, int secattr)
{
char DirName[260];
DirName[0] = 0;
const char* p = szDirName;
char* q = DirName;
int ret = 0;
while(*p)
{
if (('\\' == *p) || ('/' == *p))
{
if (':' != *(p-1))
{
ret = createdir(DirName, secattr);
}
}
*q++ = *p++;
*q = '\0';
}
if... | 0 | 29,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: void NavigationController::GoForward() {
if (!CanGoForward()) {
NOTREACHED();
return;
}
if (tab_contents_->interstitial_page()) {
tab_contents_->interstitial_page()->CancelForNavigation();
}
bool transient = (transient_entry_index_ != -1);
int current_index = GetCurrentEntryIndex();
... | 0 | 205 |
Analyze the following 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 jas_icclut8_output(jas_iccattrval_t *attrval, jas_stream_t *out)
{
jas_icclut8_t *lut8 = &attrval->data.lut8;
int i;
int j;
int n;
lut8->clut = 0;
lut8->intabs = 0;
lut8->intabsbuf = 0;
lut8->outtabs = 0;
lut8->outtabsbuf = 0;
if (jas_stream_putc(out, lut8->numinchans) == EOF ||
jas_stream... | 0 | 7,088 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: iakerb_save_token(iakerb_ctx_id_t ctx, const gss_buffer_t token)
{
char *p;
p = realloc(ctx->conv.data, ctx->conv.length + token->length);
if (p == NULL)
return ENOMEM;
memcpy(p + ctx->conv.length, token->value, token->length);
ctx->conv.data = p;
ctx->conv.length += token->lengt... | 0 | 21,726 |
Analyze the following 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 MagickBooleanType ReadPSDLayer(Image *image,const ImageInfo *image_info,
const PSDInfo *psd_info,LayerInfo* layer_info,ExceptionInfo *exception)
{
char
message[MagickPathExtent];
MagickBooleanType
status;
PSDCompressionType
compression;
ssize_t
j;
if (image->debug != MagickF... | 0 | 29,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: static size_t out_get_buffer_size(const struct audio_stream *stream)
{
struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
DEBUG("buffer_size : %zu", out->common.buffer_sz);
return out->common.buffer_sz;
}
Commit Message: DO NOT MERGE Fix potential DoS caused by delivering signal to BT proces... | 0 | 14,245 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: GF_Err tims_Read(GF_Box *s, GF_BitStream *bs)
{
GF_TSHintEntryBox *ptr = (GF_TSHintEntryBox *)s;
ptr->timeScale = gf_bs_read_u32(bs);
return GF_OK;
}
Commit Message: fixed 2 possible heap overflows (inc. #1088)
CWE ID: CWE-125 | 0 | 15,530 |
Analyze the following 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 Image *ReadGROUP4Image(const ImageInfo *image_info,
ExceptionInfo *exception)
{
char
filename[MagickPathExtent];
FILE
*file;
Image
*image;
ImageInfo
*read_info;
int
c,
unique_file;
MagickBooleanType
status;
size_t
length;
ssize_t
offset,
stri... | 0 | 2,757 |
Analyze the following 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 strictTypeCheckingFloatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
v8SetReturnValue(info, imp->strictTypeCheckingFloatAttribute());
}
Commit Message: document.location bindings fix
BUG=352374... | 0 | 22,319 |
Analyze the following 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 sk_chk_filter(struct sock_filter *filter, unsigned int flen)
{
/*
* Valid instructions are initialized to non-0.
* Invalid instructions are initialized to 0.
*/
static const u8 codes[] = {
[BPF_ALU|BPF_ADD|BPF_K] = BPF_S_ALU_ADD_K,
[BPF_ALU|BPF_ADD|BPF_X] = BPF_S_ALU_ADD_X,
[BPF_ALU|BPF_SUB|BP... | 0 | 11,636 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static bool encode_extended_dn_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
struct ldb_extended_dn_control *ledc = talloc_get_type(in, struct ldb_extended_dn_control);
struct asn1_data *data;
if (!in) {
*out = data_blob(NULL, 0);
return true;
}
data = asn1_init(mem_ctx);
if (!data) return false... | 0 | 26,491 |
Analyze the following 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 Widget* widgetForNode(Node* focusedNode)
{
if (!focusedNode)
return 0;
RenderObject* renderer = focusedNode->renderer();
if (!renderer || !renderer->isWidget())
return 0;
return toRenderWidget(renderer)->widget();
}
Commit Message: Unreviewed, rolling out r147402.
http://tr... | 0 | 18,135 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: vrrp_bfd_thread(thread_t * thread)
{
bfd_event_t evt;
bfd_thread = thread_add_read(master, vrrp_bfd_thread, NULL,
thread->u.fd, TIMER_NEVER);
if (thread->type != THREAD_READY_FD)
return 0;
while (read(thread->u.fd, &evt, sizeof(bfd_event_t)) != -1)
vrrp_handle_bfd_event(&evt);
return 0;
}
C... | 0 | 24,234 |
Analyze the following 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 *am_ecp_service_options_str(apr_pool_t *pool, ECPServiceOptions options)
{
apr_array_header_t *names = apr_array_make(pool, 4, sizeof(const char *));
if (options & ECP_SERVICE_OPTION_CHANNEL_BINDING) {
APR_ARRAY_PUSH(names, const char *) = "channel-binding";
options &= ~ECP_SERVICE_O... | 0 | 11,046 |
Analyze the following 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 Gfx::opRestore(Object args[], int numArgs) {
restoreState();
}
Commit Message:
CWE ID: CWE-20 | 0 | 17,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: static void cleanup_timers(struct list_head *head)
{
cleanup_timers_list(head);
cleanup_timers_list(++head);
cleanup_timers_list(++head);
}
Commit Message: posix-timers: Sanitize overrun handling
The posix timer overrun handling is broken because the forwarding functions
can return a huge number of overruns ... | 0 | 22,276 |
Analyze the following 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_demultiplex_thread(struct TCP_Server_Info *server)
{
int length;
unsigned int pdu_length, total_read;
struct smb_hdr *smb_buffer = NULL;
struct smb_hdr *bigbuf = NULL;
struct smb_hdr *smallbuf = NULL;
struct msghdr smb_msg;
struct kvec iov;
struct socket *csocket = server->ssocket;
struct list_head ... | 0 | 15,252 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: PHP_FUNCTION(mcrypt_enc_is_block_algorithm_mode)
{
MCRYPT_GET_TD_ARG
if (mcrypt_enc_is_block_algorithm_mode(pm->td) == 1) {
RETURN_TRUE
} else {
RETURN_FALSE
}
}
Commit Message: Fix bug #72455: Heap Overflow due to integer overflows
CWE ID: CWE-190 | 0 | 12,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: inline v8::Handle<v8::Value> DialogHandler::returnValue(v8::Isolate* isolate) const
{
if (m_dialogContext.IsEmpty())
return v8::Undefined(isolate);
v8::Context::Scope scope(m_dialogContext);
v8::Handle<v8::Value> returnValue = m_dialogContext->Global()->Get(v8::String::NewSymbol("returnValue")... | 0 | 8,028 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void xenvif_receive_skb(struct xenvif *vif, struct sk_buff *skb)
{
netif_rx_ni(skb);
}
Commit Message: xen/netback: shutdown the ring if it contains garbage.
A buggy or malicious frontend should not be able to confuse netback.
If we spot anything which is not as it should be then shutdown the
device and don't ... | 0 | 14,929 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: options_for_tty()
{
char *dev, *path, *p;
int ret;
size_t pl;
dev = devnam;
if ((p = strstr(dev, "/dev/")) != NULL)
dev = p + 5;
if (dev[0] == 0 || strcmp(dev, "tty") == 0)
return 1; /* don't look for /etc/ppp/options.tty */
pl = strlen(_PATH_TTYOPT) + strlen(dev) + 1;
path = m... | 0 | 6,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: ATSParser::Stream::Stream(
Program *program,
unsigned elementaryPID,
unsigned streamType,
unsigned PCR_PID)
: mProgram(program),
mElementaryPID(elementaryPID),
mStreamType(streamType),
mPCR_PID(PCR_PID),
mExpectedContinuityCounter(-1),
mPayloadStarted(false),
mEOSReached(f... | 0 | 18,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: error::Error GLES2DecoderPassthroughImpl::DoGetAttachedShaders(
GLuint program,
GLsizei maxcount,
GLsizei* count,
GLuint* shaders) {
api()->glGetAttachedShadersFn(GetProgramServiceID(program, resources_),
maxcount, count, shaders);
return error::kNoError;
}
Com... | 0 | 21,325 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void runtimeEnabledVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
imp->runtimeEnabledVoidMethod();
}
Commit Message: document.location bindings fix
BUG=352374
R=jochen@chromium.org
Review URL: https://coder... | 0 | 21,535 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: DefragIPv4TooLargeTest(void)
{
DefragContext *dc = NULL;
Packet *p = NULL;
int ret = 0;
DefragInit();
dc = DefragContextNew();
if (dc == NULL)
goto end;
/* Create a fragment that would extend past the max allowable size
* for an IPv4 packet. */
p = BuildTestPacke... | 1 | 13,577 |
Analyze the following 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 RenderFlexibleBox::marginBoxAscentForChild(RenderBox* child)
{
LayoutUnit ascent = child->firstLineBoxBaseline();
if (ascent == -1)
ascent = crossAxisExtentForChild(child);
return ascent + flowAwareMarginBeforeForChild(child);
}
Commit Message: Separate repaint and layout requireme... | 0 | 23,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: static int emulator_get_msr(struct x86_emulate_ctxt *ctxt,
u32 msr_index, u64 *pdata)
{
struct msr_data msr;
int r;
msr.index = msr_index;
msr.host_initiated = false;
r = kvm_get_msr(emul_to_vcpu(ctxt), &msr);
if (r)
return r;
*pdata = msr.data;
return 0;
}
Commit Message: KVM: x86: Reload pit... | 0 | 26,498 |
Analyze the following 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 SampleIterator::seekTo(uint32_t sampleIndex) {
ALOGV("seekTo(%d)", sampleIndex);
if (sampleIndex >= mTable->mNumSampleSizes) {
return ERROR_END_OF_STREAM;
}
if (mTable->mSampleToChunkOffset < 0
|| mTable->mChunkOffsetOffset < 0
|| mTable->mSampleSizeOffset < 0
|| mTable->mTimeToSampleCount =... | 1 | 95 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: BrotliResult BrotliDecompressStream(size_t* available_in,
const uint8_t** next_in, size_t* available_out, uint8_t** next_out,
size_t* total_out, BrotliState* s) {
BrotliResult result = BROTLI_RESULT_SUCCESS;
BrotliBitReader* br = &s->br;
if (s->buffer_length == 0) { /* Just connect bit reader to inp... | 0 | 20,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: rx_print(netdissect_options *ndo,
register const u_char *bp, int length, int sport, int dport,
const u_char *bp2)
{
register const struct rx_header *rxh;
int i;
int32_t opcode;
if (ndo->ndo_snapend - bp < (int)sizeof (struct rx_header)) {
ND_PRINT((ndo, " [|rx] (%d)", length));
return;
... | 0 | 9,742 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void LocalFrame::StartPrintingWithoutPrintingLayout() {
SetPrinting(/*printing=*/true, /*use_printing_layout=*/false, FloatSize(),
FloatSize(), 0);
}
Commit Message: Prevent sandboxed documents from reusing the default window
Bug: 377995
Change-Id: Iff66c6d214dfd0cb7ea9c80f83afeedfff703541
Revie... | 0 | 27,019 |
Analyze the following 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 pdf_add_line(struct pdf_doc *pdf, struct pdf_object *page,
int x1, int y1, int x2, int y2, int width, uint32_t colour)
{
int ret;
struct dstr str = {0, 0, 0};
dstr_append(&str, "BT\r\n");
dstr_printf(&str, "%d w\r\n", width);
dstr_printf(&str, "%d %d m\r\n", x1, y1);
... | 0 | 24,658 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void DevToolsUIBindings::SetIsDocked(const DispatchCallback& callback,
bool dock_requested) {
delegate_->SetIsDocked(dock_requested);
callback.Run(nullptr);
}
Commit Message: DevTools: move front-end URL handling to DevToolsUIBindingds
BUG=662859
Review-Url: https://cod... | 0 | 19,120 |
Analyze the following 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 RenderFrameHostManager::IsRendererTransferNeededForNavigation(
RenderFrameHostImpl* rfh,
const GURL& dest_url) {
if (!rfh->GetSiteInstance()->HasSite())
return false;
if (rfh->GetSiteInstance()->GetSiteURL().SchemeIs(kGuestScheme))
return false;
BrowserContext* context = rfh->GetSiteI... | 0 | 23,311 |
Analyze the following 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 GDataFileSystem::OnGetEntryInfoCompleteForOpenFile(
const FilePath& file_path,
const OpenFileCallback& callback,
GDataFileError error,
scoped_ptr<GDataEntryProto> entry_proto) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (entry_proto.get() && !entry_proto->has_file_specifi... | 0 | 8,609 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void mmu_free_pte_list_desc(struct pte_list_desc *pte_list_desc)
{
kmem_cache_free(pte_list_desc_cache, pte_list_desc);
}
Commit Message: nEPT: Nested INVEPT
If we let L1 use EPT, we should probably also support the INVEPT instruction.
In our current nested EPT implementation, when L1 changes its EPT t... | 0 | 18,534 |
Analyze the following 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 em_smsw(struct x86_emulate_ctxt *ctxt)
{
ctxt->dst.bytes = 2;
ctxt->dst.val = ctxt->ops->get_cr(ctxt, 0);
return X86EMUL_CONTINUE;
}
Commit Message: KVM: x86: fix missing checks in syscall emulation
On hosts without this patch, 32bit guests will crash (and 64bit guests
may behave in a wrong way) f... | 0 | 2,208 |
Analyze the following 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 uint32_t in_get_sample_rate(const struct audio_stream *stream)
{
struct a2dp_stream_in *in = (struct a2dp_stream_in *)stream;
FNLOG();
return in->common.cfg.rate;
}
Commit Message: DO NOT MERGE Fix potential DoS caused by delivering signal to BT process
Bug: 28885210
Change-Id: I63866d894bfca47464... | 0 | 20,158 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: MagickExport Image *ComplexImages(const Image *images,const ComplexOperator op,
ExceptionInfo *exception)
{
#define ComplexImageTag "Complex/Image"
CacheView
*Ai_view,
*Ar_view,
*Bi_view,
*Br_view,
*Ci_view,
*Cr_view;
const char
*artifact;
const Image
*Ai_image,
*Ar... | 1 | 18,554 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void **dbg_userword(struct kmem_cache *cachep, void *objp)
{
BUG_ON(!(cachep->flags & SLAB_STORE_USER));
return (void **)(objp + cachep->size - BYTES_PER_WORD);
}
Commit Message: mm/slab.c: fix SLAB freelist randomization duplicate entries
This patch fixes a bug in the freelist randomization code. Whe... | 0 | 563 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void CWebServer::Cmd_GetUserVariable(WebEmSession & session, const request& req, Json::Value &root)
{
std::string idx = request::findValue(&req, "idx");
if (idx.empty())
return;
int iVarID = atoi(idx.c_str());
std::vector<std::vector<std::string> > result;
result = m_sql.safe_query("SELEC... | 0 | 27,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 int proc_tgid_base_readdir(struct file *file, struct dir_context *ctx)
{
return proc_pident_readdir(file, ctx,
tgid_base_stuff, ARRAY_SIZE(tgid_base_stuff));
}
Commit Message: proc: prevent accessing /proc/<PID>/environ until it's ready
If /proc/<PID>/environ gets read before the envp[] array is ... | 0 | 2,238 |
Analyze the following 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 filemap_fdatawait(struct address_space *mapping)
{
loff_t i_size = i_size_read(mapping->host);
if (i_size == 0)
return 0;
return wait_on_page_writeback_range(mapping, 0,
(i_size - 1) >> PAGE_CACHE_SHIFT);
}
Commit Message: fix writev regression: pan hanging unkillable and un-straceable
Frederik H... | 0 | 20,412 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: bool IsImageCursor(gfx::NativeCursor native_cursor) {
return cursors_.find(native_cursor.native_type()) != cursors_.end();
}
Commit Message: Introduce XGetImage() for GrabWindowSnapshot() in ChromeOS.
BUG=119492
TEST=manually done
Review URL: https://chromiumcodereview.appspot.com/10386124
git-svn-id:... | 0 | 7,098 |
Analyze the following 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 skb_unlink(struct sk_buff *skb, struct sk_buff_head *list)
{
unsigned long flags;
spin_lock_irqsave(&list->lock, flags);
__skb_unlink(skb, list);
spin_unlock_irqrestore(&list->lock, flags);
}
Commit Message: skbuff: skb_segment: orphan frags before copying
skb_segment copies frags around, so we need
t... | 0 | 7,647 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: update_title (void) {
Behaviour *b = &uzbl.behave;
gchar *parsed;
if (b->show_status) {
if (b->title_format_short) {
parsed = expand(b->title_format_short, 0);
if (uzbl.gui.main_window)
gtk_window_set_title (GTK_WINDOW(uzbl.gui.main_window), parsed);
... | 0 | 10,742 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void VirtualKeyboardController::OnMaximizeModeEnded() {
if (!IsSmartVirtualKeyboardEnabled()) {
SetKeyboardEnabled(false);
} else {
UpdateKeyboardEnabled();
}
}
Commit Message: Move smart deploy to tristate.
BUG=
Review URL: https://codereview.chromium.org/1149383006
Cr-Commit-Position: refs/hea... | 0 | 9,152 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: soft_limit_tree_from_page(struct page *page)
{
int nid = page_to_nid(page);
int zid = page_zonenum(page);
return &soft_limit_tree.rb_tree_per_node[nid]->rb_tree_per_zone[zid];
}
Commit Message: mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
commit 1a5a9906d4e8d1976b701f889d8f35d5... | 0 | 26,898 |
Analyze the following 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 MagickBooleanType WriteVIFFImage(const ImageInfo *image_info,
Image *image,ExceptionInfo *exception)
{
#define VFF_CM_genericRGB 15
#define VFF_CM_NONE 0
#define VFF_DEP_IEEEORDER 0x2
#define VFF_DES_RAW 0
#define VFF_LOC_IMPLICIT 1
#define VFF_MAPTYP_NONE 0
#define VFF_MAPTYP_1_BYTE 1
#define VFF... | 0 | 62 |
Analyze the following 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 _yr_emit_inst_arg_uint32(
RE_EMIT_CONTEXT* emit_context,
uint8_t opcode,
uint32_t argument,
uint8_t** instruction_addr,
uint32_t** argument_addr,
size_t* code_size)
{
FAIL_ON_ERROR(yr_arena_write_data(
emit_context->arena,
&opcode,
sizeof(uint8_t),
(void**) in... | 0 | 9,160 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void TestDidNavigate(int page_id, const GURL& url) {
ViewHostMsg_FrameNavigate_Params params;
InitNavigateParams(¶ms, page_id, url, content::PAGE_TRANSITION_TYPED);
DidNavigate(GetRenderViewHostForTesting(), params);
}
Commit Message: Allow browser to handle all WebUI navigations.
BUG=113496... | 0 | 20,640 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: bool AXObject::isDetached() const {
return !m_axObjectCache;
}
Commit Message: Switch to equalIgnoringASCIICase throughout modules/accessibility
BUG=627682
Review-Url: https://codereview.chromium.org/2793913007
Cr-Commit-Position: refs/heads/master@{#461858}
CWE ID: CWE-254 | 0 | 21,781 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: OMX_ERRORTYPE omx_vdec::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
OMX_IN OMX_U32 port,
OMX_IN OMX_BUFFERHEADERTYPE* buffer)
{
OMX_ERRORTYPE eRet = OMX_ErrorNone;
unsigned int nPortIndex;
(void) hComp;
DEBUG_PRINT_LOW("In for decoder free_buffer");
if (m_state ==... | 0 | 26,220 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: bool HTMLFormControlElement::IsDisabledFormControl() const {
if (GetDocument().Fetcher()->Archive())
return true;
return IsActuallyDisabled();
}
Commit Message: autofocus: Fix a crash with an autofocus element in a document without browsing context.
ShouldAutofocus() should check existence of the brows... | 0 | 20,424 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h)
{
int c;
int x, y;
int tox, toy;
int i;
int colorMap[gdMaxColors];
if (dst->trueColor) {
/* 2.0: much easier when the destination is truecolor. */
/* 2.0.10: needs a transparent-index check that is s... | 0 | 25,953 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static ZIPARCHIVE_METHOD(setArchiveComment)
{
struct zip *intern;
zval *self = getThis();
size_t comment_len;
char * comment;
if (!self) {
RETURN_FALSE;
}
ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &comment, &comment_len) == FAILURE) {
return;
}
if (zip_set_arc... | 0 | 18,676 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: FoFiType1C::~FoFiType1C() {
int i;
if (name) {
delete name;
}
if (encoding &&
encoding != fofiType1StandardEncoding &&
encoding != fofiType1ExpertEncoding) {
for (i = 0; i < 256; ++i) {
gfree(encoding[i]);
}
gfree(encoding);
}
if (privateDicts) {
gfree(privateDic... | 0 | 6,573 |
Analyze the following 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 mboxlist_do_find(struct find_rock *rock, const strarray_t *patterns)
{
const char *userid = rock->userid;
int isadmin = rock->isadmin;
int crossdomains = config_getswitch(IMAPOPT_CROSSDOMAINS);
char inbox[MAX_MAILBOX_BUFFER];
size_t inboxlen = 0;
size_t prefixlen, len;
size... | 1 | 29,535 |
Analyze the following 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 UserSelectionScreen::Hide() {}
Commit Message: cros: Check initial auth type when showing views login.
Bug: 859611
Change-Id: I0298db9bbf4aed6bd40600aef2e1c5794e8cd058
Reviewed-on: https://chromium-review.googlesource.com/1123056
Reviewed-by: Xiaoyin Hu <xiaoyinh@chromium.org>
Commit-Queue: Jacob Dufault <... | 0 | 27,921 |
Analyze the following 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 AppShortcutManager::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
prefs::kAppShortcutsHaveBeenCreated, false,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
}
Commit Message: Remove --disable-app-shims.
App shims have been enabled ... | 0 | 28,225 |
Analyze the following 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 GpuCommandBufferStub::SendConsoleMessage(
int32 id,
const std::string& message) {
GPUCommandBufferConsoleMessage console_message;
console_message.id = id;
console_message.message = message;
IPC::Message* msg = new GpuCommandBufferMsg_ConsoleMsg(
route_id_, console_message);
msg->set_u... | 0 | 4,858 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: apr_status_t h2_session_process(h2_session *session, int async)
{
apr_status_t status = APR_SUCCESS;
conn_rec *c = session->c;
int rv, mpm_state, trace = APLOGctrace3(c);
if (trace) {
ap_log_cerror( APLOG_MARK, APLOG_TRACE3, status, c,
"h2_session(%ld): process start... | 0 | 1,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: void PDFiumEngine::SearchUsingICU(const base::string16& term,
bool case_sensitive,
bool first_search,
int character_to_start_searching_from,
int current_page) {
base::string16 ... | 0 | 26,291 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: MediaPlayerService::~MediaPlayerService()
{
ALOGV("MediaPlayerService destroyed");
}
Commit Message: MediaPlayerService: avoid invalid static cast
Bug: 30204103
Change-Id: Ie0dd3568a375f1e9fed8615ad3d85184bcc99028
(cherry picked from commit ee0a0e39acdcf8f97e0d6945c31ff36a06a36e9d)
CWE ID: CWE-264 | 0 | 7,849 |
Analyze the following 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 tg3_mdio_config_5785(struct tg3 *tp)
{
u32 val;
struct phy_device *phydev;
phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR];
switch (phydev->drv->phy_id & phydev->drv->phy_id_mask) {
case PHY_ID_BCM50610:
case PHY_ID_BCM50610M:
val = MAC_PHYCFG2_50610_LED_MODES;
break;
case PHY_ID_BCMAC131... | 0 | 8,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: int netif_set_xps_queue(struct net_device *dev, const struct cpumask *mask,
u16 index)
{
struct xps_dev_maps *dev_maps, *new_dev_maps = NULL;
int i, cpu, tci, numa_node_id = -2;
int maps_sz, num_tc = 1, tc = 0;
struct xps_map *map, *new_map;
bool active = false;
if (dev->num_tc) {
num_tc = dev->num_tc... | 0 | 24,167 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: SProcRenderCreateLinearGradient(ClientPtr client)
{
int len;
REQUEST(xRenderCreateLinearGradientReq);
REQUEST_AT_LEAST_SIZE(xRenderCreateLinearGradientReq);
swaps(&stuff->length);
swapl(&stuff->pid);
swapl(&stuff->p1.x);
swapl(&stuff->p1.y);
swapl(&stuff->p2.x);
swapl(&stuff-... | 0 | 7,797 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void DoReleaseShaderCompiler() { }
Commit Message: Revert "Revert 100494 - Fix bug in SimulateAttrib0."""
TEST=none
BUG=95625
TBR=apatrick@chromium.org
Review URL: http://codereview.chromium.org/7796016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100507 0039d316-1c4b-4281-b951-d872f2087c98
CWE ID: C... | 0 | 6,743 |
Analyze the following 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 InspectorController::willBeDestroyed()
{
disconnectFrontend();
m_injectedScriptManager->disconnect();
m_inspectorClient = 0;
m_page = 0;
m_instrumentingAgents->reset();
m_agents.discardAgents();
}
Commit Message: [4/4] Process clearBrowserCahce/cookies commands in browser.
BUG=36658... | 0 | 4,441 |
Analyze the following 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 sas_suspend_sata(struct asd_sas_port *port)
{
struct domain_device *dev;
mutex_lock(&port->ha->disco_mutex);
list_for_each_entry(dev, &port->dev_list, dev_list_node) {
struct sata_device *sata;
if (!dev_is_sata(dev))
continue;
sata = &dev->sata_dev;
if (sata->ap->pm_mesg.event == PM_EVENT_SU... | 0 | 4,785 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
unsigned int i, entries;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
sc = st->priv_data;
avio_r8(pb); /* version */
avio_rb24(pb... | 0 | 25,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: static void create_certinfo(struct curl_certinfo *ci, zval *listcode)
{
int i;
if (ci) {
zval certhash;
for (i=0; i<ci->num_of_certs; i++) {
struct curl_slist *slist;
array_init(&certhash);
for (slist = ci->certinfo[i]; slist; slist = slist->next) {
int len;
char s[64];
char *tmp;
... | 0 | 10,424 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int nfc_genl_dev_up(struct sk_buff *skb, struct genl_info *info)
{
struct nfc_dev *dev;
int rc;
u32 idx;
if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
return -EINVAL;
idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]);
dev = nfc_get_device(idx);
if (!dev)
return -ENODEV;
rc = nfc_dev_up(dev);... | 0 | 13,020 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: modification_init(png_modification *pmm)
{
memset(pmm, 0, sizeof *pmm);
pmm->next = NULL;
pmm->chunk = 0;
pmm->modify_fn = NULL;
pmm->add = 0;
modification_reset(pmm);
}
Commit Message: DO NOT MERGE Update libpng to 1.6.20
BUG:23265085
Change-Id: I85199805636d771f3597b691b63bc0bf46084833
(cher... | 0 | 29,020 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void WebContentsImpl::CancelModalDialogsForRenderManager() {
if (dialog_manager_)
dialog_manager_->ResetDialogState(this);
}
Commit Message: Don't call WebContents::DownloadImage() callback if the WebContents were deleted
BUG=583718
Review URL: https://codereview.chromium.org/1685343004
Cr-Commit-Positi... | 0 | 2,693 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static enum hrtimer_restart hlt_timer_fn(struct hrtimer *data)
{
struct kvm_vcpu *vcpu;
wait_queue_head_t *q;
vcpu = container_of(data, struct kvm_vcpu, arch.hlt_timer);
q = &vcpu->wq;
if (vcpu->arch.mp_state != KVM_MP_STATE_HALTED)
goto out;
if (waitqueue_active(q))
wake_up_interruptible(q);
out:
... | 0 | 24,130 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.