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: session_break_req(Session *s)
{
packet_get_int(); /* ignored */
packet_check_eom();
if (s->ptymaster == -1 || tcsendbreak(s->ptymaster, 0) < 0)
return 0;
return 1;
}
Commit Message:
CWE ID: CWE-264 | 0 | 14,402 |
Analyze the following 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::GrantCommitOrigin(
int child_id,
const url::Origin& origin) {
base::AutoLock lock(lock_);
SecurityStateMap::iterator state = security_state_.find(child_id);
if (state == security_state_.end())
return;
state->second->GrantCommitOrigin(origin);
}
Commit Me... | 0 | 143,728 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void IndexedDBDispatcher::OnError(int32 thread_id, int32 response_id, int code,
const string16& message) {
DCHECK_EQ(thread_id, CurrentWorkerId());
WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id);
if (!callbacks)
return;
callbacks->onError(WebIDBDa... | 0 | 108,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: SameDocumentCommitObserver(WebContents* web_contents)
: WebContentsObserver(web_contents),
message_loop_runner_(new MessageLoopRunner) {
EXPECT_TRUE(web_contents);
}
Commit Message: Avoid sharing process for blob URLs with null origin.
Previously, when a frame with a unique origin, such as... | 0 | 154,566 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: IW_IMPL(int) iw_imgtype_num_channels(int t)
{
switch(t) {
case IW_IMGTYPE_RGBA:
return 4;
case IW_IMGTYPE_RGB:
return 3;
case IW_IMGTYPE_GRAYA:
return 2;
}
return 1;
}
Commit Message: Double-check that the input image's density is valid
Fixes a bug that could result in division by zero, at least for... | 0 | 64,973 |
Analyze the following 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 kvm_arch_hardware_enable(void)
{
struct kvm *kvm;
struct kvm_vcpu *vcpu;
int i;
int ret;
u64 local_tsc;
u64 max_tsc = 0;
bool stable, backwards_tsc = false;
kvm_shared_msr_cpu_online();
ret = kvm_x86_ops->hardware_enable();
if (ret != 0)
return ret;
local_tsc = rdtsc();
stable = !check_tsc_uns... | 0 | 57,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: static void gen_challenge(const char *addr, char *challenge)
{
char input[32];
char digest[MAX_DIGEST_LEN];
struct timeval tv;
int len;
memset(input, 0, sizeof input);
strlcpy(input, addr, 17);
sys_gettimeofday(&tv);
SIVAL(input, 16, tv.tv_sec);
SIVAL(input, 20, tv.tv_usec);
SIVAL(input, 24, getpid())... | 0 | 12,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: hook_remove_from_list (struct t_hook *hook)
{
struct t_hook *new_hooks;
int type;
type = hook->type;
if (last_weechat_hook[hook->type] == hook)
last_weechat_hook[hook->type] = hook->prev_hook;
if (hook->prev_hook)
{
(hook->prev_hook)->next_hook = hook->next_hook;
... | 0 | 3,437 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: bool GLES2DecoderImpl::IsDrawValid(
const char* function_name, GLuint max_vertex_accessed, GLsizei primcount) {
if (!current_program_) {
RenderWarning("Drawing with no current shader program.");
return false;
}
bool divisor0 = false;
const VertexAttribManager::VertexAttribInfoList& infos =
... | 0 | 103,664 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: clean_cell_pool(void)
{
tor_assert(cell_pool);
mp_pool_clean(cell_pool, 0, 1);
}
Commit Message: TROVE-2017-005: Fix assertion failure in connection_edge_process_relay_cell
On an hidden service rendezvous circuit, a BEGIN_DIR could be sent
(maliciously) which would trigger a tor_assert() because
connection_... | 0 | 69,851 |
Analyze the following 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 GLManager::SetGpuControlClient(GpuControlClient*) {
}
Commit Message: Fix tabs sharing TEXTURE_2D_ARRAY/TEXTURE_3D data.
In linux and android, we are seeing an issue where texture data from one
tab overwrites the texture data of another tab. This is happening for apps
which are using webgl2 texture of type... | 0 | 150,058 |
Analyze the following 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 local_opendir(FsContext *ctx,
V9fsPath *fs_path, V9fsFidOpenState *fs)
{
int dirfd;
DIR *stream;
dirfd = local_opendir_nofollow(ctx, fs_path->data);
if (dirfd == -1) {
return -1;
}
stream = fdopendir(dirfd);
if (!stream) {
close(dir... | 0 | 17,867 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: sctp_disposition_t sctp_sf_cookie_wait_prm_shutdown(
struct net *net,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
{
sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT));
sctp_add_cmd... | 0 | 31,576 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: std::string ConvertViewIntToViewString(unsigned long view_int) {
switch (view_int) {
case PDFDEST_VIEW_XYZ:
return "XYZ";
case PDFDEST_VIEW_FIT:
return "Fit";
case PDFDEST_VIEW_FITH:
return "FitH";
case PDFDEST_VIEW_FITV:
return "FitV";
case PDFDEST_VIEW_FITR:
r... | 0 | 147,388 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: parse_cosine_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf,
char *line, int *err, gchar **err_info)
{
union wtap_pseudo_header *pseudo_header = &phdr->pseudo_header;
int num_items_scanned;
int yy, mm, dd, hr, min, sec, csec;
guint pkt_len;
int pro, off, pri, rm, error;
guint code1, code2;... | 1 | 167,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: void FrameLoader::StartLoad(FrameLoadRequest& frame_load_request,
FrameLoadType type,
NavigationPolicy navigation_policy,
HistoryItem* history_item,
bool check_with_client) {
DCHECK(Client()->HasWebVi... | 0 | 154,774 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static void init_skiplist(struct fsck_options *options, const char *path)
{
static struct oid_array skiplist = OID_ARRAY_INIT;
int sorted, fd;
char buffer[GIT_MAX_HEXSZ + 1];
struct object_id oid;
if (options->skiplist)
sorted = options->skiplist->sorted;
else {
sorted = 1;
options->skiplist = &skipl... | 0 | 76,619 |
Analyze the following 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 ASF_LegacyManager::ComputeDigest()
{
MD5_CTX context;
MD5_Digest digest;
char buffer[40];
MD5Init ( &context );
digestStr.clear();
digestStr.reserve ( 160 );
for ( int type=0; type < fieldLast; ++type ) {
if (fields[type].size ( ) > 0 ) {
snprintf ( buffer, sizeof(buffer), "%d,", type );
di... | 0 | 15,911 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: RenderFrameHostImpl::BuildNavigationClientCommitNavigationCallback(
NavigationRequest* navigation_request) {
DCHECK(navigation_request);
return base::BindOnce(
&RenderFrameHostImpl::DidCommitPerNavigationMojoInterfaceNavigation,
base::Unretained(this), navigation_request);
}
Commit Message: C... | 0 | 139,214 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void RenderFrameHostImpl::SetNetworkFactoryForTesting(
const CreateNetworkFactoryCallback& url_loader_factory_callback) {
DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) ||
BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(url_loader_factory_callback.is_null() ||
g_url... | 0 | 147,675 |
Analyze the following 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 vmci_transport_qp_resumed_cb(u32 sub_id,
const struct vmci_event_data *e_data,
void *client_data)
{
vsock_for_each_connected_socket(vmci_transport_handle_detach);
}
Commit Message: VSOCK: vmci - fix possible info leak in vmci_transport_dgram_dequeue()
In case we received no data on the ... | 0 | 30,402 |
Analyze the following 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 S_AL_StopBackgroundTrack( void )
{
if(!musicPlaying)
return;
qalSourceStop(musicSource);
qalSourcei(musicSource, AL_BUFFER, 0);
qalDeleteBuffers(NUM_MUSIC_BUFFERS, musicBuffers);
S_AL_MusicSourceFree();
S_AL_CloseMusicFiles();
musicPlaying = qfalse;
}
Commit Message: Don't open .pk3 files as ... | 0 | 95,560 |
Analyze the following 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_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr)
{
if (X509at_add1_attr(&req->req_info->attributes, attr))
return 1;
return 0;
}
Commit Message:
CWE ID: | 0 | 6,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 Resource::ServiceWorkerResponseCachedMetadataHandler::Trace(
blink::Visitor* visitor) {
CachedMetadataHandlerImpl::Trace(visitor);
}
Commit Message: Check CORS using PassesAccessControlCheck() with supplied SecurityOrigin
Partial revert of https://chromium-review.googlesource.com/535694.
Bug: 799477... | 0 | 149,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: static inline void mark_all_clean(struct vmcb *vmcb)
{
vmcb->control.clean = ((1 << VMCB_DIRTY_MAX) - 1)
& ~VMCB_ALWAYS_DIRTY_MASK;
}
Commit Message: KVM: x86: Check non-canonical addresses upon WRMSR
Upon WRMSR, the CPU should inject #GP if a non-canonical value (address) is
written to certain MSRs.... | 0 | 37,771 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: bool FrameView::scrollToFragment(const KURL& url)
{
if (!url.hasFragmentIdentifier() && !m_frame->document()->cssTarget())
return false;
String fragmentIdentifier = url.fragmentIdentifier();
if (scrollToAnchor(fragmentIdentifier))
return true;
if (m_frame->document()->encoding().... | 0 | 119,915 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void VirtualKeyboardController::OnTouchscreenDeviceConfigurationChanged() {
UpdateDevices();
}
Commit Message: Move smart deploy to tristate.
BUG=
Review URL: https://codereview.chromium.org/1149383006
Cr-Commit-Position: refs/heads/master@{#333058}
CWE ID: CWE-399 | 0 | 123,292 |
Analyze the following 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 ext4_fsblk_t ext4_find_goal(struct inode *inode, ext4_lblk_t block,
Indirect *partial)
{
ext4_fsblk_t goal;
/*
* XXX need to get goal block from mballoc's data structures
*/
goal = ext4_find_near(inode, partial);
goal = goal & EXT4_MAX_BLOCK_FILE_PHYS;
return goal;
}
Commit Message: ext4... | 0 | 57,507 |
Analyze the following 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 RenderViewImpl::Close() {
WebView* doomed = webview_;
RenderWidget::Close();
webview_ = nullptr;
g_view_map.Get().erase(doomed);
g_routing_id_view_map.Get().erase(GetRoutingID());
RenderThread::Get()->Send(new ViewHostMsg_Close_ACK(GetRoutingID()));
}
Commit Message: If a page calls |window.focu... | 0 | 147,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 sctp_getsockopt_rtoinfo(struct sock *sk, int len,
char __user *optval,
int __user *optlen) {
struct sctp_rtoinfo rtoinfo;
struct sctp_association *asoc;
if (len != sizeof (struct sctp_rtoinfo))
return -EINVAL;
if (copy_from_user(&rtoinfo, optval, sizeof (struct sctp_rtoinfo)))
return ... | 0 | 35,024 |
Analyze the following 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_AddHardware(WebEmSession & session, const request& req, Json::Value &root)
{
if (session.rights != 2)
{
session.reply_status = reply::forbidden;
return; //Only admin user allowed
}
std::string name = CURLEncode::URLDecode(request::findValue(&req, "name"));
std::str... | 0 | 90,962 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void Layer::SetScrollOffsetFromImplSide(const gfx::Vector2d& scroll_offset) {
DCHECK(IsPropertyChangeAllowed());
DCHECK(layer_tree_host_ && layer_tree_host_->CommitRequested());
if (scroll_offset_ == scroll_offset)
return;
scroll_offset_ = scroll_offset;
SetNeedsPushProperties();
if (!did_scroll_c... | 0 | 111,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: NavigationControllerImpl& WebContentsImpl::GetController() {
return controller_;
}
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: svn://svn.chromium.org/chrome/trunk/src@... | 0 | 110,625 |
Analyze the following 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 UnserializeInt(IMkvReader* pReader, long long pos, long long size,
long long& result_ref) {
if (!pReader || pos < 0 || size < 1 || size > 8)
return E_FILE_FORMAT_INVALID;
signed char first_byte = 0;
const long status = pReader->Read(pos, 1, (unsigned char*)&first_byte);
if (status < 0)
return status... | 0 | 164,310 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static char **SamplingFactorToList(const char *text)
{
char
**textlist;
register char
*q;
register const char
*p;
register ssize_t
i;
size_t
lines;
if (text == (char *) NULL)
return((char **) NULL);
/*
Convert string to an ASCII list.
*/
lines=1;
for (p=text; *... | 0 | 71,587 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: htmlParseFile(const char *filename, const char *encoding) {
return(htmlSAXParseFile(filename, encoding, NULL, NULL));
}
Commit Message: Roll libxml to 3939178e4cb797417ff033b1e04ab4b038e224d9
Removes a few patches fixed upstream:
https://git.gnome.org/browse/libxml2/commit/?id=e26630548e7d138d2c560844c43820... | 0 | 150,817 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static ssize_t abi_version_show(struct device *device,
struct device_attribute *attr, char *buf)
{
struct ib_uverbs_device *dev =
container_of(device, struct ib_uverbs_device, dev);
int ret = -ENODEV;
int srcu_key;
struct ib_device *ib_dev;
srcu_key = srcu_read_lock(&dev->disassociate_srcu);
ib_dev ... | 0 | 90,438 |
Analyze the following 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 BlockEntry::GetIndex() const { return m_index; }
Commit Message: external/libvpx/libwebm: Update snapshot
Update libwebm snapshot. This update contains security fixes from upstream.
Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5f2b
BUG=23167726
Change-Id: Id3e140e7b31ae11294724b1ecfe2e9c83b4d... | 0 | 160,775 |
Analyze the following 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 __cast6_encrypt(struct cast6_ctx *c, u8 *outbuf, const u8 *inbuf)
{
const __be32 *src = (const __be32 *)inbuf;
__be32 *dst = (__be32 *)outbuf;
u32 block[4];
u32 *Km;
u8 *Kr;
block[0] = be32_to_cpu(src[0]);
block[1] = be32_to_cpu(src[1]);
block[2] = be32_to_cpu(src[2]);
block[3] = be32_to_cpu(src[3]... | 0 | 47,180 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
{
struct usb_hub *hub = usb_get_intfdata(intf);
struct usb_device *hdev = hub->hdev;
unsigned port1;
int status;
/*
* Warn if children aren't already suspended.
* Also, add up the number of wakeup-enabled descendants.
*/
hub->wa... | 0 | 56,774 |
Analyze the following 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 t2p_tile_collapse_left(
tdata_t buffer,
tsize_t scanwidth,
uint32 tilewidth,
uint32 edgetilewidth,
uint32 tilelength){
uint32 i;
tsize_t edgescanwidth=0;
edgescanwidth = (scanwidth * edgetilewidth + (tilewidth - 1))/ tilewidth;
for(i=0;i<tilelength;i++){
/* We use memmove() s... | 0 | 71,383 |
Analyze the following 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_heap_enable_free(gs_memory_t * mem, bool enable)
{
if (enable)
mem->procs.free_object = gs_heap_free_object,
mem->procs.free_string = gs_heap_free_string;
else
mem->procs.free_object = gs_ignore_free_object,
mem->procs.free_string = gs_ignore_free_string;
}
Comm... | 0 | 3,540 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: DOMWindow* Document::open(LocalDOMWindow* current_window,
LocalDOMWindow* entered_window,
const AtomicString& url,
const AtomicString& name,
const AtomicString& features,
ExceptionStat... | 0 | 154,811 |
Analyze the following 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 PaintLayerScrollableArea::DeregisterForAnimation() {
if (HasBeenDisposed())
return;
if (LocalFrame* frame = GetLayoutBox()->GetFrame()) {
if (LocalFrameView* frame_view = frame->View())
frame_view->RemoveAnimatingScrollableArea(this);
}
}
Commit Message: Always call UpdateCompositedScrol... | 0 | 130,033 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: double HTMLMediaElement::officialPlaybackPosition() const {
bool waitingForData = m_readyState <= kHaveCurrentData;
if (m_officialPlaybackPositionNeedsUpdate && !m_paused && !waitingForData) {
setOfficialPlaybackPosition(currentPlaybackPosition());
}
#if LOG_OFFICIAL_TIME_STATUS
static const double m... | 0 | 128,852 |
Analyze the following 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 RenderLayerCompositor::recursiveRepaintLayer(RenderLayer* layer, const IntRect* rect)
{
if (layer->compositingState() == PaintsIntoOwnBacking) {
if (rect)
layer->repainter().setBackingNeedsRepaintInRect(*rect);
else
layer->repainter().setBackingNeedsRepaint();
... | 0 | 113,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 nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_getaclres *resp)
{
struct dentry *dentry = resp->fh.fh_dentry;
struct inode *inode;
struct kvec *head = rqstp->rq_res.head;
unsigned int base;
int n;
int w;
/*
* Since this is version 2, the check for nfserr in
* n... | 0 | 55,749 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: test_bson_count_keys (void)
{
bson_t b;
bson_init (&b);
BSON_ASSERT (bson_append_int32 (&b, "0", -1, 0));
BSON_ASSERT (bson_append_int32 (&b, "1", -1, 1));
BSON_ASSERT (bson_append_int32 (&b, "2", -1, 2));
ASSERT_CMPINT (bson_count_keys (&b), ==, 3);
bson_destroy (&b);
}
Commit Message: Fix... | 0 | 77,910 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: png_have_neon(png_structp png_ptr)
{
FILE *f = fopen("/proc/cpuinfo", "rb");
if (f != NULL)
{
/* This is a simple state machine which reads the input byte-by-byte until
* it gets a match on the 'neon' feature or reaches the end of the stream.
*/
static const char ch_feature[] = { 70, 69, 65, 8... | 1 | 173,565 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void GLES2DecoderImpl::DoDisableVertexAttribArray(GLuint index) {
if (vertex_attrib_manager_->Enable(index, false)) {
if (index != 0 ||
gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) {
glDisableVertexAttribArray(index);
}
} else {
SetGLError(GL_INVALID_VALUE,
... | 0 | 103,524 |
Analyze the following 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 writeFileListIndex(const Vector<int>& blobIndices)
{
append(FileListIndexTag);
uint32_t length = blobIndices.size();
doWriteUint32(length);
for (unsigned i = 0; i < length; ++i)
doWriteUint32(blobIndices[i]);
}
Commit Message: Replace further questiona... | 0 | 120,561 |
Analyze the following 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 Cluster::HasBlockEntries(
const Segment* pSegment,
long long off, // relative to start of segment payload
long long& pos, long& len) {
assert(pSegment);
assert(off >= 0); // relative to segment
IMkvReader* const pReader = pSegment->m_pReader;
long long total, avail;
long status = pReader->Length... | 0 | 164,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: hook_add_to_infolist (struct t_infolist *infolist, const char *arguments)
{
const char *pos_arguments;
char *type;
int i, type_int;
if (!infolist)
return 0;
type = NULL;
pos_arguments = NULL;
if (arguments)
{
pos_arguments = strchr (arguments, ',');
... | 0 | 3,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 int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry)
{
int error = 0;
struct inode *target;
/*
* If we are going to change the parent - check write permissions,
* we'll need to flip '..'.
*/
if (new_dir != old_dir) {
error ... | 0 | 39,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: cifs_push_posix_locks(struct cifsFileInfo *cfile)
{
struct inode *inode = cfile->dentry->d_inode;
struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
struct file_lock *flock, **before;
unsigned int count = 0, i = 0;
int rc = 0, xid, type;
struct list_head locks_to_send, *el;
struct lock_to_push *lck, *tmp;
... | 0 | 39,998 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
struct btrfs_root *root)
{
unsigned long joined = 0;
struct btrfs_transaction *cur_trans = trans->transaction;
struct btrfs_transaction *prev_trans = NULL;
DEFINE_WAIT(wait);
int ret;
int should_grow = 0;
unsigned long now = get_seconds... | 0 | 34,464 |
Analyze the following 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 v8::Handle<v8::Value> doubleSequenceAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.TestObj.doubleSequenceAttr._get");
TestObj* imp = V8TestObj::toNative(info.Holder());
return v8Array(imp->doubleSequenceAttr(), info.GetIsolate());
}
Commit Message: [V... | 0 | 109,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: static void update_h_load(long cpu)
{
walk_tg_tree(tg_load_down, tg_nop, (void *)cpu);
}
Commit Message: Sched: fix skip_clock_update optimization
idle_balance() drops/retakes rq->lock, leaving the previous task
vulnerable to set_tsk_need_resched(). Clear it after we return
from balancing instead, and in setu... | 0 | 22,650 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: srcHandle_t S_AL_SrcAlloc( alSrcPriority_t priority, int entnum, int channel )
{
int i;
int empty = -1;
int weakest = -1;
int weakest_time = Sys_Milliseconds();
int weakest_pri = 999;
float weakest_gain = 1000.0;
qboolean weakest_isplaying = qtrue;
int weakest_numloops = 0;
src_t *curSource;
for(i = 0;... | 0 | 95,545 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: PHPAPI PHP_FUNCTION(fgets)
{
zval *arg1;
long len = 1024;
char *buf = NULL;
int argc = ZEND_NUM_ARGS();
size_t line_len = 0;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &len) == FAILURE) {
RETURN_FALSE;
}
PHP_STREAM_TO_ZVAL(stream, &arg1);
if (argc == 1) {... | 0 | 52,155 |
Analyze the following 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 convert_bytes_value(struct usb_mixer_elem_info *cval, int val)
{
switch (cval->val_type) {
case USB_MIXER_BOOLEAN:
return !!val;
case USB_MIXER_INV_BOOLEAN:
return !val;
case USB_MIXER_S8:
case USB_MIXER_U8:
return val & 0xff;
case USB_MIXER_S16:
case USB_MIXER_U16:
return val & 0xffff;
... | 0 | 59,967 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: AlertIndicatorTest() {}
Commit Message: Paint tab groups with the group color.
* The background of TabGroupHeader now uses the group color.
* The backgrounds of tabs in the group are tinted with the group color.
This treatment, along with the colors chosen, are intended to be
a placeholder.
Bug: 905491
Chan... | 0 | 140,841 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: AvailableSpaceQueryTask(
QuotaManager* manager,
const AvailableSpaceCallback& callback)
: QuotaThreadTask(manager, manager->db_thread_),
profile_path_(manager->profile_path_),
space_(-1),
get_disk_space_fn_(manager->get_disk_space_fn_),
callback_(callback) {
... | 1 | 170,668 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void LayerTreeHostQt::createTile(WebLayerID layerID, int tileID, const UpdateInfo& updateInfo)
{
m_webPage->send(Messages::LayerTreeHostProxy::CreateTileForLayer(layerID, tileID, updateInfo));
}
Commit Message: [Qt][WK2] Allow transparent WebViews
https://bugs.webkit.org/show_bug.cgi?id=80608
Reviewed by To... | 0 | 101,835 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: process_map_input(void)
{
int mv_x, mv_y;
person_t* person;
int i;
kb_clear_queue();
for (i = 0; i < PLAYER_MAX; ++i) {
person = s_players[i].person;
if (person != NULL) {
if (kb_is_key_down(get_player_key(i, PLAYER_KEY_A))
|| kb_is_key_down(s_players[i].talk_key)
|| joy_is_button_dow... | 0 | 75,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: ScreenRestructured(ScreenPtr pScreen)
{
GrabPtr grab;
DeviceIntPtr pDev;
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
if (!IsFloating(pDev) && !DevHasCursor(pDev))
continue;
/* GrabDevice doesn't have a confineTo field, so we don't need to
* worry ab... | 0 | 4,891 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: AP_CORE_DECLARE(void) ap_random_parent_after_fork(void)
{
/*
* To ensure that the RNG state in the parent changes after the fork, we
* pull some data from the RNG and discard it. This ensures that the RNG
* states in the children are different even after the pid wraps around.
* As we only ... | 0 | 64,207 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: static int hugetlbfs_symlink(struct inode *dir,
struct dentry *dentry, const char *symname)
{
struct inode *inode;
int error = -ENOSPC;
inode = hugetlbfs_get_inode(dir->i_sb, dir, S_IFLNK|S_IRWXUGO, 0);
if (inode) {
int l = strlen(symname)+1;
error = page_symlink(inode, symname, l);
if (!error) {
... | 0 | 20,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: int ssl_set_dh_param( ssl_context *ssl, const char *dhm_P, const char *dhm_G )
{
int ret;
if( ( ret = mpi_read_string( &ssl->dhm_P, 16, dhm_P ) ) != 0 )
{
SSL_DEBUG_RET( 1, "mpi_read_string", ret );
return( ret );
}
if( ( ret = mpi_read_string( &ssl->dhm_G, 16, dhm_G ) ) != 0... | 0 | 29,031 |
Analyze the following 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 ssl_scan_serverhello_tlsext(SSL *s, unsigned char **p,
unsigned char *d, int n, int *al)
{
unsigned short length;
unsigned short type;
unsigned short size;
unsigned char *data = *p;
int tlsext_servername = 0;
int renegotiate_seen = 0;
# if... | 1 | 165,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: bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
{
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
struct extent_tree *et;
struct extent_node *en;
struct extent_info ei;
if (!f2fs_may_extent_tree(inode)) {
/* drop largest extent */
if (i_ext && i_ext->len) {
i_ext->len = 0;
... | 1 | 169,416 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void SyncBackendHost::NotifyPassphraseRequired(
sync_api::PassphraseRequiredReason reason,
sync_pb::EncryptedData pending_keys) {
if (!frontend_)
return;
DCHECK_EQ(MessageLoop::current(), frontend_loop_);
cached_pending_keys_ = pending_keys;
frontend_->OnPassphraseRequired(reason, pending_k... | 0 | 104,867 |
Analyze the following 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 add_stream_to_programs(AVFormatContext *s, struct playlist *pls, AVStream *stream)
{
HLSContext *c = s->priv_data;
int i, j;
int bandwidth = -1;
for (i = 0; i < c->n_variants; i++) {
struct variant *v = c->variants[i];
for (j = 0; j < v->n_playlists; j++) {
... | 0 | 61,780 |
Analyze the following 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 address_space_stw(AddressSpace *as, hwaddr addr, uint32_t val,
MemTxAttrs attrs, MemTxResult *result)
{
address_space_stw_internal(as, addr, val, attrs, result,
DEVICE_NATIVE_ENDIAN);
}
Commit Message:
CWE ID: CWE-20 | 0 | 14,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: bool SendGetCookiesJSONRequest(
AutomationMessageSender* sender,
const std::string& url,
ListValue** cookies,
std::string* error_msg) {
DictionaryValue dict;
dict.SetString("command", "GetCookies");
dict.SetString("url", url);
DictionaryValue reply_dict;
if (!SendAutomationJSONRequest(se... | 0 | 100,666 |
Analyze the following 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 printmyrights(const char *extname, const mbentry_t *mbentry)
{
int rights = 0;
char str[ACL_MAXSTR];
rights = cyrus_acl_myrights(imapd_authstate, mbentry->acl);
/* Add in implicit rights */
if (imapd_userisadmin) {
rights |= ACL_LOOKUP|ACL_ADMIN;
}
else if (mboxnam... | 0 | 95,251 |
Analyze the following 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 **load_enc_file(char *enc_name)
{
char buf[ENC_BUF_SIZE], *p, *r;
int i, names_count;
char **glyph_names;
set_cur_file_name(enc_name);
if (!enc_open()) {
pdftex_fail("cannot open encoding file for reading");
}
glyph_names = xtalloc(256, char *);
for (i = 0; i < 256; i+... | 0 | 76,717 |
Analyze the following 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 emulator_get_dr(struct x86_emulate_ctxt *ctxt, int dr, unsigned long *dest)
{
return _kvm_get_dr(emul_to_vcpu(ctxt), dr, dest);
}
Commit Message: KVM: Ensure all vcpus are consistent with in-kernel irqchip settings
(cherry picked from commit 3e515705a1f46beb1c942bb8043c16f8ac7b1e9e)
If some vcpus are crea... | 0 | 20,668 |
Analyze the following 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::RunAndNotifyInitialLoadFinished(
const FindEntryCallback& callback,
GDataFileError error,
GDataEntry* entry) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!callback.is_null())
callback.Run(error, entry);
DVLOG(1) << "RunAndNotifyInitialLoadFinished";
... | 0 | 117,041 |
Analyze the following 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 tun_sock_write_space(struct sock *sk)
{
struct tun_struct *tun;
wait_queue_head_t *wqueue;
if (!sock_writeable(sk))
return;
if (!test_and_clear_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags))
return;
wqueue = sk_sleep(sk);
if (wqueue && waitqueue_active(wqueue))
wake_up_interruptible_sy... | 0 | 23,883 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: Document::EventFactorySet& Document::eventFactories()
{
DEFINE_STATIC_LOCAL(EventFactorySet, s_eventFactory, ());
return s_eventFactory;
}
Commit Message: Change Document::detach() to RELEASE_ASSERT all subframes are gone.
BUG=556724,577105
Review URL: https://codereview.chromium.org/1667573002
Cr-Com... | 0 | 124,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: tBTA_AV_RCB* bta_av_get_rcb_by_shdl(uint8_t shdl) {
tBTA_AV_RCB* p_rcb = NULL;
int i;
for (i = 0; i < BTA_AV_NUM_RCB; i++) {
if (bta_av_cb.rcb[i].shdl == shdl &&
bta_av_cb.rcb[i].handle != BTA_AV_RC_HANDLE_NONE) {
p_rcb = &bta_av_cb.rcb[i];
break;
}
}
return p_rcb;
}
Commit Message: Check... | 0 | 162,845 |
Analyze the following 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 aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
{
const struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
if (unlikely(need_fallback(sctx->key_len))) {
crypto_cipher_encrypt_one(sctx->fallback.cip, out, in);
return;
}
switch (sctx->key_len) {
case 16:
crypt_s390_km(KM_AES_128_EN... | 0 | 46,651 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: SYSCALL_DEFINE3(rt_sigqueueinfo, pid_t, pid, int, sig,
siginfo_t __user *, uinfo)
{
siginfo_t info;
if (copy_from_user(&info, uinfo, sizeof(siginfo_t)))
return -EFAULT;
return do_rt_sigqueueinfo(pid, sig, &info);
}
Commit Message: kernel/signal.c: stop info leak via the tkill and the tgkill syscalls
This... | 0 | 31,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: MagickExport MagickBooleanType ClampImage(Image *image,ExceptionInfo *exception)
{
#define ClampImageTag "Clamp/Image"
CacheView
*image_view;
MagickBooleanType
status;
MagickOffsetType
progress;
ssize_t
y;
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSign... | 0 | 89,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 progressCompleted()
{
ASSERT(m_inProgress);
ASSERT(m_frame->page());
m_inProgress = false;
m_frame->page()->progress().progressCompleted(m_frame);
}
Commit Message: Don't wait to notify client of spoof attempt if a modal dialog is created.
BUG=281256
TEST=See bug... | 0 | 111,665 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: LoginBubble* LockContentsView::TestApi::tooltip_bubble() const {
return view_->tooltip_bubble_.get();
}
Commit Message: cros: Check initial auth type when showing views login.
Bug: 859611
Change-Id: I0298db9bbf4aed6bd40600aef2e1c5794e8cd058
Reviewed-on: https://chromium-review.googlesource.com/1123056
Reviewe... | 0 | 131,558 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: void RenderFrameHostImpl::OnRunJavaScriptDialog(
const base::string16& message,
const base::string16& default_prompt,
const GURL& frame_url,
JavaScriptDialogType dialog_type,
IPC::Message* reply_msg) {
if (dialog_type == JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_ALERT)
GetFrameResourc... | 0 | 147,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: bool BrowserView::CanMinimize() const {
return true;
}
Commit Message: Mac: turn popups into new tabs while in fullscreen.
It's platform convention to show popups as new tabs while in
non-HTML5 fullscreen. (Popups cause tabs to lose HTML5 fullscreen.)
This was implemented for Cocoa in a BrowserWindow overrid... | 0 | 155,145 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: COMPAT_SYSCALL_DEFINE4(ptrace, compat_long_t, request, compat_long_t, pid,
compat_long_t, addr, compat_long_t, data)
{
struct task_struct *child;
long ret;
if (request == PTRACE_TRACEME) {
ret = ptrace_traceme();
goto out;
}
child = find_get_task_by_vpid(pid);
if (!child) {
ret = -ESRCH;
... | 0 | 89,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: static int pcnet_tdte_poll(PCNetState *s)
{
s->csr[34] = s->csr[35] = 0;
if (s->tdra) {
hwaddr cxda = s->tdra +
(CSR_XMTRL(s) - CSR_XMTRC(s)) *
(BCR_SWSTYLE(s) ? 16 : 8);
int bad = 0;
CHECK_TMD(cxda, bad);
if (!bad) {
if (CSR_CXDA(s) != c... | 0 | 14,532 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: LIBOPENMPT_MODPLUG_API unsigned int ModPlug_GetMasterVolume(ModPlugFile* file)
{
int32_t val;
if(!file) return 0;
val = 0;
if(!openmpt_module_get_render_param(file->mod,OPENMPT_MODULE_RENDER_MASTERGAIN_MILLIBEL,&val)) return 128;
return (unsigned int)(128.0*pow(10.0,val*0.0005));
}
Commit Message: [Fix] lib... | 0 | 87,633 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: CloudPolicyCacheBase::~CloudPolicyCacheBase() {
FOR_EACH_OBSERVER(Observer, observer_list_, OnCacheGoingAway(this));
}
Commit Message: Reset the device policy machinery upon retrying enrollment.
BUG=chromium-os:18208
TEST=See bug description
Review URL: http://codereview.chromium.org/7676005
git-svn-id: sv... | 0 | 97,752 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_width, const unsigned int src_height, const unsigned int new_width, const unsigned int new_height)
{
gdImagePtr tmp_im;
gdImagePtr dst;
tmp_im = gdImageCreateTrueColor(new_width, src_height);
if (tmp_im == NULL) {
return NULL;
}
... | 0 | 95,066 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: init_seps (enum url_scheme scheme)
{
static char seps[8] = ":/";
char *p = seps + 2;
int flags = supported_schemes[scheme].flags;
if (flags & scm_has_params)
*p++ = ';';
if (flags & scm_has_query)
*p++ = '?';
if (flags & scm_has_fragment)
*p++ = '#';
*p = '\0';
return seps;
}
Commit ... | 0 | 8,686 |
Analyze the following 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 WebMediaPlayerImpl::OnCdmAttached(bool success) {
DVLOG(1) << __func__ << ": success = " << success;
DCHECK(main_task_runner_->BelongsToCurrentThread());
DCHECK(pending_cdm_context_ref_);
if (success) {
media_log_->SetBooleanProperty("has_cdm", true);
cdm_context_ref_ = std::move(pending_cd... | 0 | 144,440 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) {
const xmlChar *ptr;
xmlChar cur;
unsigned int val = 0;
unsigned int outofrange = 0;
if ((str == NULL) || (*str == NULL)) return(0);
ptr = *str;
cur = *ptr;
if ((cur == '&') && (ptr[1] == '#') && (ptr[2] == 'x')) {... | 0 | 59,518 |
Analyze the following 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 WebPage::setEnableLocalAccessToAllCookies(bool enabled)
{
cookieManager().setCanLocalAccessAllCookies(enabled);
}
Commit Message: [BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API
https://bugs.webkit.org/show_bug.cgi?id=105143
RIM PR 171941
Reviewed by Rob Buis.
Internally reviewed by Geor... | 0 | 104,399 |
Analyze the following 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 Splash::blitImageClipped(SplashBitmap *src, GBool srcAlpha,
int xSrc, int ySrc, int xDest, int yDest,
int w, int h) {
SplashPipe pipe;
SplashColor pixel;
Guchar *ap;
int x, y;
if (vectorAntialias) {
pipeInit(&pipe, xDest, yDest, NULL, pixel,
(Guchar)splashRound(state->f... | 0 | 4,089 |
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'. | Code: magic_entry_free(struct magic_entry *me, uint32_t nme)
{
uint32_t i;
if (me == NULL)
return;
for (i = 0; i < nme; i++)
free(me[i].mp);
free(me);
}
Commit Message: * Enforce limit of 8K on regex searches that have no limits
* Allow the l modifier for regex to mean line count. Default
to byte count. If l... | 0 | 37,970 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.