Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code: DatasetGenerationCastError Exception: DatasetGenerationCastError Message: An error occurred while generating the dataset All the data files must have the same columns, but at some point there are 6 new columns ({'length', 'label', 'line', 'code', 'cve', 'cwe'}) and 3 missing columns ({'instruction', 'input', 'output'}). This happened while the json dataset builder was generating data using hf://datasets/xuefen/VulResource/bigvul/split/bigvul_0-512_train.json (at revision 0faab253a3195e0bba9200338933ed995ab95f9f) Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations) Traceback: Traceback (most recent call last): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1870, in _prepare_split_single writer.write_table(table) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 622, in write_table pa_table = table_cast(pa_table, self._schema) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2292, in table_cast return cast_table_to_schema(table, schema) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2240, in cast_table_to_schema raise CastError( datasets.table.CastError: Couldn't cast index: int64 code: string line: string label: int64 cwe: string cve: string length: int64 -- schema metadata -- pandas: '{"index_columns": [], "column_indexes": [], "columns": [{"name":' + 889 to {'instruction': Value(dtype='string', id=None), 'input': Value(dtype='string', id=None), 'output': Value(dtype='string', id=None), 'index': Value(dtype='int64', id=None)} because column names don't match During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1417, in compute_config_parquet_and_info_response parquet_operations = convert_to_parquet(builder) File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1049, in convert_to_parquet builder.download_and_prepare( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 924, in download_and_prepare self._download_and_prepare( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1000, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1741, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1872, in _prepare_split_single raise DatasetGenerationCastError.from_cast_error( datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset All the data files must have the same columns, but at some point there are 6 new columns ({'length', 'label', 'line', 'code', 'cve', 'cwe'}) and 3 missing columns ({'instruction', 'input', 'output'}). This happened while the json dataset builder was generating data using hf://datasets/xuefen/VulResource/bigvul/split/bigvul_0-512_train.json (at revision 0faab253a3195e0bba9200338933ed995ab95f9f) Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
instruction
string | input
string | output
string | index
int64 |
---|---|---|---|
Detect whether the following code contains vulnerabilities. | static void wakeup_pipe_readers(struct pipe_inode_info *pipe)
{
smp_mb();
if (waitqueue_active(&pipe->wait))
wake_up_interruptible(&pipe->wait);
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
}
| 0 | 46,400 |
Detect whether the following code contains vulnerabilities. | static Long Current_Ratio( EXEC_OP )
{
if ( CUR.metrics.ratio )
return CUR.metrics.ratio;
if ( CUR.GS.projVector.y == 0 )
CUR.metrics.ratio = CUR.metrics.x_ratio;
else if ( CUR.GS.projVector.x == 0 )
CUR.metrics.ratio = CUR.metrics.y_ratio;
else
{
Long x, y;
x = MulDiv_Round( CUR.GS.projVector.x, CUR.metrics.x_ratio, 0x4000 );
y = MulDiv_Round( CUR.GS.projVector.y, CUR.metrics.y_ratio, 0x4000 );
CUR.metrics.ratio = Norm( x, y );
}
return CUR.metrics.ratio;
}
| 0 | 5,352 |
Detect whether the following code contains vulnerabilities. | virtual bool MyIpAddress(std::string* ip_address) {
my_ip_address_count++;
*ip_address = my_ip_address_result;
return !my_ip_address_result.empty();
}
| 0 | 177,729 |
Detect whether the following code contains vulnerabilities. | void InputDispatcher::finishDispatchCycleLocked(nsecs_t currentTime,
const sp<Connection>& connection, uint32_t seq, bool handled) {
#if DEBUG_DISPATCH_CYCLE
ALOGD("channel '%s' ~ finishDispatchCycle - seq=%u, handled=%s",
connection->getInputChannelName(), seq, toString(handled));
#endif
connection->inputPublisherBlocked = false;
if (connection->status == Connection::STATUS_BROKEN
|| connection->status == Connection::STATUS_ZOMBIE) {
return;
}
onDispatchCycleFinishedLocked(currentTime, connection, seq, handled);
}
| 0 | 176,938 |
Detect whether the following code contains vulnerabilities. | void WebContentsImpl::NotifySwappedFromRenderManager(RenderViewHost* rvh) {
NotifySwapped(rvh);
if (delegate_)
view_->SetOverscrollControllerEnabled(delegate_->CanOverscrollContent());
view_->RenderViewSwappedIn(render_manager_.current_host());
FrameTreeNode* root = NULL;
RenderViewHostImpl* new_rvh = static_cast<RenderViewHostImpl*>(
render_manager_.current_host());
if (new_rvh->main_frame_id() != -1)
root = new FrameTreeNode(new_rvh->main_frame_id(), std::string());
frame_tree_root_.reset(root);
}
| 0 | 118,966 |
Detect whether the following code contains vulnerabilities. | void Gfx::opEndIgnoreUndef(Object args[], int numArgs) {
if (ignoreUndef > 0)
--ignoreUndef;
}
| 0 | 8,121 |
Detect whether the following code contains vulnerabilities. | static void rfcomm_sock_kill(struct sock *sk)
{
if (!sock_flag(sk, SOCK_ZAPPED) || sk->sk_socket)
return;
BT_DBG("sk %p state %d refcnt %d", sk, sk->sk_state, atomic_read(&sk->sk_refcnt));
/* Kill poor orphan */
bt_sock_unlink(&rfcomm_sk_list, sk);
sock_set_flag(sk, SOCK_DEAD);
sock_put(sk);
}
| 0 | 30,742 |
Detect whether the following code contains vulnerabilities. | char *bin2hex(const unsigned char *p, size_t len)
{
ssize_t slen;
char *s;
slen = len * 2 + 1;
if (slen % 4)
slen += 4 - (slen % 4);
s = (char *)calloc(slen, 1);
if (unlikely(!s))
quithere(1, "Failed to calloc");
__bin2hex(s, p, len);
return s;
}
| 0 | 36,558 |
Detect whether the following code contains vulnerabilities. | status_t HevcParameterSets::parseVps(const uint8_t* data, size_t size) {
NALBitReader reader(data, size);
reader.skipBits(4);
reader.skipBits(1);
reader.skipBits(1);
reader.skipBits(6);
reader.skipBits(1);
reader.skipBits(16);
if (reader.atLeastNumBitsLeft(96)) {
mParams.add(kGeneralProfileSpace, reader.getBits(2));
mParams.add(kGeneralTierFlag, reader.getBits(1));
mParams.add(kGeneralProfileIdc, reader.getBits(5));
mParams.add(kGeneralProfileCompatibilityFlags, reader.getBits(32));
mParams.add(
kGeneralConstraintIndicatorFlags,
((uint64_t)reader.getBits(16) << 32) | reader.getBits(32));
mParams.add(kGeneralLevelIdc, reader.getBits(8));
} else {
reader.skipBits(96);
}
return reader.overRead() ? ERROR_MALFORMED : OK;
}
| 0 | 175,569 |
Detect whether the following code contains vulnerabilities. | static inline struct inode *orphan_list_entry(struct list_head *l)
{
return &list_entry(l, struct ext3_inode_info, i_orphan)->vfs_inode;
}
| 0 | 32,958 |
Detect whether the following code contains vulnerabilities. | void BackgroundLoaderOffliner::CanDownload(
base::OnceCallback<void(bool)> callback) {
if (!pending_request_.get()) {
std::move(callback).Run(false); // Shouldn't happen though...
return;
}
bool should_allow_downloads = false;
Offliner::RequestStatus final_status =
Offliner::RequestStatus::LOADING_FAILED_DOWNLOAD;
if (offline_page_model_->GetPolicyController()
->AllowsConversionToBackgroundFileDownload(
pending_request_.get()->client_id().name_space)) {
should_allow_downloads = true;
final_status = Offliner::RequestStatus::DOWNLOAD_THROTTLED;
}
std::move(callback).Run(should_allow_downloads);
SavePageRequest request(*pending_request_.get());
std::move(completion_callback_).Run(request, final_status);
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(&BackgroundLoaderOffliner::ResetState,
weak_ptr_factory_.GetWeakPtr()));
}
| 0 | 151,782 |
Detect whether the following code contains vulnerabilities. | static void nfs4_open_confirm_release(void *calldata)
{
struct nfs4_opendata *data = calldata;
struct nfs4_state *state = NULL;
/* If this request hasn't been cancelled, do nothing */
if (data->cancelled == 0)
goto out_free;
/* In case of error, no cleanup! */
if (!data->rpc_done)
goto out_free;
state = nfs4_opendata_to_nfs4_state(data);
if (!IS_ERR(state))
nfs4_close_state(&data->path, state, data->o_arg.open_flags);
out_free:
nfs4_opendata_put(data);
}
| 1 | 178,866 |
Detect whether the following code contains vulnerabilities. | FrameLoaderClient::FrameLoaderClient(WebKitWebFrame* frame)
: m_frame(frame)
, m_policyDecision(0)
, m_pluginView(0)
, m_hasSentResponseToPlugin(false)
{
ASSERT(m_frame);
}
| 0 | 98,271 |
Detect whether the following code contains vulnerabilities. | WebLocalFrameImpl* WebLocalFrameImpl::CreateMainFrame(
WebView* web_view,
WebFrameClient* client,
InterfaceRegistry* interface_registry,
WebFrame* opener,
const WebString& name,
WebSandboxFlags sandbox_flags) {
WebLocalFrameImpl* frame = new WebLocalFrameImpl(WebTreeScopeType::kDocument,
client, interface_registry);
frame->SetOpener(opener);
Page& page = *static_cast<WebViewBase*>(web_view)->GetPage();
DCHECK(!page.MainFrame());
frame->InitializeCoreFrame(page, nullptr, name);
frame->GetFrame()->Loader().ForceSandboxFlags(
static_cast<SandboxFlags>(sandbox_flags));
return frame;
}
| 0 | 146,944 |
Detect whether the following code contains vulnerabilities. | int get_sda(void)
{
I2C_TRISTATE;
return I2C_READ;
}
| 0 | 89,304 |
Detect whether the following code contains vulnerabilities. | bool SelectWindow(const aura::Window* window) {
if (GetSelectedWindow() == nullptr)
SendKey(ui::VKEY_TAB);
const aura::Window* start_window = GetSelectedWindow();
if (start_window == window)
return true;
do {
SendKey(ui::VKEY_TAB);
} while (GetSelectedWindow() != window &&
GetSelectedWindow() != start_window);
return GetSelectedWindow() == window;
}
| 0 | 145,898 |
Detect whether the following code contains vulnerabilities. | void drop_inmem_page(struct inode *inode, struct page *page)
{
struct f2fs_inode_info *fi = F2FS_I(inode);
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
struct list_head *head = &fi->inmem_pages;
struct inmem_pages *cur = NULL;
f2fs_bug_on(sbi, !IS_ATOMIC_WRITTEN_PAGE(page));
mutex_lock(&fi->inmem_lock);
list_for_each_entry(cur, head, list) {
if (cur->page == page)
break;
}
f2fs_bug_on(sbi, !cur || cur->page != page);
list_del(&cur->list);
mutex_unlock(&fi->inmem_lock);
dec_page_count(sbi, F2FS_INMEM_PAGES);
kmem_cache_free(inmem_entry_slab, cur);
ClearPageUptodate(page);
set_page_private(page, 0);
ClearPagePrivate(page);
f2fs_put_page(page, 0);
trace_f2fs_commit_inmem_page(page, INMEM_INVALIDATE);
}
| 0 | 85,381 |
Detect whether the following code contains vulnerabilities. | void SyncBackendHost::Core::DoUpdateCredentials(
const SyncCredentials& credentials) {
DCHECK(MessageLoop::current() == host_->core_thread_.message_loop());
syncapi_->UpdateCredentials(credentials);
}
| 0 | 106,312 |
Detect whether the following code contains vulnerabilities. | FakeWindowEventDispatcher(aura::WindowTreeHost* host)
: WindowEventDispatcher(host, true), processed_touch_event_count_(0) {}
| 0 | 158,406 |
Detect whether the following code contains vulnerabilities. | static void resume_send(h2o_http2_conn_t *conn)
{
if (h2o_http2_conn_get_buffer_window(conn) <= 0)
return;
#if 0 /* TODO reenable this check for performance? */
if (conn->scheduler.list.size == 0)
return;
#endif
request_gathered_write(conn);
}
| 0 | 52,578 |
Detect whether the following code contains vulnerabilities. | static int apparmor_getprocattr(struct task_struct *task, char *name,
char **value)
{
int error = -ENOENT;
/* released below */
const struct cred *cred = get_task_cred(task);
struct aa_task_cxt *cxt = cred_cxt(cred);
struct aa_profile *profile = NULL;
if (strcmp(name, "current") == 0)
profile = aa_get_newest_profile(cxt->profile);
else if (strcmp(name, "prev") == 0 && cxt->previous)
profile = aa_get_newest_profile(cxt->previous);
else if (strcmp(name, "exec") == 0 && cxt->onexec)
profile = aa_get_newest_profile(cxt->onexec);
else
error = -EINVAL;
if (profile)
error = aa_getprocattr(profile, value);
aa_put_profile(profile);
put_cred(cred);
return error;
}
| 0 | 51,082 |
Detect whether the following code contains vulnerabilities. | CustomElementRegistry* LocalDOMWindow::customElements() const {
if (!custom_elements_ && document_)
custom_elements_ = CustomElementRegistry::Create(this);
return custom_elements_;
}
| 0 | 136,798 |
Detect whether the following code contains vulnerabilities. | _dbus_header_free (DBusHeader *header)
{
_dbus_string_free (&header->data);
}
| 0 | 2,745 |
Detect whether the following code contains vulnerabilities. | void InspectorNetworkAgent::DidReceiveScriptResponse(unsigned long identifier) {
resources_data_->SetResourceType(IdentifiersFactory::RequestId(identifier),
InspectorPageAgent::kScriptResource);
}
| 0 | 151,170 |
Detect whether the following code contains vulnerabilities. | static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
{
s32 err;
u32 bcn_timeout;
__le32 roamtrigger[2];
__le32 roam_delta[2];
/* Configure beacon timeout value based upon roaming setting */
if (ifp->drvr->settings->roamoff)
bcn_timeout = BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_OFF;
else
bcn_timeout = BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON;
err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout);
if (err) {
brcmf_err("bcn_timeout error (%d)\n", err);
goto roam_setup_done;
}
/* Enable/Disable built-in roaming to allow supplicant to take care of
* roaming.
*/
brcmf_dbg(INFO, "Internal Roaming = %s\n",
ifp->drvr->settings->roamoff ? "Off" : "On");
err = brcmf_fil_iovar_int_set(ifp, "roam_off",
ifp->drvr->settings->roamoff);
if (err) {
brcmf_err("roam_off error (%d)\n", err);
goto roam_setup_done;
}
roamtrigger[0] = cpu_to_le32(WL_ROAM_TRIGGER_LEVEL);
roamtrigger[1] = cpu_to_le32(BRCM_BAND_ALL);
err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER,
(void *)roamtrigger, sizeof(roamtrigger));
if (err) {
brcmf_err("WLC_SET_ROAM_TRIGGER error (%d)\n", err);
goto roam_setup_done;
}
roam_delta[0] = cpu_to_le32(WL_ROAM_DELTA);
roam_delta[1] = cpu_to_le32(BRCM_BAND_ALL);
err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA,
(void *)roam_delta, sizeof(roam_delta));
if (err) {
brcmf_err("WLC_SET_ROAM_DELTA error (%d)\n", err);
goto roam_setup_done;
}
roam_setup_done:
return err;
}
| 0 | 49,065 |
Detect whether the following code contains vulnerabilities. | static int remove_marked_parents(struct rev_info *revs, struct commit *commit)
{
struct commit_list **pp, *p;
int nth_parent, removed = 0;
pp = &commit->parents;
nth_parent = 0;
while ((p = *pp) != NULL) {
struct commit *parent = p->item;
if (parent->object.flags & TMP_MARK) {
parent->object.flags &= ~TMP_MARK;
*pp = p->next;
free(p);
removed++;
compact_treesame(revs, commit, nth_parent);
continue;
}
pp = &p->next;
nth_parent++;
}
/* Removing parents can only increase TREESAMEness */
if (removed && !(commit->object.flags & TREESAME))
update_treesame(revs, commit);
return nth_parent;
}
| 0 | 55,032 |
Detect whether the following code contains vulnerabilities. | static int dcbnl_setfeatcfg(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{
struct nlattr *data[DCB_FEATCFG_ATTR_MAX + 1];
int ret, i;
u8 value;
if (!netdev->dcbnl_ops->setfeatcfg)
return -ENOTSUPP;
if (!tb[DCB_ATTR_FEATCFG])
return -EINVAL;
ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX, tb[DCB_ATTR_FEATCFG],
dcbnl_featcfg_nest);
if (ret)
goto err;
for (i = DCB_FEATCFG_ATTR_ALL+1; i <= DCB_FEATCFG_ATTR_MAX; i++) {
if (data[i] == NULL)
continue;
value = nla_get_u8(data[i]);
ret = netdev->dcbnl_ops->setfeatcfg(netdev, i, value);
if (ret)
goto err;
}
err:
ret = nla_put_u8(skb, DCB_ATTR_FEATCFG, ret);
return ret;
}
| 0 | 31,115 |
Detect whether the following code contains vulnerabilities. | bool ExtensionAppItem::RunExtensionEnableFlow() {
if (extensions::util::IsAppLaunchableWithoutEnabling(extension_id_, profile_))
return false;
if (!extension_enable_flow_) {
extension_enable_flow_controller_ = GetController();
extension_enable_flow_controller_->OnShowChildDialog();
extension_enable_flow_.reset(new ExtensionEnableFlow(
profile_, extension_id_, this));
extension_enable_flow_->StartForNativeWindow(
extension_enable_flow_controller_->GetAppListWindow());
}
return true;
}
| 0 | 134,022 |
Detect whether the following code contains vulnerabilities. | WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForNewWindowAction(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleNavigationActionRef navigationAction, WKURLRequestRef request, WKStringRef frameName, WKTypeRef* userData, const void* clientInfo)
{
return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->decidePolicyForNewWindowAction(page, frame, navigationAction, request, frameName, userData);
}
| 0 | 115,360 |
Detect whether the following code contains vulnerabilities. | memory_handle(const media::BitstreamBuffer& input) {
base::SharedMemoryHandle input_handle =
base::SharedMemory::DuplicateHandle(input.handle());
if (!base::SharedMemory::IsHandleValid(input_handle)) {
DLOG(ERROR) << "Failed to duplicate handle of BitstreamBuffer";
return mojo::ScopedSharedBufferHandle();
}
return mojo::WrapSharedMemoryHandle(input_handle, input.size(),
true /* read_only */);
}
| 1 | 186,852 |
Detect whether the following code contains vulnerabilities. | static void gen_helper_in_func(TCGMemOp ot, TCGv v, TCGv_i32 n)
{
switch (ot) {
case MO_8:
gen_helper_inb(v, cpu_env, n);
break;
case MO_16:
gen_helper_inw(v, cpu_env, n);
break;
case MO_32:
gen_helper_inl(v, cpu_env, n);
break;
default:
tcg_abort();
}
}
| 0 | 66,340 |
Detect whether the following code contains vulnerabilities. | void netdev_rx_handler_unregister(struct net_device *dev)
{
ASSERT_RTNL();
rcu_assign_pointer(dev->rx_handler, NULL);
rcu_assign_pointer(dev->rx_handler_data, NULL);
}
| 0 | 35,283 |
Detect whether the following code contains vulnerabilities. | int json_string_set_nocheck(json_t *json, const char *value)
{
char *dup;
json_string_t *string;
if(!json_is_string(json) || !value)
return -1;
dup = jsonp_strdup(value);
if(!dup)
return -1;
string = json_to_string(json);
jsonp_free(string->value);
string->value = dup;
return 0;
}
| 0 | 40,936 |
Detect whether the following code contains vulnerabilities. | void RenderFrameHostImpl::CreateWebSocket(
network::mojom::WebSocketRequest request) {
WebSocketManager::CreateWebSocket(process_->GetID(), routing_id_,
last_committed_origin_, std::move(request));
}
| 0 | 169,149 |
Detect whether the following code contains vulnerabilities. | static int fwnet_add_peer(struct fwnet_device *dev,
struct fw_unit *unit, struct fw_device *device)
{
struct fwnet_peer *peer;
peer = kmalloc(sizeof(*peer), GFP_KERNEL);
if (!peer)
return -ENOMEM;
dev_set_drvdata(&unit->device, peer);
peer->dev = dev;
peer->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4];
INIT_LIST_HEAD(&peer->pd_list);
peer->pdg_size = 0;
peer->datagram_label = 0;
peer->speed = device->max_speed;
peer->max_payload = fwnet_max_payload(device->max_rec, peer->speed);
peer->generation = device->generation;
smp_rmb();
peer->node_id = device->node_id;
spin_lock_irq(&dev->lock);
list_add_tail(&peer->peer_link, &dev->peer_list);
dev->peer_count++;
set_carrier_state(dev);
spin_unlock_irq(&dev->lock);
return 0;
}
| 0 | 49,316 |
Detect whether the following code contains vulnerabilities. | static enum event_type_t get_event_type(struct perf_event *event)
{
struct perf_event_context *ctx = event->ctx;
enum event_type_t event_type;
lockdep_assert_held(&ctx->lock);
event_type = event->attr.pinned ? EVENT_PINNED : EVENT_FLEXIBLE;
if (!ctx->task)
event_type |= EVENT_CPU;
return event_type;
}
| 0 | 85,212 |
Detect whether the following code contains vulnerabilities. | xsltRegisterPersistRVT(xsltTransformContextPtr ctxt, xmlDocPtr RVT)
{
if ((ctxt == NULL) || (RVT == NULL)) return(-1);
RVT->next = (xmlNodePtr) ctxt->persistRVT;
if (ctxt->persistRVT != NULL)
ctxt->persistRVT->prev = (xmlNodePtr) RVT;
ctxt->persistRVT = RVT;
return(0);
}
| 0 | 170,042 |
Detect whether the following code contains vulnerabilities. | long jas_stream_length(jas_stream_t *stream)
{
long oldpos;
long pos;
if ((oldpos = jas_stream_tell(stream)) < 0) {
return -1;
}
if (jas_stream_seek(stream, 0, SEEK_END) < 0) {
return -1;
}
if ((pos = jas_stream_tell(stream)) < 0) {
return -1;
}
if (jas_stream_seek(stream, oldpos, SEEK_SET) < 0) {
return -1;
}
return pos;
}
| 0 | 67,921 |
Detect whether the following code contains vulnerabilities. | SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id,
struct itimerspec __user *, setting)
{
struct itimerspec64 cur_setting;
int ret = do_timer_gettime(timer_id, &cur_setting);
if (!ret) {
if (put_itimerspec64(&cur_setting, setting))
ret = -EFAULT;
}
return ret;
}
| 0 | 85,127 |
Detect whether the following code contains vulnerabilities. | asmlinkage int __exception do_debug_exception(unsigned long addr,
unsigned int esr,
struct pt_regs *regs)
{
const struct fault_info *inf = debug_fault_info + DBG_ESR_EVT(esr);
struct siginfo info;
if (!inf->fn(addr, esr, regs))
return 1;
pr_alert("Unhandled debug exception: %s (0x%08x) at 0x%016lx\n",
inf->name, esr, addr);
info.si_signo = inf->sig;
info.si_errno = 0;
info.si_code = inf->code;
info.si_addr = (void __user *)addr;
arm64_notify_die("", regs, &info, 0);
return 0;
}
| 0 | 58,392 |
Detect whether the following code contains vulnerabilities. | void CustomDrag::OnDragEnd(GtkWidget* widget, GdkDragContext* drag_context) {
delete this;
}
| 0 | 99,553 |
Detect whether the following code contains vulnerabilities. | php_mysqlnd_net_field_length_ll(zend_uchar **packet)
{
register zend_uchar *p= (zend_uchar *)*packet;
if (*p < 251) {
(*packet)++;
return (uint64_t) *p;
}
switch (*p) {
case 251:
(*packet)++;
return (uint64_t) MYSQLND_NULL_LENGTH;
case 252:
(*packet) += 3;
return (uint64_t) uint2korr(p + 1);
case 253:
(*packet) += 4;
return (uint64_t) uint3korr(p + 1);
default:
(*packet) += 9;
return (uint64_t) uint8korr(p + 1);
}
}
| 0 | 49,942 |
Detect whether the following code contains vulnerabilities. | void V8TestObject::UnscopableRuntimeEnabledLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_unscopableRuntimeEnabledLongAttribute_Getter");
test_object_v8_internal::UnscopableRuntimeEnabledLongAttributeAttributeGetter(info);
}
| 0 | 147,972 |
Detect whether the following code contains vulnerabilities. | void Document::ReportFeaturePolicyViolation(
mojom::FeaturePolicyFeature feature,
mojom::FeaturePolicyDisposition disposition,
const String& message) const {
if (!RuntimeEnabledFeatures::FeaturePolicyReportingEnabled())
return;
LocalFrame* frame = GetFrame();
if (!frame)
return;
const String& feature_name = GetNameForFeature(feature);
FeaturePolicyViolationReportBody* body =
MakeGarbageCollected<FeaturePolicyViolationReportBody>(
feature_name, "Feature policy violation",
(disposition == mojom::FeaturePolicyDisposition::kReport ? "report"
: "enforce"),
SourceLocation::Capture());
Report* report =
new Report("feature-policy-violation", Url().GetString(), body);
ReportingContext::From(this)->QueueReport(report);
bool is_null;
int line_number = body->lineNumber(is_null);
line_number = is_null ? 0 : line_number;
int column_number = body->columnNumber(is_null);
column_number = is_null ? 0 : column_number;
frame->GetReportingService()->QueueFeaturePolicyViolationReport(
Url(), feature_name,
(disposition == mojom::FeaturePolicyDisposition::kReport ? "report"
: "enforce"),
"Feature policy violation", body->sourceFile(), line_number,
column_number);
if (disposition == mojom::FeaturePolicyDisposition::kEnforce) {
frame->Console().AddMessage(ConsoleMessage::Create(
kViolationMessageSource, kErrorMessageLevel,
(message.IsEmpty() ? ("Feature policy violation: " + feature_name +
" is not allowed in this document.")
: message)));
}
}
| 0 | 165,456 |
Detect whether the following code contains vulnerabilities. | bool Textfield::GetCompositionTextRange(gfx::Range* range) const {
if (!ImeEditingAllowed())
return false;
model_->GetCompositionTextRange(range);
return true;
}
| 0 | 137,187 |
Detect whether the following code contains vulnerabilities. | static void __perf_event_enable(struct perf_event *event,
struct perf_cpu_context *cpuctx,
struct perf_event_context *ctx,
void *info)
{
struct perf_event *leader = event->group_leader;
struct perf_event_context *task_ctx;
if (event->state >= PERF_EVENT_STATE_INACTIVE ||
event->state <= PERF_EVENT_STATE_ERROR)
return;
if (ctx->is_active)
ctx_sched_out(ctx, cpuctx, EVENT_TIME);
__perf_event_mark_enabled(event);
if (!ctx->is_active)
return;
if (!event_filter_match(event)) {
if (is_cgroup_event(event))
perf_cgroup_defer_enabled(event);
ctx_sched_in(ctx, cpuctx, EVENT_TIME, current);
return;
}
/*
* If the event is in a group and isn't the group leader,
* then don't put it on unless the group is on.
*/
if (leader != event && leader->state != PERF_EVENT_STATE_ACTIVE) {
ctx_sched_in(ctx, cpuctx, EVENT_TIME, current);
return;
}
task_ctx = cpuctx->task_ctx;
if (ctx->task)
WARN_ON_ONCE(task_ctx != ctx);
ctx_resched(cpuctx, task_ctx);
}
| 0 | 68,290 |
Detect whether the following code contains vulnerabilities. | void refresh_sit_entry(struct f2fs_sb_info *sbi, block_t old, block_t new)
{
update_sit_entry(sbi, new, 1);
if (GET_SEGNO(sbi, old) != NULL_SEGNO)
update_sit_entry(sbi, old, -1);
locate_dirty_segment(sbi, GET_SEGNO(sbi, old));
locate_dirty_segment(sbi, GET_SEGNO(sbi, new));
}
| 0 | 85,416 |
Detect whether the following code contains vulnerabilities. | void WebLocalFrameImpl::PageSizeAndMarginsInPixels(int page_index,
WebDoubleSize& page_size,
int& margin_top,
int& margin_right,
int& margin_bottom,
int& margin_left) {
DoubleSize size = page_size;
GetFrame()->GetDocument()->PageSizeAndMarginsInPixels(
page_index, size, margin_top, margin_right, margin_bottom, margin_left);
page_size = size;
}
| 0 | 147,037 |
Detect whether the following code contains vulnerabilities. | EventListener* Document::getWindowAttributeEventListener(const AtomicString& eventType, DOMWrapperWorld* isolatedWorld)
{
DOMWindow* domWindow = this->domWindow();
if (!domWindow)
return 0;
return domWindow->getAttributeEventListener(eventType, isolatedWorld);
}
| 0 | 109,688 |
Detect whether the following code contains vulnerabilities. | P2PQuicTransportTest() {}
| 0 | 145,429 |
Detect whether the following code contains vulnerabilities. | followTab(TabBuffer * tab)
{
Buffer *buf;
Anchor *a;
#ifdef USE_IMAGE
a = retrieveCurrentImg(Currentbuf);
if (!(a && a->image && a->image->map))
#endif
a = retrieveCurrentAnchor(Currentbuf);
if (a == NULL)
return;
if (tab == CurrentTab) {
check_target = FALSE;
followA();
check_target = TRUE;
return;
}
_newT();
buf = Currentbuf;
check_target = FALSE;
followA();
check_target = TRUE;
if (tab == NULL) {
if (buf != Currentbuf)
delBuffer(buf);
else
deleteTab(CurrentTab);
}
else if (buf != Currentbuf) {
/* buf <- p <- ... <- Currentbuf = c */
Buffer *c, *p;
c = Currentbuf;
p = prevBuffer(c, buf);
p->nextBuffer = NULL;
Firstbuf = buf;
deleteTab(CurrentTab);
CurrentTab = tab;
for (buf = p; buf; buf = p) {
p = prevBuffer(c, buf);
pushBuffer(buf);
}
}
displayBuffer(Currentbuf, B_FORCE_REDRAW);
}
| 0 | 84,497 |
Detect whether the following code contains vulnerabilities. | void kvm_vcpu_kick(struct kvm_vcpu *vcpu)
{
int me;
int cpu = vcpu->cpu;
if (kvm_vcpu_wake_up(vcpu))
return;
me = get_cpu();
if (cpu != me && (unsigned)cpu < nr_cpu_ids && cpu_online(cpu))
if (kvm_arch_vcpu_should_kick(vcpu))
smp_send_reschedule(cpu);
put_cpu();
}
| 0 | 91,591 |
Detect whether the following code contains vulnerabilities. | WM_SYMBOL int WildMidi_Shutdown(void) {
if (!WM_Initialized) {
_WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
return (-1);
}
while (first_handle) {
/* closes open handle and rotates the handles list. */
WildMidi_Close((struct _mdi *) first_handle->handle);
}
WM_FreePatches();
free_gauss();
/* reset the globals */
_cvt_reset_options ();
_WM_MasterVolume = 948;
_WM_MixerOptions = 0;
_WM_fix_release = 0;
_WM_auto_amp = 0;
_WM_auto_amp_with_amp = 0;
_WM_reverb_room_width = 16.875f;
_WM_reverb_room_length = 22.5f;
_WM_reverb_listen_posx = 8.4375f;
_WM_reverb_listen_posy = 16.875f;
WM_Initialized = 0;
if (_WM_Global_ErrorS != NULL) free(_WM_Global_ErrorS);
return (0);
}
| 0 | 85,114 |
Detect whether the following code contains vulnerabilities. | static void msix_clr_pending(PCIDevice *dev, int vector)
{
*msix_pending_byte(dev, vector) &= ~msix_pending_mask(vector);
}
| 0 | 15,876 |
Detect whether the following code contains vulnerabilities. | MockDataWriter* NavigateAndReturnMockWriter(const GURL& url) {
content::WebContentsTester* web_contents_tester =
content::WebContentsTester::For(web_contents());
EXPECT_TRUE(web_contents_tester);
web_contents_tester->NavigateAndCommit(url);
return static_cast<MockDataWriter*>(observer_->GetWriterForTesting());
}
| 0 | 144,769 |
Detect whether the following code contains vulnerabilities. | bool OmniboxViewViews::ShouldShowPlaceholderText() const {
return Textfield::ShouldShowPlaceholderText() &&
!model()->is_caret_visible() && !model()->is_keyword_selected();
}
| 1 | 186,512 |
Detect whether the following code contains vulnerabilities. | void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect,
BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject)
{
paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, LayoutSize(), op, backgroundObject);
}
| 0 | 124,918 |
Detect whether the following code contains vulnerabilities. | void PrintODTiming(GF_Terminal *term, GF_ObjectManager *odm, u32 indent)
{
GF_MediaInfo odi;
u32 ind = indent;
u32 i, count;
if (!odm) return;
if (gf_term_get_object_info(term, odm, &odi) != GF_OK) return;
if (!odi.od) {
fprintf(stderr, "Service not attached\n");
return;
}
while (ind) {
fprintf(stderr, " ");
ind--;
}
if (! odi.generated_scene) {
fprintf(stderr, "- OD %d: ", odi.od->objectDescriptorID);
switch (odi.status) {
case 1:
fprintf(stderr, "Playing - ");
break;
case 2:
fprintf(stderr, "Paused - ");
break;
default:
fprintf(stderr, "Stopped - ");
break;
}
if (odi.buffer>=0) fprintf(stderr, "Buffer: %d ms - ", odi.buffer);
else fprintf(stderr, "Not buffering - ");
fprintf(stderr, "Clock drift: %d ms", odi.clock_drift);
fprintf(stderr, " - time: ");
PrintTime((u32) (odi.current_time*1000));
fprintf(stderr, "\n");
} else {
fprintf(stderr, "+ Service %s:\n", odi.service_url);
}
count = gf_term_get_object_count(term, odm);
for (i=0; i<count; i++) {
GF_ObjectManager *an_odm = gf_term_get_object(term, odm, i);
PrintODTiming(term, an_odm, indent+1);
}
return;
}
| 0 | 92,807 |
Detect whether the following code contains vulnerabilities. | _XcursorCommentLength (XcursorComment *comment)
{
return XCURSOR_COMMENT_HEADER_LEN + strlen (comment->comment);
}
| 0 | 1,420 |
Detect whether the following code contains vulnerabilities. | String HTMLInputElement::SanitizeValue(const String& proposed_value) const {
return input_type_->SanitizeValue(proposed_value);
}
| 0 | 136,955 |
Detect whether the following code contains vulnerabilities. | rdp_out_ts_glyphcache_capabilityset(STREAM s)
{
uint16 supportlvl = GLYPH_SUPPORT_FULL;
uint32 fragcache = 0x01000100;
out_uint16_le(s, RDP_CAPSET_GLYPHCACHE);
out_uint16_le(s, RDP_CAPLEN_GLYPHCACHE);
/* GlyphCache - 10 TS_CACHE_DEFINITION structures */
rdp_out_ts_cache_definition(s, 254, 4);
rdp_out_ts_cache_definition(s, 254, 4);
rdp_out_ts_cache_definition(s, 254, 8);
rdp_out_ts_cache_definition(s, 254, 8);
rdp_out_ts_cache_definition(s, 254, 16);
rdp_out_ts_cache_definition(s, 254, 32);
rdp_out_ts_cache_definition(s, 254, 64);
rdp_out_ts_cache_definition(s, 254, 128);
rdp_out_ts_cache_definition(s, 254, 256);
rdp_out_ts_cache_definition(s, 64, 2048);
out_uint32_le(s, fragcache); /* FragCache */
out_uint16_le(s, supportlvl); /* GlyphSupportLevel */
out_uint16_le(s, 0); /* pad2octets */
}
| 0 | 93,019 |
Detect whether the following code contains vulnerabilities. | void ecryptfs_put_lower_file(struct inode *inode)
{
struct ecryptfs_inode_info *inode_info;
inode_info = ecryptfs_inode_to_private(inode);
if (atomic_dec_and_mutex_lock(&inode_info->lower_file_count,
&inode_info->lower_file_mutex)) {
filemap_write_and_wait(inode->i_mapping);
fput(inode_info->lower_file);
inode_info->lower_file = NULL;
mutex_unlock(&inode_info->lower_file_mutex);
}
}
| 0 | 74,573 |
Detect whether the following code contains vulnerabilities. | static void tcp_ecn_create_request(struct request_sock *req,
const struct sk_buff *skb,
const struct sock *listen_sk,
const struct dst_entry *dst)
{
const struct tcphdr *th = tcp_hdr(skb);
const struct net *net = sock_net(listen_sk);
bool th_ecn = th->ece && th->cwr;
bool ect, ecn_ok;
u32 ecn_ok_dst;
if (!th_ecn)
return;
ect = !INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield);
ecn_ok_dst = dst_feature(dst, DST_FEATURE_ECN_MASK);
ecn_ok = net->ipv4.sysctl_tcp_ecn || ecn_ok_dst;
if ((!ect && ecn_ok) || tcp_ca_needs_ecn(listen_sk) ||
(ecn_ok_dst & DST_FEATURE_ECN_CA))
inet_rsk(req)->ecn_ok = 1;
}
| 0 | 51,540 |
Detect whether the following code contains vulnerabilities. | void RenderWidgetHostViewAura::UpdateLegacyWin() {
if (legacy_window_destroyed_ || !GetHostWindowHWND())
return;
if (!legacy_render_widget_host_HWND_) {
legacy_render_widget_host_HWND_ =
LegacyRenderWidgetHostHWND::Create(GetHostWindowHWND());
}
if (legacy_render_widget_host_HWND_) {
legacy_render_widget_host_HWND_->set_host(this);
legacy_render_widget_host_HWND_->UpdateParent(GetHostWindowHWND());
legacy_render_widget_host_HWND_->SetBounds(
window_->GetBoundsInRootWindow());
if (!host_->is_hidden())
legacy_render_widget_host_HWND_->Show();
}
}
| 0 | 144,996 |
Detect whether the following code contains vulnerabilities. | void WebContentsImpl::FriendZone::RemoveCreatedCallbackForTesting(
const CreatedCallback& callback) {
for (size_t i = 0; i < g_created_callbacks.Get().size(); ++i) {
if (g_created_callbacks.Get().at(i).Equals(callback)) {
g_created_callbacks.Get().erase(g_created_callbacks.Get().begin() + i);
return;
}
}
}
| 0 | 144,634 |
Detect whether the following code contains vulnerabilities. | void MessageLoop::SetThreadTaskRunnerHandle() {
DCHECK_EQ(this, current());
thread_task_runner_handle_.reset();
thread_task_runner_handle_.reset(new ThreadTaskRunnerHandle(task_runner_));
}
| 0 | 137,461 |
Detect whether the following code contains vulnerabilities. | InitializeTemporaryOriginsInfoTask(
QuotaManager* manager,
UsageTracker* temporary_usage_tracker)
: DatabaseTaskBase(manager),
has_registered_origins_(false) {
DCHECK(temporary_usage_tracker);
temporary_usage_tracker->GetCachedOrigins(&origins_);
}
| 0 | 101,033 |
Detect whether the following code contains vulnerabilities. | static void longAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
ExceptionState exceptionState(ExceptionState::SetterContext, "longAttr", "TestObject", info.Holder(), info.GetIsolate());
TestObject* imp = V8TestObject::toNative(info.Holder());
V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), exceptionState);
imp->setLongAttr(cppValue);
}
| 0 | 130,828 |
Detect whether the following code contains vulnerabilities. | void RenderView::OnImeSetComposition(
const string16& text,
const std::vector<WebKit::WebCompositionUnderline>& underlines,
int selection_start,
int selection_end) {
if (!pepper_delegate_.IsPluginFocused()) {
RenderWidget::OnImeSetComposition(text,
underlines,
selection_start,
selection_end);
}
}
| 0 | 103,818 |
Detect whether the following code contains vulnerabilities. | static NTSTATUS TCReadWriteDevice (BOOL write, PDEVICE_OBJECT deviceObject, PVOID buffer, LARGE_INTEGER offset, ULONG length)
{
NTSTATUS status;
IO_STATUS_BLOCK ioStatusBlock;
PIRP irp;
KEVENT completionEvent;
ASSERT (KeGetCurrentIrql() <= APC_LEVEL);
KeInitializeEvent (&completionEvent, NotificationEvent, FALSE);
irp = IoBuildSynchronousFsdRequest (write ? IRP_MJ_WRITE : IRP_MJ_READ, deviceObject, buffer, length, &offset, &completionEvent, &ioStatusBlock);
if (!irp)
return STATUS_INSUFFICIENT_RESOURCES;
ObReferenceObject (deviceObject);
status = IoCallDriver (deviceObject, irp);
if (status == STATUS_PENDING)
{
status = KeWaitForSingleObject (&completionEvent, Executive, KernelMode, FALSE, NULL);
if (NT_SUCCESS (status))
status = ioStatusBlock.Status;
}
ObDereferenceObject (deviceObject);
return status;
}
| 0 | 87,213 |
Detect whether the following code contains vulnerabilities. | void BassSetStrength(EffectContext *pContext, uint32_t strength){
pContext->pBundledContext->BassStrengthSaved = (int)strength;
LVM_ControlParams_t ActiveParams; /* Current control Parameters */
LVM_ReturnStatus_en LvmStatus=LVM_SUCCESS; /* Function call status */
/* Get the current settings */
LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance,
&ActiveParams);
LVM_ERROR_CHECK(LvmStatus, "LVM_GetControlParameters", "BassSetStrength")
/* Bass Enhancement parameters */
ActiveParams.BE_EffectLevel = (LVM_INT16)((15*strength)/1000);
ActiveParams.BE_CentreFreq = LVM_BE_CENTRE_90Hz;
/* Activate the initial settings */
LvmStatus = LVM_SetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
LVM_ERROR_CHECK(LvmStatus, "LVM_SetControlParameters", "BassSetStrength")
} /* end BassSetStrength */
| 0 | 174,808 |
Detect whether the following code contains vulnerabilities. | jbig2_hd_new(Jbig2Ctx *ctx, const Jbig2PatternDictParams *params, Jbig2Image *image)
{
Jbig2PatternDict *new;
const int N = params->GRAYMAX + 1;
const int HPW = params->HDPW;
const int HPH = params->HDPH;
int i;
/* allocate a new struct */
new = jbig2_new(ctx, Jbig2PatternDict, 1);
if (new != NULL) {
new->patterns = jbig2_new(ctx, Jbig2Image *, N);
if (new->patterns == NULL) {
jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1, "failed to allocate pattern in collective bitmap dictionary");
jbig2_free(ctx->allocator, new);
return NULL;
}
new->n_patterns = N;
new->HPW = HPW;
new->HPH = HPH;
/* 6.7.5(4) - copy out the individual pattern images */
for (i = 0; i < N; i++) {
new->patterns[i] = jbig2_image_new(ctx, HPW, HPH);
if (new->patterns[i] == NULL) {
int j;
jbig2_error(ctx, JBIG2_SEVERITY_WARNING, -1, "failed to allocate pattern element image");
for (j = 0; j < i; j++)
jbig2_free(ctx->allocator, new->patterns[j]);
jbig2_free(ctx->allocator, new);
return NULL;
}
/* compose with the REPLACE operator; the source
will be clipped to the destintion, selecting the
proper sub image */
jbig2_image_compose(ctx, new->patterns[i], image, -i * HPW, 0, JBIG2_COMPOSE_REPLACE);
}
} else {
jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1, "failed to allocate collective bitmap dictionary");
}
return new;
}
| 0 | 18,035 |
Detect whether the following code contains vulnerabilities. | bool FrameSelection::ShouldShowBlockCursor() const {
return frame_caret_->ShouldShowBlockCursor();
}
| 0 | 135,686 |
Detect whether the following code contains vulnerabilities. | void CompositorImpl::SetWindowBounds(const gfx::Size& size) {
if (size_ == size)
return;
size_ = size;
if (host_) {
host_->SetViewportSizeAndScale(size_, root_window_->GetDipScale(),
GenerateLocalSurfaceId());
}
if (display_)
display_->Resize(size);
if (display_private_)
display_private_->Resize(size);
root_window_->GetLayer()->SetBounds(size);
}
| 0 | 143,537 |
Detect whether the following code contains vulnerabilities. | bool LockContentsView::AcceleratorPressed(const ui::Accelerator& accelerator) {
auto entry = accel_map_.find(accelerator);
if (entry == accel_map_.end())
return false;
PerformAction(entry->second);
return true;
}
| 0 | 144,166 |
Detect whether the following code contains vulnerabilities. | int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime,
unsigned int cond,
snd_pcm_hw_param_t var,
const struct snd_pcm_hw_constraint_ratdens *r)
{
return snd_pcm_hw_rule_add(runtime, cond, var,
snd_pcm_hw_rule_ratdens, (void *)r,
var, -1);
}
| 0 | 47,813 |
Detect whether the following code contains vulnerabilities. | static bool NeedsHistoryItemRestore(WebFrameLoadType type) {
return type == WebFrameLoadType::kBackForward || IsReloadLoadType(type);
}
| 0 | 107,757 |
Detect whether the following code contains vulnerabilities. | vmcs12_guest_cr0(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
{
return
/*1*/ (vmcs_readl(GUEST_CR0) & vcpu->arch.cr0_guest_owned_bits) |
/*2*/ (vmcs12->guest_cr0 & vmcs12->cr0_guest_host_mask) |
/*3*/ (vmcs_readl(CR0_READ_SHADOW) & ~(vmcs12->cr0_guest_host_mask |
vcpu->arch.cr0_guest_owned_bits));
}
| 0 | 37,197 |
Detect whether the following code contains vulnerabilities. | static int brcmf_dev_pno_config(struct brcmf_if *ifp,
struct cfg80211_sched_scan_request *request)
{
struct brcmf_pno_param_le pfn_param;
struct brcmf_pno_macaddr_le pfn_mac;
s32 err;
u8 *mac_mask;
int i;
memset(&pfn_param, 0, sizeof(pfn_param));
pfn_param.version = cpu_to_le32(BRCMF_PNO_VERSION);
/* set extra pno params */
pfn_param.flags = cpu_to_le16(1 << BRCMF_PNO_ENABLE_ADAPTSCAN_BIT);
pfn_param.repeat = BRCMF_PNO_REPEAT;
pfn_param.exp = BRCMF_PNO_FREQ_EXPO_MAX;
/* set up pno scan fr */
pfn_param.scan_freq = cpu_to_le32(BRCMF_PNO_TIME);
err = brcmf_fil_iovar_data_set(ifp, "pfn_set", &pfn_param,
sizeof(pfn_param));
if (err) {
brcmf_err("pfn_set failed, err=%d\n", err);
return err;
}
/* Find out if mac randomization should be turned on */
if (!(request->flags & NL80211_SCAN_FLAG_RANDOM_ADDR))
return 0;
pfn_mac.version = BRCMF_PFN_MACADDR_CFG_VER;
pfn_mac.flags = BRCMF_PFN_MAC_OUI_ONLY | BRCMF_PFN_SET_MAC_UNASSOC;
memcpy(pfn_mac.mac, request->mac_addr, ETH_ALEN);
mac_mask = request->mac_addr_mask;
for (i = 0; i < ETH_ALEN; i++) {
pfn_mac.mac[i] &= mac_mask[i];
pfn_mac.mac[i] |= get_random_int() & ~(mac_mask[i]);
}
/* Clear multi bit */
pfn_mac.mac[0] &= 0xFE;
/* Set locally administered */
pfn_mac.mac[0] |= 0x02;
err = brcmf_fil_iovar_data_set(ifp, "pfn_macaddr", &pfn_mac,
sizeof(pfn_mac));
if (err)
brcmf_err("pfn_macaddr failed, err=%d\n", err);
return err;
}
| 0 | 49,063 |
Detect whether the following code contains vulnerabilities. | void AudioRendererHost::SendErrorMessage(int32 render_view_id,
int32 stream_id) {
ViewMsg_AudioStreamState_Params state;
state.state = ViewMsg_AudioStreamState_Params::kError;
Send(new ViewMsg_NotifyAudioStreamStateChanged(
render_view_id, stream_id, state));
}
| 0 | 108,384 |
Detect whether the following code contains vulnerabilities. | void SimpleSoftOMXComponent::onPortEnable(OMX_U32 portIndex, bool enable) {
CHECK_LT(portIndex, mPorts.size());
PortInfo *port = &mPorts.editItemAt(portIndex);
CHECK_EQ((int)port->mTransition, (int)PortInfo::NONE);
CHECK(port->mDef.bEnabled == !enable);
if (!enable) {
port->mDef.bEnabled = OMX_FALSE;
port->mTransition = PortInfo::DISABLING;
for (size_t i = 0; i < port->mBuffers.size(); ++i) {
BufferInfo *buffer = &port->mBuffers.editItemAt(i);
if (buffer->mOwnedByUs) {
buffer->mOwnedByUs = false;
if (port->mDef.eDir == OMX_DirInput) {
notifyEmptyBufferDone(buffer->mHeader);
} else {
CHECK_EQ(port->mDef.eDir, OMX_DirOutput);
notifyFillBufferDone(buffer->mHeader);
}
}
}
port->mQueue.clear();
} else {
port->mTransition = PortInfo::ENABLING;
}
checkTransitions();
}
| 0 | 177,169 |
Detect whether the following code contains vulnerabilities. | void DefragTrackerRelease(DefragTracker *t)
{
(void) DefragTrackerDecrUsecnt(t);
SCMutexUnlock(&t->lock);
}
| 0 | 67,833 |
Detect whether the following code contains vulnerabilities. | bool param_get_location(
const char *parameter,
MyString &filename,
int &line_number)
{
bool found_it;
if (parameter != NULL && extra_info != NULL) {
found_it = extra_info->GetParam(parameter, filename, line_number);
} else {
found_it = false;
}
return found_it;
}
| 0 | 16,514 |
Detect whether the following code contains vulnerabilities. | int phar_open_or_create_zip(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error) /* {{{ */
{
phar_archive_data *phar;
int ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error);
if (FAILURE == ret) {
return FAILURE;
}
if (pphar) {
*pphar = phar;
}
phar->is_data = is_data;
if (phar->is_zip) {
return ret;
}
if (phar->is_brandnew) {
phar->internal_file_start = 0;
phar->is_zip = 1;
phar->is_tar = 0;
return SUCCESS;
}
/* we've reached here - the phar exists and is a regular phar */
if (error) {
spprintf(error, 4096, "phar zip error: phar \"%s\" already exists as a regular phar and must be deleted from disk prior to creating as a zip-based phar", fname);
}
return FAILURE;
}
/* }}} */
| 0 | 49,904 |
Detect whether the following code contains vulnerabilities. | static void mem_cgroup_oom_notify(struct mem_cgroup *memcg)
{
struct mem_cgroup *iter;
for_each_mem_cgroup_tree(iter, memcg)
mem_cgroup_oom_notify_cb(iter);
}
| 0 | 21,100 |
Detect whether the following code contains vulnerabilities. | bool Document::IsLoadCompleted() {
return ready_state_ == kComplete;
}
| 0 | 146,777 |
Detect whether the following code contains vulnerabilities. | bool UrlData::IsPreloading() const {
return preloading_ > 0 && playing_ == 0;
}
| 0 | 157,140 |
Detect whether the following code contains vulnerabilities. | static void deprecatedStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::StaticReadonlyAttribute);
TestObjectV8Internal::deprecatedStaticReadOnlyAttrAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| 0 | 130,725 |
Detect whether the following code contains vulnerabilities. | void Set(const std::string& addr, int value) {
base::AutoLock lock(lock_);
map_[addr] = value;
}
| 1 | 184,416 |
Detect whether the following code contains vulnerabilities. | unsigned HTMLFormElement::length() const {
unsigned len = 0;
for (const auto& element : ListedElements()) {
if (element->IsEnumeratable())
++len;
}
return len;
}
| 0 | 165,167 |
Detect whether the following code contains vulnerabilities. | virDomainPMSuspendForDuration(virDomainPtr dom,
unsigned int target,
unsigned long long duration,
unsigned int flags)
{
virConnectPtr conn;
VIR_DOMAIN_DEBUG(dom, "target=%u duration=%llu flags=%x",
target, duration, flags);
virResetLastError();
virCheckDomainReturn(dom, -1);
conn = dom->conn;
virCheckReadOnlyGoto(conn->flags, error);
if (conn->driver->domainPMSuspendForDuration) {
int ret;
ret = conn->driver->domainPMSuspendForDuration(dom, target,
duration, flags);
if (ret < 0)
goto error;
return ret;
}
virReportUnsupportedError();
error:
virDispatchError(conn);
return -1;
}
| 0 | 93,892 |
Detect whether the following code contains vulnerabilities. | void GLES2DecoderImpl::RestoreStateForNonRenderableTextures() {
DCHECK(current_program_);
DCHECK(!current_program_->IsDeleted());
const ProgramManager::ProgramInfo::SamplerIndices& sampler_indices =
current_program_->sampler_indices();
for (size_t ii = 0; ii < sampler_indices.size(); ++ii) {
const ProgramManager::ProgramInfo::UniformInfo* uniform_info =
current_program_->GetUniformInfo(sampler_indices[ii]);
DCHECK(uniform_info);
for (size_t jj = 0; jj < uniform_info->texture_units.size(); ++jj) {
GLuint texture_unit_index = uniform_info->texture_units[jj];
if (texture_unit_index < group_->max_texture_units()) {
TextureUnit& texture_unit = texture_units_[texture_unit_index];
TextureManager::TextureInfo* texture_info =
uniform_info->type == GL_SAMPLER_2D ?
texture_unit.bound_texture_2d :
texture_unit.bound_texture_cube_map;
if (!texture_info || !texture_info->CanRender(texture_manager())) {
glActiveTexture(GL_TEXTURE0 + texture_unit_index);
texture_info = texture_unit.bind_target == GL_TEXTURE_2D ?
texture_unit.bound_texture_2d :
texture_unit.bound_texture_cube_map;
glBindTexture(texture_unit.bind_target,
texture_info ? texture_info->service_id() : 0);
}
}
}
}
glActiveTexture(GL_TEXTURE0 + active_texture_unit_);
}
| 0 | 108,141 |
Detect whether the following code contains vulnerabilities. | FontSelector* OffscreenCanvas::GetFontSelector() {
if (auto* document = DynamicTo<Document>(GetExecutionContext())) {
return document->GetStyleEngine().GetFontSelector();
}
return To<WorkerGlobalScope>(GetExecutionContext())->GetFontSelector();
}
| 0 | 165,062 |
Detect whether the following code contains vulnerabilities. | const URLPatternSet& PermissionsData::default_policy_allowed_hosts() {
return default_policy_restrictions.Get().allowed_hosts;
}
| 0 | 164,430 |
Detect whether the following code contains vulnerabilities. | void HostCache::Entry::GetStaleness(base::TimeTicks now,
int network_changes,
EntryStaleness* out) const {
DCHECK(out);
out->expired_by = now - expires_;
out->network_changes = network_changes - network_changes_;
out->stale_hits = stale_hits_;
}
| 0 | 139,348 |
Detect whether the following code contains vulnerabilities. | explicit ResourceUsageReporterImpl(
mojo::InterfaceRequest<ResourceUsageReporter> req)
: binding_(this, req.Pass()) {}
| 0 | 133,844 |
Detect whether the following code contains vulnerabilities. | void install_local_socket(asocket* s) {
adb_mutex_lock(&socket_list_lock);
s->id = local_socket_next_id++;
if (local_socket_next_id == 0) {
local_socket_next_id = 1;
}
insert_local_socket(s, &local_socket_list);
adb_mutex_unlock(&socket_list_lock);
}
| 1 | 188,174 |
Detect whether the following code contains vulnerabilities. | bool ContentSecurityPolicy::IsValidCSPAttr(const String& attr,
const String& context_required_csp) {
if (attr.Contains('\n') || attr.Contains('\r'))
return false;
ContentSecurityPolicy* attr_policy = ContentSecurityPolicy::Create();
attr_policy->AddPolicyFromHeaderValue(attr,
kContentSecurityPolicyHeaderTypeEnforce,
kContentSecurityPolicyHeaderSourceHTTP);
if (!attr_policy->console_messages_.IsEmpty() ||
attr_policy->policies_.size() != 1) {
return false;
}
for (auto& directiveList : attr_policy->policies_) {
if (directiveList->ReportEndpoints().size() != 0)
return false;
}
if (context_required_csp.IsEmpty() || context_required_csp.IsNull()) {
return true;
}
ContentSecurityPolicy* context_policy = ContentSecurityPolicy::Create();
context_policy->AddPolicyFromHeaderValue(
context_required_csp, kContentSecurityPolicyHeaderTypeEnforce,
kContentSecurityPolicyHeaderSourceHTTP);
DCHECK(context_policy->console_messages_.IsEmpty() &&
context_policy->policies_.size() == 1);
return context_policy->Subsumes(*attr_policy);
}
| 0 | 165,529 |
Detect whether the following code contains vulnerabilities. | static int tg3_nvram_read(struct tg3 *tp, u32 offset, u32 *val)
{
int ret;
if (!tg3_flag(tp, NVRAM))
return tg3_nvram_read_using_eeprom(tp, offset, val);
offset = tg3_nvram_phys_addr(tp, offset);
if (offset > NVRAM_ADDR_MSK)
return -EINVAL;
ret = tg3_nvram_lock(tp);
if (ret)
return ret;
tg3_enable_nvram_access(tp);
tw32(NVRAM_ADDR, offset);
ret = tg3_nvram_exec_cmd(tp, NVRAM_CMD_RD | NVRAM_CMD_GO |
NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_DONE);
if (ret == 0)
*val = tr32(NVRAM_RDDATA);
tg3_disable_nvram_access(tp);
tg3_nvram_unlock(tp);
return ret;
}
| 0 | 32,637 |
Detect whether the following code contains vulnerabilities. | static int ioperm_active(struct task_struct *target,
const struct user_regset *regset)
{
return target->thread.io_bitmap_max / regset->size;
}
| 0 | 25,900 |
End of preview.
We provide pre-processed code vulnerbility detection datasets to facilitate LLM fine-tuning.
- Downloads last month
- 47