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: void open_modern(void) {
struct addrinfo hints;
struct addrinfo* ai = NULL;
struct sock_flags;
int e;
memset(&hints, '\0', sizeof(hints));
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
hints.ai_socktype = SOCK_STREAM;
hints.ai_family = AF_UNSPEC;
hints.ai_protocol = IPPROTO_TCP;
e = getaddrinfo(modern_l... | 0 | 18,439 |
Analyze the following 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 ShouldCoalesceMouseWheelEvents(const WebMouseWheelEvent& last_event,
const WebMouseWheelEvent& new_event) {
return last_event.modifiers == new_event.modifiers &&
last_event.scrollByPage == new_event.scrollByPage &&
last_event.hasPreciseScrollingDeltas
... | 0 | 114,714 |
Analyze the following 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 ghash_update(struct shash_desc *desc,
const u8 *src, unsigned int srclen)
{
struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
u8 *dst = dctx->buffer;
if (dctx->bytes) {
int n = min(srclen, dctx->bytes);
u8 *pos = dst + (GHASH_BLO... | 1 | 165,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: struct assoc_array_edit *assoc_array_clear(struct assoc_array *array,
const struct assoc_array_ops *ops)
{
struct assoc_array_edit *edit;
pr_devel("-->%s()\n", __func__);
if (!array->root)
return NULL;
edit = kzalloc(sizeof(struct assoc_array_edit), GFP_KERNEL);
if (!edit)
return ERR_PTR(-ENOM... | 0 | 37,692 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: String8 String8::formatV(const char* fmt, va_list args)
{
String8 result;
result.appendFormatV(fmt, args);
return result;
}
Commit Message: libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a hea... | 0 | 158,394 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static bool dev_type_flutter(enum sas_device_type new, enum sas_device_type old)
{
if (old == new)
return true;
/* treat device directed resets as flutter, if we went
* SAS_END_DEVICE to SAS_SATA_PENDING the link needs recovery
*/
if ((old == SAS_SATA_PENDING && new == SAS_END_DEVICE) ||
(old == SA... | 0 | 83,923 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void gdImageString (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color)
{
int i;
int l;
l = strlen ((char *) s);
for (i = 0; (i < l); i++) {
gdImageChar(im, f, x, y, s[i], color);
x += f->w;
}
}
Commit Message: iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() result... | 0 | 51,455 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: userauth_hostbased(struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
struct sshbuf *b;
struct sshkey *key = NULL;
char *pkalg, *cuser, *chost;
u_char *pkblob, *sig;
size_t alen, blen, slen;
int r, pktype, authenticated = 0;
if (!authctxt->valid) {
debug2("%s: disabled because of invalid user", ... | 1 | 169,105 |
Analyze the following 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 pfunc found_string(struct jv_parser* p) {
char* in = p->tokenbuf;
char* out = p->tokenbuf;
char* end = p->tokenbuf + p->tokenpos;
while (in < end) {
char c = *in++;
if (c == '\\') {
if (in >= end)
return "Expected escape character at end of string";
c = *in++;
swi... | 0 | 56,381 |
Analyze the following 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 LayerTreeHost::UpdateHudLayer() {
if (debug_state_.ShowHudInfo()) {
if (!hud_layer_.get())
hud_layer_ = HeadsUpDisplayLayer::Create();
if (root_layer_.get() && !hud_layer_->parent())
root_layer_->AddChild(hud_layer_);
} else if (hud_layer_.get()) {
hud_layer_->RemoveFromParent();... | 0 | 112,026 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: nsPluginInstance::getCmdLine(int hostfd, int controlfd)
{
std::vector<std::string> arg_vec;
std::string cmd = getGnashExecutable();
if (cmd.empty()) {
gnash::log_error("Failed to locate the Gnash executable!");
return arg_vec;
}
arg_vec.push_back(cmd);
arg_vec.push_back("... | 0 | 13,215 |
Analyze the following 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 log_error_doc(request * req)
{
int errno_save = errno;
char *escaped_pathname;
if (virtualhost) {
fprintf(stderr, "%s ", req->local_ip_addr);
} else if (vhost_root) {
fprintf(stderr, "%s ", (req->host ? req->host : "(null)"));
}
escaped_pathname = escape_pathname(req-... | 0 | 91,844 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: demote_sensitive_data(void)
{
Key *tmp;
int i;
for (i = 0; i < options.num_host_key_files; i++) {
if (sensitive_data.host_keys[i]) {
tmp = key_demote(sensitive_data.host_keys[i]);
key_free(sensitive_data.host_keys[i]);
sensitive_data.host_keys[i] = tmp;
}
/* Certs do not need demotion */
}
}
... | 0 | 72,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: void WebContentsImpl::OnEndColorChooser(int color_chooser_id) {
if (color_chooser_ &&
color_chooser_id == color_chooser_identifier_)
color_chooser_->End();
}
Commit Message: Cancel JavaScript dialogs when an interstitial appears.
BUG=295695
TEST=See bug for repro steps.
Review URL: https://chromium... | 0 | 110,724 |
Analyze the following 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 ChildProcessSecurityPolicyImpl::GrantReadRawCookies(int child_id) {
base::AutoLock lock(lock_);
SecurityStateMap::iterator state = security_state_.find(child_id);
if (state == security_state_.end())
return;
state->second->GrantReadRawCookies();
}
Commit Message: Apply missing kParentDirectory ... | 0 | 102,421 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: bgp_attr_origin (struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/* If any recognized attribute has Attribute Length that conflicts
with the expected length (based on the attribute type code), ... | 0 | 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: void Document::updateFocusAppearanceTimerFired(Timer<Document>*)
{
Node* node = focusedNode();
if (!node)
return;
if (!node->isElementNode())
return;
updateLayout();
Element* element = toElement(node);
if (element->isFocusable())
element->updateFocusAppearance(m_u... | 0 | 105,656 |
Analyze the following 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 qrio_gpio_direction_input(u8 port_off, u8 gpio_nr)
{
u32 direct, mask;
void __iomem *qrio_base = (void *)CONFIG_SYS_QRIO_BASE;
mask = 1U << gpio_nr;
direct = in_be32(qrio_base + port_off + DIRECT_OFF);
direct &= ~mask;
out_be32(qrio_base + port_off + DIRECT_OFF, direct);
}
Commit Message: Merge bra... | 0 | 89,281 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: mux_tty_alloc_failed(Channel *c)
{
Buffer m;
Channel *mux_chan;
debug3("%s: channel %d: TTY alloc failed", __func__, c->self);
if ((mux_chan = channel_by_id(c->ctl_chan)) == NULL)
fatal("%s: channel %d missing mux channel %d",
__func__, c->self, c->ctl_chan);
/* Append exit message packet to contr... | 0 | 15,548 |
Analyze the following 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 ShellWindow::RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest* request,
const content::MediaResponseCallback& callback) {
content::MediaStreamDevices devices;
content::MediaStreamDeviceMap::const_iterator iter =
request->devices.find(c... | 0 | 105,348 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: struct in_device *inetdev_by_index(struct net *net, int ifindex)
{
struct net_device *dev;
struct in_device *in_dev = NULL;
rcu_read_lock();
dev = dev_get_by_index_rcu(net, ifindex);
if (dev)
in_dev = rcu_dereference_rtnl(dev->ip_ptr);
rcu_read_unlock();
return in_dev;
}
Commit Message: ipv4: Don't do ... | 0 | 54,099 |
Analyze the following 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_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock,
bool *wait_flag, struct TCP_Server_Info *server)
{
if (flock->fl_flags & FL_POSIX)
cifs_dbg(FYI, "Posix\n");
if (flock->fl_flags & FL_FLOCK)
cifs_dbg(FYI, "Flock\n");
if (flock->fl_flags & FL_SLEEP) {
cifs_dbg(FYI, "Blocking ... | 0 | 40,000 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view,
scoped_ptr<Delegate> delegate)
: content::RenderViewObserver(render_view),
content::RenderViewObserverTracker<PrintWebViewHelper>(render_view),
reset_prep_frame_view_(false),
is_pr... | 1 | 171,878 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: Browser* Browser::CreateForApp(Type type,
const std::string& app_name,
const gfx::Rect& window_bounds,
Profile* profile) {
DCHECK(type != TYPE_TABBED);
DCHECK(!app_name.empty());
RegisterAppPrefs(app_name, profile)... | 0 | 97,174 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: config_test_exit(void)
{
config_err_t config_err = get_config_status();
switch (config_err) {
case CONFIG_OK:
exit(KEEPALIVED_EXIT_OK);
case CONFIG_FILE_NOT_FOUND:
case CONFIG_BAD_IF:
case CONFIG_FATAL:
exit(KEEPALIVED_EXIT_CONFIG);
case CONFIG_SECURITY_ERROR:
exit(KEEPALIVED_EXIT_CONFIG_TEST_SECURI... | 0 | 75,890 |
Analyze the following 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 OnOfflinePageAcquireFileAccessPermissionDone(
const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter,
const ScopedJavaGlobalRef<jobject>& j_tab_ref,
const std::string& origin,
bool granted) {
if (!granted)
return;
content::WebContents* web_contents = web_contents_... | 0 | 124,642 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static inline void byte2char(const char* data, char** str)
{
**str = *data < ' ' ? '.' : *data > '~' ? '.' : *data;
++(*str);
}
Commit Message: DO NOT MERGE Fix potential DoS caused by delivering signal to BT process
Bug: 28885210
Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360
Conflicts:
btif/co/bta_... | 0 | 158,914 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: v8::Handle<v8::Value> V8WebGLRenderingContext::getProgramParameterCallback(const v8::Arguments& args)
{
INC_STATS("DOM.WebGLRenderingContext.getProgramParameter()");
if (args.Length() != 2)
return V8Proxy::throwNotEnoughArgumentsError();
ExceptionCode ec = 0;
WebGLRenderingContext*... | 1 | 171,125 |
Analyze the following 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 vpx_img_free(vpx_image_t *img) {
if (img) {
if (img->img_data && img->img_data_owner) vpx_free(img->img_data);
if (img->self_allocd) free(img);
}
}
Commit Message: DO NOT MERGE | libvpx: Fix OOB caused by odd frame width.
Keep behaviors unchanged without external allocation.
Bug: b/64710201
Test: poc... | 0 | 163,297 |
Analyze the following 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 _notify_slurmctld_prolog_fini(
uint32_t job_id, uint32_t prolog_return_code)
{
int rc;
slurm_msg_t req_msg;
complete_prolog_msg_t req;
slurm_msg_t_init(&req_msg);
req.job_id = job_id;
req.prolog_rc = prolog_return_code;
req_msg.msg_type= REQUEST_COMPLETE_PROLOG;
req_msg.data = &req;
if ((... | 0 | 72,099 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: size_t ZSTD_compressContinue (ZSTD_CCtx* cctx,
void* dst, size_t dstCapacity,
const void* src, size_t srcSize)
{
DEBUGLOG(5, "ZSTD_compressContinue (srcSize=%u)", (U32)srcSize);
return ZSTD_compressContinue_internal(cctx, dst, dstCapacity, src, srcSize... | 0 | 90,018 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: gs_errorinfo_put_string(i_ctx_t *i_ctx_p, const char *str)
{
ref rstr;
ref *pderror;
int code = string_to_ref(str, &rstr, iimemory, "gs_errorinfo_put_string");
if (code < 0)
return code;
if (dict_find_string(systemdict, "$error", &pderror) <= 0 ||
!r_has_type(pderror, t_dictio... | 0 | 2,875 |
Analyze the following 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(RenderFrameHostImpl* render_frame_host,
blink::mojom::FileChooserRequest request) {
mojo::MakeStrongBinding(
std::make_unique<FileChooserImpl>(render_frame_host),
std::move(request));
}
Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to ... | 0 | 139,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: int read_image_tga( gdIOCtx *ctx, oTga *tga )
{
int pixel_block_size = (tga->bits / 8);
int image_block_size = (tga->width * tga->height) * pixel_block_size;
uint8_t* decompression_buffer = NULL;
unsigned char* conversion_buffer = NULL;
int buffer_caret = 0;
int bitmap_caret = 0;
int i = 0;
int j = 0;
ui... | 0 | 50,917 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void webkitWebViewBaseExitFullScreen(WebKitWebViewBase* webkitWebViewBase)
{
#if ENABLE(FULLSCREEN_API)
WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
if (!priv->fullScreenModeActive)
return;
if (!priv->fullScreenClient.willExitFullScreen())
return;
WebFullScreenManage... | 0 | 108,878 |
Analyze the following 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 LargeObjectPage::sweep() {
heapObjectHeader()->unmark();
arena()->getThreadState()->increaseMarkedObjectSize(size());
}
Commit Message: Call HeapObjectHeader::checkHeader solely for its side-effect.
This requires changing its signature. This is a preliminary stage to making it
private.
BUG=633030
Rev... | 0 | 147,588 |
Analyze the following 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 vapic_enable(VAPICROMState *s, X86CPU *cpu)
{
int cpu_number = get_kpcr_number(cpu);
hwaddr vapic_paddr;
static const uint8_t enabled = 1;
if (cpu_number < 0) {
return -1;
}
vapic_paddr = s->vapic_paddr +
(((hwaddr)cpu_number) << VAPIC_CPU_SHIFT);
cpu_physic... | 0 | 11,262 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void RenderWidgetHostImpl::SetIsLoading(bool is_loading) {
if (owner_delegate_)
owner_delegate_->RenderWidgetWillSetIsLoading(is_loading);
is_loading_ = is_loading;
if (view_)
view_->SetIsLoading(is_loading);
}
Commit Message: Check that RWHI isn't deleted manually while owned by a scoped_ptr in R... | 0 | 131,032 |
Analyze the following 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 RenderFrameHostImpl::IsSameSiteInstance(
RenderFrameHostImpl* other_render_frame_host) {
CHECK_EQ(GetSiteInstance()->GetBrowserContext(),
other_render_frame_host->GetSiteInstance()->GetBrowserContext());
return GetSiteInstance() == other_render_frame_host->GetSiteInstance();
}
Commit Mess... | 0 | 127,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: static struct fwnet_fragment_info *fwnet_frag_new(
struct fwnet_partial_datagram *pd, unsigned offset, unsigned len)
{
struct fwnet_fragment_info *fi, *fi2, *new;
struct list_head *list;
list = &pd->fi_list;
list_for_each_entry(fi, &pd->fi_list, fi_link) {
if (fi->offset + fi->len == offset) {
/* The n... | 0 | 49,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: static int sysfs_slab_add(struct kmem_cache *s)
{
int err;
const char *name;
int unmergeable;
if (slab_state < SYSFS)
/* Defer until later */
return 0;
unmergeable = slab_unmergeable(s);
if (unmergeable) {
/*
* Slabcache can never be merged so we can use the name proper.
* This is typically th... | 0 | 24,930 |
Analyze the following 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 lodepng_decoder_settings_init(LodePNGDecoderSettings* settings)
{
settings->color_convert = 1;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
settings->read_text_chunks = 1;
settings->remember_unknown_chunks = 0;
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
settings->ignore_crc = 0;
lodepng_decompress_sett... | 0 | 87,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: static void ohci_set_hub_status(OHCIState *ohci, uint32_t val)
{
uint32_t old_state;
old_state = ohci->rhstatus;
/* write 1 to clear OCIC */
if (val & OHCI_RHS_OCIC)
ohci->rhstatus &= ~OHCI_RHS_OCIC;
if (val & OHCI_RHS_LPS) {
int i;
for (i = 0; i < ohci->num_ports; ... | 0 | 5,940 |
Analyze the following 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 ReturnsInvalidPath(int dir_type) {
base::FilePath path;
bool result = PathService::Get(dir_type, &path);
return !result && path.empty();
}
Commit Message: Fix OS_MACOS typos. Should be OS_MACOSX.
BUG=163208
TEST=none
Review URL: https://codereview.chromium.org/12829005
git-svn-id: svn://svn.chromiu... | 0 | 118,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: MagickExport BlobInfo *CloneBlobInfo(const BlobInfo *blob_info)
{
BlobInfo
*clone_info;
SemaphoreInfo
*semaphore;
clone_info=(BlobInfo *) AcquireCriticalMemory(sizeof(*clone_info));
GetBlobInfo(clone_info);
if (blob_info == (BlobInfo *) NULL)
return(clone_info);
semaphore=clone_info->sem... | 0 | 96,628 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void Label::OnPaint(gfx::Canvas* canvas) {
OnPaintBackground(canvas);
std::wstring paint_text;
gfx::Rect text_bounds;
int flags = 0;
CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
PaintText(canvas, paint_text, text_bounds, flags);
}
Commit Message: wstring: remove wstring version of S... | 0 | 100,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: int X509_REQ_extension_nid(int req_nid)
{
int i, nid;
for (i = 0;; i++) {
nid = ext_nids[i];
if (nid == NID_undef)
return 0;
else if (req_nid == nid)
return 1;
}
}
Commit Message:
CWE ID: | 0 | 6,203 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer)
{
int sector_size;
struct scsi_device *sdp = sdkp->device;
sector_t old_capacity = sdkp->capacity;
if (sd_try_rc16_first(sdp)) {
sector_size = read_capacity_16(sdkp, sdp, buffer);
if (sector_size == -EOVERFLOW)
goto got_data;
if (sector... | 0 | 94,405 |
Analyze the following 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 RenderBlockFlow::isSelfCollapsingBlock() const
{
m_hasOnlySelfCollapsingChildren = RenderBlock::isSelfCollapsingBlock();
return m_hasOnlySelfCollapsingChildren;
}
Commit Message: Separate repaint and layout requirements of StyleDifference (Step 1)
Previously StyleDifference was an enum that proxima... | 0 | 116,377 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: BluetoothDeviceChromeOS::BluetoothDeviceChromeOS(
BluetoothAdapterChromeOS* adapter,
const dbus::ObjectPath& object_path)
: adapter_(adapter),
object_path_(object_path),
num_connecting_calls_(0),
pairing_delegate_(NULL),
pairing_delegate_used_(false),
weak_ptr_factory... | 1 | 171,217 |
Analyze the following 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 CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
int i, type;
char info[MAX_INFO_STRING];
char *infoString;
int prot;
char *gamename;
qboolean gameMismatch;
infoString = MSG_ReadString( msg );
gamename = Info_ValueForKey( infoString, "gamename" );
#ifdef LEGACY_PROTOCOL
if (com_legacyprotocol... | 0 | 95,987 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: V8Extensions& ScriptController::registeredExtensions()
{
DEFINE_STATIC_LOCAL(V8Extensions, extensions, ());
return extensions;
}
Commit Message: Call didAccessInitialDocument when javascript: URLs are used.
BUG=265221
TEST=See bug for repro.
Review URL: https://chromiumcodereview.appspot.com/22572004
... | 0 | 111,232 |
Analyze the following 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 cr8_write_interception(struct vcpu_svm *svm)
{
struct kvm_run *kvm_run = svm->vcpu.run;
int r;
u8 cr8_prev = kvm_get_cr8(&svm->vcpu);
/* instruction emulation calls kvm_set_cr8() */
r = cr_interception(svm);
if (irqchip_in_kernel(svm->vcpu.kvm))
return r;
if (cr8_prev <= kvm_get_cr8(&svm->vcp... | 0 | 37,745 |
Analyze the following 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 kill_proc_info(int sig, struct siginfo *info, pid_t pid)
{
int error;
rcu_read_lock();
error = kill_pid_info(sig, info, find_vpid(pid));
rcu_read_unlock();
return error;
}
Commit Message: kernel/signal.c: stop info leak via the tkill and the tgkill syscalls
This fixes a kernel memory contents leak via ... | 0 | 31,773 |
Analyze the following 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 SVGElement::SetAnimatedAttribute(const QualifiedName& attribute,
SVGPropertyBase* value) {
ForSelfAndInstances(this, [&attribute, &value](SVGElement* element) {
if (SVGAnimatedPropertyBase* animated_property =
element->PropertyFromAttribute(attribute))
... | 0 | 152,794 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: MODRET set_allowemptypasswords(cmd_rec *cmd) {
int allow_empty_passwords = -1;
config_rec *c = NULL;
CHECK_ARGS(cmd, 1);
CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL|CONF_ANON);
allow_empty_passwords = get_boolean(cmd, 1);
if (allow_empty_passwords == -1) {
CONF_ERROR(cmd, "expected Boolea... | 0 | 67,605 |
Analyze the following 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(pg_last_oid)
{
zval *result;
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
#ifdef HAVE_PQOIDVALUE
Oid oid;
#endif
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "Postgre... | 0 | 14,729 |
Analyze the following 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(size_t size, OMX_U32 portIndex)
: mSize(size),
mIsBackup(false),
mPortIndex(portIndex) {
}
Commit Message: DO NOT MERGE: IOMX: work against metadata buffer spoofing
- Prohibit direct set/getParam/Settings for extensions meant for
OMXNodeInstance alone. This di... | 1 | 174,125 |
Analyze the following 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 net_checksum_tcpudp(uint16_t length, uint16_t proto,
uint8_t *addrs, uint8_t *buf)
{
uint32_t sum = 0;
sum += net_checksum_add(length, buf); // payload
sum += net_checksum_add(8, addrs); // src + dst address
sum += proto + length; ... | 0 | 12,563 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void bte_search_devices_evt(tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH *p_data)
{
UINT16 param_len = 0;
if (p_data)
param_len += sizeof(tBTA_DM_SEARCH);
/* Allocate buffer to hold the pointers (deep copy). The pointers will point to the end of the tBTA_DM_SEARCH */
switch (event)
{
case BTA... | 0 | 158,569 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: extractContigSamplesToBuffer(uint8 *out, uint8 *in, uint32 rows, uint32 cols,
tsample_t sample, uint16 spp, uint16 bps,
struct dump_opts *dump)
{
int shift_width, bytes_per_sample, bytes_per_pixel;
uint32 src_rowsize, src_offset, row, first_col = 0;
... | 0 | 48,255 |
Analyze the following 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 PrintingMessageFilter::OnUpdatePrintSettings(
int document_cookie, const DictionaryValue& job_settings,
IPC::Message* reply_msg) {
scoped_refptr<printing::PrinterQuery> printer_query;
print_job_manager_->PopPrinterQuery(document_cookie, &printer_query);
if (printer_query.get()) {
Cancela... | 1 | 170,255 |
Analyze the following 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 IsDeletedValue(
const blink::incremental_marking_test::StrongWeakPair& value) {
return value.IsHashTableDeletedValue();
}
Commit Message: [oilpan] Fix GCInfoTable for multiple threads
Previously, grow and access from different threads could lead to a race
on the table backing; see bug.... | 0 | 153,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: void smp_both_have_public_keys(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
SMP_TRACE_DEBUG("%s", __func__);
/* invokes DHKey computation */
smp_compute_dhkey(p_cb);
/* on slave side invokes sending local public key to the peer */
if (p_cb->role == HCI_ROLE_SLAVE) smp_send_pair_public_key(p_cb, NULL);
smp_... | 0 | 162,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 int open_collection(struct hid_parser *parser, unsigned type)
{
struct hid_collection *collection;
unsigned usage;
usage = parser->local.usage[0];
if (parser->collection_stack_ptr == HID_COLLECTION_STACK_SIZE) {
hid_err(parser->device, "collection stack overflow\n");
return -EINVAL;
}
if (pars... | 0 | 49,529 |
Analyze the following 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 thumb2_break_trap(struct pt_regs *regs, unsigned int instr)
{
unsigned int instr2;
void __user *pc;
/* Check the second half of the instruction. */
pc = (void __user *)(instruction_pointer(regs) + 2);
if (processor_mode(regs) == SVC_MODE) {
instr2 = *(u16 *) pc;
} else {
get_user(instr2, (... | 0 | 25,339 |
Analyze the following 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_Box *trep_New()
{
ISOM_DECL_BOX_ALLOC(GF_TrackExtensionPropertiesBox, GF_ISOM_BOX_TYPE_TREP);
tmp->other_boxes = gf_list_new();
return (GF_Box *)tmp;
}
Commit Message: fixed 2 possible heap overflows (inc. #1088)
CWE ID: CWE-125 | 0 | 80,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: static void xhci_alloc_streams(XHCIEPContext *epctx, dma_addr_t base)
{
assert(epctx->pstreams == NULL);
epctx->nr_pstreams = 2 << epctx->max_pstreams;
epctx->pstreams = xhci_alloc_stream_contexts(epctx->nr_pstreams, base);
}
Commit Message:
CWE ID: CWE-835 | 0 | 5,682 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: string16 OutdatedPluginInfoBarDelegate::GetButtonLabel(
InfoBarButton button) const {
return l10n_util::GetStringUTF16((button == BUTTON_OK) ?
IDS_PLUGIN_UPDATE : IDS_PLUGIN_ENABLE_TEMPORARILY);
}
Commit Message: Infobar Windows Media Player plug-in by default.
BUG=51464
Review URL: http://coderevie... | 0 | 97,950 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
struct nlattr **tb, struct sk_buff *skb, int dir)
{
struct nlattr *pg_nest, *param_nest, *data;
struct nlattr *pg_tb[DCB_PG_ATTR_MAX + 1];
struct nlattr *param_tb[DCB_TC_ATTR_PARAM_MAX + 1];
u8 prio, pgid, tc_pct, up_map;
i... | 0 | 31,075 |
Analyze the following 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 kvm_vcpu_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
struct kvm_vcpu *vcpu = vma->vm_file->private_data;
struct page *page;
if (vmf->pgoff == 0)
page = virt_to_page(vcpu->run);
#ifdef CONFIG_X86
else if (vmf->pgoff == KVM_PIO_PAGE_OFFSET)
page = virt_to_page(vcpu->arch.pio_data);... | 0 | 29,099 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: PP_Bool IsMainThread() {
return BoolToPPBool(GetMainThreadMessageLoop()->BelongsToCurrentThread());
}
Commit Message: Revert 143656 - Add an IPC channel between the NaCl loader process and the renderer.
BUG=116317
TEST=ppapi, nacl tests, manual testing for experimental IPC proxy.
Review URL: https://chromiumco... | 0 | 103,436 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static long inotify_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
struct fsnotify_group *group;
struct fsnotify_event_holder *holder;
struct fsnotify_event *event;
void __user *p;
int ret = -ENOTTY;
size_t send_len = 0;
group = file->private_data;
p = (void __user *) arg;
pr_debu... | 0 | 27,544 |
Analyze the following 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::OnGetEntryInfoCompleteForGetFileByPath(
const FilePath& file_path,
const GetFileCallback& get_file_callback,
const GetDownloadDataCallback& get_download_data_callback,
GDataFileError error,
scoped_ptr<GDataEntryProto> entry_proto) {
DCHECK(BrowserThread::CurrentlyOn(Bro... | 0 | 116,992 |
Analyze the following 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 DeviceTokenFetcher::DoWork() {
switch (state_) {
case STATE_INACTIVE:
case STATE_TOKEN_AVAILABLE:
break;
case STATE_UNMANAGED:
case STATE_ERROR:
case STATE_TEMPORARY_ERROR:
case STATE_BAD_AUTH:
FetchTokenInternal();
break;
}
}
Commit Message: Reset the device po... | 0 | 97,786 |
Analyze the following 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 OxideQQuickWebView::prepareToClose() {
Q_D(OxideQQuickWebView);
if (!d->proxy_) {
QCoreApplication::postEvent(this,
new QEvent(GetPrepareToCloseBypassEventType()));
return;
}
d->proxy_->prepareToClose();
}
Commit Message:
CWE ID: CWE-20 | 0 | 17,146 |
Analyze the following 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_check_file(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfs4_stid *s,
struct file **filpp, bool *tmp_file, int flags)
{
int acc = (flags & RD_STATE) ? NFSD_MAY_READ : NFSD_MAY_WRITE;
struct file *file;
__be32 status;
file = nfs4_find_file(s, flags);
if (file) {
status = nfsd_permission(rqstp,... | 0 | 65,509 |
Analyze the following 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 inet_init(void)
{
struct sk_buff *dummy_skb;
struct inet_protosw *q;
struct list_head *r;
int rc = -EINVAL;
BUILD_BUG_ON(sizeof(struct inet_skb_parm) > sizeof(dummy_skb->cb));
sysctl_local_reserved_ports = kzalloc(65536 / 8, GFP_KERNEL);
if (!sysctl_local_reserved_ports)
goto out;
r... | 0 | 18,788 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: content::BrowserPluginGuestManager* WebRunnerBrowserContext::GetGuestManager() {
return nullptr;
}
Commit Message: [fuchsia] Implement browser tests for WebRunner Context service.
Tests may interact with the WebRunner FIDL services and the underlying
browser objects for end to end testing of service and brows... | 0 | 131,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: static const char *create_index(void)
{
const char *tmpfile;
struct pack_idx_entry **idx, **c, **last;
struct object_entry *e;
struct object_entry_pool *o;
/* Build the table of object IDs. */
idx = xmalloc(object_count * sizeof(*idx));
c = idx;
for (o = blocks; o; o = o->next_pool)
for (e = o->next_fr... | 0 | 55,056 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static u64 maybe_change_configuration(struct cpu_hw_events *cpuc, u64 pcr)
{
int i;
if (!cpuc->n_added)
goto out;
/* Read in the counters which are moving. */
for (i = 0; i < cpuc->n_events; i++) {
struct perf_event *cp = cpuc->event[i];
if (cpuc->current_idx[i] != PIC_NO_INDEX &&
cpuc->curren... | 0 | 25,643 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void reflectedIdAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
TestObjectPythonV8Internal::refl... | 0 | 122,604 |
Analyze the following 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 WeakDocumentSet& liveDocumentSet() {
DEFINE_STATIC_LOCAL(blink::Persistent<WeakDocumentSet>, set,
(blink::MakeGarbageCollected<WeakDocumentSet>()));
return *set;
}
Commit Message: Cleanup and remove dead code in SetFocusedElement
This early-out was added in:
https://crrev.com/c... | 0 | 129,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: int ssl3_accept(SSL *s)
{
BUF_MEM *buf;
unsigned long alg_k, Time = (unsigned long)time(NULL);
void (*cb) (const SSL *ssl, int type, int val) = NULL;
int ret = -1;
int new_state, state, skip = 0;
RAND_add(&Time, sizeof(Time), 0);
ERR_clear_error();
clear_sys_error();
if (s->i... | 0 | 3,591 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: file_ms_free(struct magic_set *ms)
{
size_t i;
if (ms == NULL)
return;
for (i = 0; i < MAGIC_SETS; i++)
mlist_free(ms->mlist[i]);
free(ms->o.pbuf);
free(ms->o.buf);
free(ms->c.li);
free(ms);
}
Commit Message: * Enforce limit of 8K on regex searches that have no limits
* Allow the l modifier for regex ... | 0 | 37,966 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void user_ta_enter_close_session(struct tee_ta_session *s)
{
TEE_ErrorOrigin eo;
struct tee_ta_param param = { 0 };
user_ta_enter(&eo, s, UTEE_ENTRY_FUNC_CLOSE_SESSION, 0, ¶m);
}
Commit Message: core: clear the entire TA area
Previously we cleared (memset to zero) the size corresponding to code
a... | 0 | 86,959 |
Analyze the following 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(imagesetthickness)
{
zval *IM;
long thick;
gdImagePtr im;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &thick) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
gdImageSetThickness(im, thick);
RETURN_TRUE;
}
Commit Message:
CWE ID... | 0 | 15,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: PDFiumEngine::SelectionChangeInvalidator::~SelectionChangeInvalidator() {
pp::Point offset = previous_origin_ - engine_->GetVisibleRect().point();
for (auto& old_selection : old_selections_)
old_selection.Offset(offset);
std::vector<pp::Rect> new_selections;
GetVisibleSelectionsScreenRects(&new_selec... | 0 | 140,447 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: drop_connection(int startups)
{
int p, r;
if (startups < options.max_startups_begin)
return 0;
if (startups >= options.max_startups)
return 1;
if (options.max_startups_rate == 100)
return 1;
p = 100 - options.max_startups_rate;
p *= startups - options.max_startups_begin;
p /= options.max_startups ... | 0 | 72,278 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: gst_asf_demux_check_header (GstASFDemux * demux)
{
AsfObject obj;
guint8 *cdata = (guint8 *) gst_adapter_map (demux->adapter,
ASF_OBJECT_HEADER_SIZE);
if (cdata == NULL) /* need more data */
return GST_ASF_DEMUX_CHECK_HEADER_NEED_DATA;
if (asf_demux_peek_object (demux, cdata, ASF_OBJ... | 0 | 68,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: invoke_NPN_GetProperty(PluginInstance *plugin, NPObject *npobj, NPIdentifier propertyName,
NPVariant *result)
{
npw_return_val_if_fail(rpc_method_invoke_possible(g_rpc_connection), false);
int error = rpc_method_invoke(g_rpc_connection,
RPC_METHOD_NPN_GET_PROPERTY,
RPC_TYPE_NPW_PLUGIN... | 0 | 27,117 |
Analyze the following 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 ShouldTrackProcessForSite(BrowserContext* browser_context,
RenderProcessHost* render_process_host,
const GURL& site_url) {
if (site_url.is_empty())
return false;
return ShouldUseSiteProcessTracking(
browser_context, render_process_h... | 0 | 149,334 |
Analyze the following 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 V8Window::eventAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
{
LocalFrame* frame = toLocalDOMWindow(V8Window::toImpl(info.Holder()))->frame();
ExceptionState exceptionState(ExceptionState::GetterContext, "event", "Window", info.Holder(), info.GetIsolate());
if (!BindingSe... | 0 | 129,070 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int __alloc_gigantic_page(unsigned long start_pfn,
unsigned long nr_pages, gfp_t gfp_mask)
{
unsigned long end_pfn = start_pfn + nr_pages;
return alloc_contig_range(start_pfn, end_pfn, MIGRATE_MOVABLE,
gfp_mask);
}
Commit Message: userfaultfd: hugetlbfs: prevent UFFDIO_COPY to fill beyond the ... | 0 | 86,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: PS_SERIALIZER_ENCODE_FUNC(php) /* {{{ */
{
smart_str buf = {0};
php_serialize_data_t var_hash;
PS_ENCODE_VARS;
PHP_VAR_SERIALIZE_INIT(var_hash);
PS_ENCODE_LOOP(
smart_str_appendl(&buf, key, key_length);
if (memchr(key, PS_DELIMITER, key_length) || memchr(key, PS_UNDEF_MARKER, key_length)) {
PHP_V... | 0 | 9,611 |
Analyze the following 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 _nohz_idle_balance(struct rq *this_rq, unsigned int flags,
enum cpu_idle_type idle)
{
/* Earliest time when we have to do rebalance again */
unsigned long now = jiffies;
unsigned long next_balance = now + 60*HZ;
bool has_blocked_load = false;
int update_next_balance = 0;
int this_cpu =... | 0 | 92,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: ~DBusServices() {
CertLibrary::Shutdown();
NetworkHandler::Shutdown();
cryptohome::AsyncMethodCaller::Shutdown();
disks::DiskMountManager::Shutdown();
LoginState::Shutdown();
CertLoader::Shutdown();
TPMTokenLoader::Shutdown();
proxy_resolution_service_.reset();
kiosk_info_ser... | 0 | 124,057 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: MediaStreamVideoRenderer::RepaintCB GetRepaintCallback() {
return base::Bind(&FrameDeliverer::OnVideoFrame,
weak_factory_.GetWeakPtr());
}
Commit Message: Simplify "WouldTaintOrigin" concept in media/blink
Currently WebMediaPlayer has three predicates:
- DidGetOpaqueResponseFromSe... | 0 | 144,150 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: psf_f2i_clip_array (const float *src, int *dest, int count, int normalize)
{ float normfact, scaled_value ;
normfact = normalize ? (8.0 * 0x10000000) : 1.0 ;
while (--count >= 0)
{ scaled_value = src [count] * normfact ;
if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF))
{ dest [count] ... | 0 | 95,331 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: server_set_name (server *serv, char *name)
{
GSList *list = sess_list;
session *sess;
if (name[0] == 0)
name = serv->hostname;
/* strncpy parameters must NOT overlap */
if (name != serv->servername)
{
safe_strcpy (serv->servername, name, sizeof (serv->servername));
}
while (list)
{
sess = (sessi... | 0 | 58,459 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.