unique_id int64 200 186k | target int64 0 1 | code stringlengths 76 52.1k | __index_level_0__ int64 0 199 |
|---|---|---|---|
73,752 | 1 | static int virtnet_probe(struct virtio_device *vdev)
{
int i, err;
struct net_device *dev;
struct virtnet_info *vi;
u16 max_queue_pairs;
if (!vdev->config->get) {
dev_err(&vdev->dev, "%s failure: config access disabled\n",
__func__);
return -EINVAL;
}
if (!virtnet_validate_features(vdev))
return -EINV... | 0 |
54,196 | 1 | int scsi_req_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf)
{
int rc;
cmd->lba = -1;
cmd->len = scsi_cdb_length(buf);
switch (dev->type) {
case TYPE_TAPE:
rc = scsi_req_stream_xfer(cmd, dev, buf);
break;
case TYPE_MEDIUM_CHANGER:
rc = scsi_req_medium_changer... | 1 |
169,124 | 1 | AnimationThread(void *)
{
ZipReader reader;
if (!reader.OpenArchive("/system/media/bootanimation.zip")) {
LOGW("Could not open boot animation");
return nullptr;
}
const cdir_entry *entry = nullptr;
const local_file_header *file = nullptr;
while ((entry = reader.GetNextEntry(entr... | 2 |
109,551 | 1 | static inline void
AddWeightedPathSegs(double aCoeff1,
SVGPathDataAndInfo::const_iterator& aSeg1,
double aCoeff2,
SVGPathDataAndInfo::const_iterator& aSeg2,
SVGPathDataAndInfo::iterator& aResultSeg)
{
MOZ_ASSERT(aSeg2, "2nd segment must b... | 3 |
78,906 | 1 | int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
{
int ret = get_buffer_internal(avctx, frame, flags);
if (ret < 0)
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
| 4 |
169,746 | 1 | dissct_rsl_ipaccess_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
{
guint8 msg_type;
guint32 local_addr = 0;
guint16 local_port = 0;
address src_addr;
msg_type = tvb_get_guint8(tvb, offset) & 0x7f;
offset++;
/* parse TLV attributes */
while (tvb_reported_length_... | 5 |
145,939 | 1 | static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
int entries, i, j;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
sc = st->priv_data;
avio_rb32(pb); // version + flags
entries = avio_rb... | 6 |
154,252 | 1 | IsMarkedInternal(T** thingp)
{
return IsMarkedInternalCommon(thingp);
}
| 7 |
38,512 | 1 | static void esp_do_dma(ESPState *s)
{
uint32_t len;
int to_device;
to_device = (s->ti_size < 0);
len = s->dma_left;
if (s->do_cmd) {
trace_esp_do_dma(s->cmdlen, len);
s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], len);
s->ti_size = 0;
s->cmdlen = 0;
... | 8 |
96,336 | 1 | static void vmsvga_fifo_run(struct vmsvga_state_s *s)
{
uint32_t cmd, colour;
int args, len;
int x, y, dx, dy, width, height;
struct vmsvga_cursor_definition_s cursor;
uint32_t cmd_start;
len = vmsvga_fifo_length(s);
while (len > 0) {
/* May need to go back to the start of the comma... | 9 |
123,788 | 1 | dissect_openflow_match_v5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
{
proto_item *ti;
proto_tree *match_tree;
guint16 match_type;
guint16 match_length;
gint32 fields_end;
guint16 pad_length;
match_tree = proto_tree_add_subtree(tree, tvb, offset... | 10 |
185,961 | 1 | int sock_setsockopt(struct socket *sock, int level, int optname,
char __user *optval, unsigned int optlen)
{
struct sock *sk = sock->sk;
int val;
int valbool;
struct linger ling;
int ret = 0;
/*
* Options without arguments
*/
if (optname == SO_BINDTODEVICE)
return sock_setbindtodevice(sk, optval, o... | 11 |
158,921 | 1 | static int atusb_read_reg(struct atusb *atusb, uint8_t reg)
{
struct usb_device *usb_dev = atusb->usb_dev;
int ret;
uint8_t value;
dev_dbg(&usb_dev->dev, "atusb: reg = 0x%x\n", reg);
ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
ATUSB_REG_READ, ATUSB_REQ_FROM_DEV,
0, reg, &value, 1, 1000);
... | 12 |
28,508 | 1 | int CVE_2005_3181_VULN_open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
{
int acc_mode, error = 0;
struct path path;
struct dentry *dir;
int count = 0;
acc_mode = ACC_MODE(flag);
/* Allow the LSM permission hook to distinguish append
access from general write access. */
if (flag... | 13 |
83,192 | 1 | static int CVE_2006_2934_VULN_do_basic_checks(struct ip_conntrack *conntrack,
const struct sk_buff *skb,
char *map)
{
u_int32_t offset, count;
sctp_chunkhdr_t _sch, *sch;
int flag;
DEBUGP(__FUNCTION__);
DEBUGP("\n");
flag = 0;
for_each_sctp_chunk (skb, sch, _sch, offset, count) {
DEBUGP("Chunk N... | 14 |
111,482 | 1 | SECStatus
CVE_2006_5462_VULN_RSA_CheckSign(NSSLOWKEYPublicKey *key,
unsigned char * sign,
unsigned int sign_len,
unsigned char * hash,
unsigned int hash_len)
{
SECStatus rv;
unsigned int modulus_len = nsslowkey_PublicModulusLen(key);
unsig... | 15 |
35,780 | 1 | static int CVE_2008_3792_VULN_sctp_getsockopt_local_auth_chunks(struct sock *sk, int len,
char __user *optval, int __user *optlen)
{
struct sctp_authchunks __user *p = (void __user *)optval;
struct sctp_authchunks val;
struct sctp_association *asoc;
struct sctp_chunks_param *ch;
u32 num_chunks;
char __... | 16 |
137,451 | 1 | static int CVE_2008_3792_VULN_sctp_getsockopt_peer_auth_chunks(struct sock *sk, int len,
char __user *optval, int __user *optlen)
{
struct sctp_authchunks __user *p = (void __user *)optval;
struct sctp_authchunks val;
struct sctp_association *asoc;
struct sctp_chunks_param *ch;
u32 num_chunks;
char __u... | 17 |
145,716 | 1 | struct nfs_server *CVE_2009_1336_VULN_nfs_clone_server(struct nfs_server *source,
struct nfs_fh *fh,
struct nfs_fattr *fattr)
{
struct nfs_server *server;
struct nfs_fattr fattr_fsinfo;
int error;
dprintk("--> CVE_2009_1336_VULN_nfs_clone_server(,%llx:%llx,)\n",
(unsigned long long) fattr->fsid.m... | 18 |
113,535 | 1 | static void CVE_2009_1389_VULN_rtl_hw_start_8101(struct net_device *dev)
{
struct rtl8169_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp->mmio_addr;
struct pci_dev *pdev = tp->pci_dev;
if ((tp->mac_version == RTL_GIGA_MAC_VER_13) ||
(tp->mac_version == RTL_GIGA_MAC_VER_16)) {
int cap = tp->pcie_c... | 19 |
163,328 | 1 | ssize_t
CVE_2009_1961_VULN_generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
loff_t *ppos, size_t len, unsigned int flags)
{
struct address_space *mapping = out->f_mapping;
struct inode *inode = mapping->host;
struct splice_desc sd = {
.total_len = len,
.flags = flags,
.pos = *ppos... | 20 |
10,336 | 1 | static const char *CVE_2009_4308_VULN_ext4_decode_error(struct super_block *sb, int errno,
char nbuf[16])
{
char *errstr = NULL;
switch (errno) {
case -EIO:
errstr = "IO failure";
break;
case -ENOMEM:
errstr = "Out of memory";
break;
case -EROFS:
if (!sb || EXT4_SB(sb)->s_journal->j_flags & JBD... | 21 |
99,329 | 1 | /* */
static FT_Error
CVE_2010_2519_VULN_Mac_Read_POST_Resource( FT_Library library,
FT_Stream stream,
FT_Long *offsets,
FT_Long resource_cnt,
... | 22 |
120,922 | 1 | static __be32
CVE_2010_2521_VULN_nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
{
DECODE_HEAD;
struct nfsd4_op *op;
struct nfsd4_minorversion_ops *ops;
int i;
/*
* XXX: According to spec, we should check the tag
* for UTF-8 compliance. I'm postponing this for
* now because it seems that some client... | 23 |
146,584 | 1 | int CVE_2010_3015_VULN_ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
ext4_lblk_t iblock,
unsigned int max_blocks, struct buffer_head *bh_result,
int flags)
{
struct ext4_ext_path *path = NULL;
struct ext4_extent_header *eh;
struct ext4_extent newex, *ex;
ext4_fsblk_t newblock;
int err = 0, de... | 24 |
164,683 | 1 | static int CVE_2010_3876_VULN_packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
{
struct net_device *dev;
struct sock *sk = sock->sk;
if (peer)
return -EOPNOTSUPP;
uaddr->sa_family = AF_PACKET;
rcu_read_lock();
dev = dev_get_by_index_rcu(sock_net(sk), pkt_sk(... | 25 |
146,404 | 1 | static tvbuff_t *
CVE_2011_1138_VULN_dissect_6lowpan_iphc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint dgram_size)
{
gint offset = 0;
gint length;
proto_tree * iphc_tree = NULL;
proto_item * ti = NULL;
proto_item * ti_sam = NULL;
pr... | 26 |
25,240 | 1 | static void CVE_2011_1477_VULN_opl3_panning(int dev, int voice, int value)
{
devc->voc[voice].panning = value;
}
| 27 |
157,744 | 1 | nsresult
CVE_2011_1712_VULN_txXPathNodeUtils::getXSLTId(const txXPathNode& aNode,
nsAString& aResult)
{
if (!aNode.isAttribute()) {
CopyASCIItoUTF16(nsPrintfCString(kFmtSize, gPrintfFmt, aNode.mNode),
aResult);
}
else {
CopyASCIItoUTF16(ns... | 28 |
122,434 | 1 | void
CVE_2011_3000_VULN_nsHttpHeaderArray::ParseHeaderLine(const char *line,
nsHttpAtom *hdr,
char **val)
{
//
// BNF from section 4.2 of RFC 2616:
//
// message-header = field-name ":" [ field-value ]
// field-name = toke... | 29 |
111,495 | 1 | nsresult
CVE_2011_3000_VULN_nsHttpHeaderArray::SetHeader(nsHttpAtom header,
const nsACString &value,
PRBool merge)
{
nsEntry *entry = nsnull;
PRInt32 index;
index = LookupEntry(header, &entry);
// If an empty value is passed in, then delete the... | 30 |
63,007 | 1 | static int CVE_2011_3192_VULN_ap_set_byterange(request_rec *r)
{
const char *range;
const char *if_range;
const char *match;
const char *ct;
int num_ranges;
if (r->assbackwards) {
return 0;
}
/* Check for Range request-header (HTTP/1.1) or Request-Range for
* backwards-com... | 31 |
104,976 | 1 | static int CVE_2011_3362_VULN_decode_residual_block(AVSContext *h, GetBitContext *gb,
const struct dec_2dvlc *r, int esc_golomb_order,
int qp, uint8_t *dst, int stride) {
int i, level_code, esc_code, level, run, mask;
DCTELEM level_buf[65];
u... | 32 |
157,963 | 1 | static int CVE_2011_3936_VULN_dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4],
const DVprofile *sys)
{
int size, chan, i, j, d, of, smpls, freq, quant, half_ch;
uint16_t lc, rc;
const uint8_t* as_pack;
uint8_t *pcm, ipcm;
as_pack = dv_extract_pack(frame, dv_audio_sourc... | 33 |
119,849 | 1 | void
CVE_2012_0041_VULN_dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header,
const guchar *pd, frame_data *fd, column_info *cinfo)
{
if (cinfo != NULL)
col_init(cinfo);
memset(&edt->pi, 0, sizeof(edt->pi));
edt->pi.current_proto = "<Missing Protocol Name>";
edt->pi.cinfo = cinfo;
... | 34 |
154,658 | 1 | long CVE_2012_0058_VULN_do_io_submit(aio_context_t ctx_id, long nr,
struct iocb __user *__user *iocbpp, bool compat)
{
struct kioctx *ctx;
long ret = 0;
int i = 0;
struct blk_plug plug;
struct kiocb_batch batch;
if (unlikely(nr < 0))
return -EINVAL;
if (unlikely(nr > LONG_MAX/sizeof(*iocbpp)))
nr = LON... | 35 |
150,349 | 1 | static JSBool
CVE_2012_0464_VULN_array_toString_sub(JSContext *cx, JSObject *obj, JSBool locale,
JSString *sepstr, Value *rval)
{
static const jschar comma = ',';
const jschar *sep;
size_t seplen;
if (sepstr) {
seplen = sepstr->length();
sep = sepstr->getChars(cx);
... | 36 |
81,848 | 1 | nsSVGFE::ScaleInfo
CVE_2012_0470_VULN_nsSVGFE::SetupScalingFilter(nsSVGFilterInstance *aInstance,
const Image *aSource, const Image *aTarget,
const nsIntRect& aDataRect,
nsSVGNumberPair *aKernelUnitLength)
{
ScaleInfo result;
result... | 37 |
27,200 | 1 | NS_IMETHODIMP CVE_2012_0471_VULN_nsGBKToUnicode::ConvertNoBuff(const char* aSrc,
PRInt32 * aSrcLength,
PRUnichar *aDest,
PRInt32 * aDestLength)
{
PRInt32 i=0;
PRInt32 iSrcLength = (*aS... | 38 |
84,129 | 1 | static void CVE_2012_1146_VULN_mem_cgroup_usage_unregister_event(struct cgroup *cgrp,
struct cftype *cft, struct eventfd_ctx *eventfd)
{
struct mem_cgroup *memcg = mem_cgroup_from_cont(cgrp);
struct mem_cgroup_thresholds *thresholds;
struct mem_cgroup_threshold_ary *new;
int type = MEMFILE_TYPE(cft->private);
u64... | 39 |
58,019 | 1 | float *CVE_2012_1960_VULN_build_input_gamma_table(struct curveType *TRC)
{
float *gamma_table;
if (!TRC) return NULL;
gamma_table = malloc(sizeof(float)*256);
if (gamma_table) {
if (TRC->type == PARAMETRIC_CURVE_TYPE) {
compute_curve_gamma_table_type_parametric(gamma_table, TRC->parameter, TRC->count);
} el... | 40 |
88,033 | 1 | float CVE_2012_1960_VULN_clamp_float(float a)
{
if (a > 1.)
return 1.;
else if (a < 0)
return 0;
else
return a;
}
| 41 |
64,809 | 1 | void CVE_2012_1960_VULN_compute_curve_gamma_table_type1(float gamma_table[256], double gamma)
{
unsigned int i;
for (i = 0; i < 256; i++) {
gamma_table[i] = pow(i/255., gamma);
}
}
| 42 |
6,158 | 1 | nsresult
CVE_2012_1973_VULN_nsObjectLoadingContent::LoadObject(nsIURI* aURI,
bool aNotify,
const nsCString& aTypeHint,
bool aForceLoad)
{
LOG(("OBJLC [%p]: Loading object: URI=<%p> notify=%i type=<%s> forceload=%i... | 43 |
127,755 | 1 | static int CVE_2012_2100_VULN_ext4_fill_flex_info(struct super_block *sb)
{
struct ext4_sb_info *sbi = EXT4_SB(sb);
struct ext4_group_desc *gdp = NULL;
ext4_group_t flex_group_count;
ext4_group_t flex_group;
int groups_per_flex = 0;
size_t size;
int i;
sbi->s_log_groups_per_flex = sbi->s_es->s_log_groups_per_f... | 44 |
73,161 | 1 | static ssize_t CVE_2012_2375_VULN___nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t buflen)
{
struct page *pages[NFS4ACL_MAXPAGES] = {NULL, };
struct nfs_getaclargs args = {
.fh = NFS_FH(inode),
.acl_pages = pages,
.acl_len = buflen,
};
struct nfs_getaclres res = {
.acl_len = buflen,
};
void ... | 45 |
1,981 | 1 | static void CVE_2012_2390_VULN_hugetlb_vm_op_close(struct vm_area_struct *vma)
{
struct hstate *h = hstate_vma(vma);
struct resv_map *reservations = vma_resv_map(vma);
struct hugepage_subpool *spool = subpool_vma(vma);
unsigned long reserve;
unsigned long start;
unsigned long end;
if (reservations) {
start = ... | 46 |
45,141 | 1 | static int CVE_2012_3364_VULN_nci_extract_activation_params_iso_dep(struct nci_dev *ndev,
struct nci_rf_intf_activated_ntf *ntf, __u8 *data)
{
struct activation_params_nfca_poll_iso_dep *nfca_poll;
struct activation_params_nfcb_poll_iso_dep *nfcb_poll;
switch (ntf->activation_rf_tech_and_mode) {
case NCI_NFC_A_... | 47 |
4,741 | 1 | nsresult
CVE_2012_3957_VULN_nsBlockFrame::AddFrames(nsFrameList& aFrameList, nsIFrame* aPrevSibling)
{
// Clear our line cursor, since our lines may change.
ClearLineCursor();
if (aFrameList.IsEmpty()) {
return NS_OK;
}
// If we're inserting at the beginning of our list and we have an
// inside bullet... | 48 |
1,591 | 1 | nsresult
CVE_2012_3972_VULN_txFormatNumberFunctionCall::evaluate(txIEvalContext* aContext,
txAExprResult** aResult)
{
*aResult = nsnull;
if (!requireParams(2, 3, aContext))
return NS_ERROR_XPATH_BAD_ARGUMENT_COUNT;
// Get number and format
double value;
... | 49 |
147,185 | 1 | static int
CVE_2012_4287_VULN_dissect_mongo_update(tvbuff_t *tvb, guint offset, proto_tree *tree)
{
proto_item *ti;
proto_tree *flags_tree;
proto_tree_add_item(tree, hf_mongo_zero, tvb, offset, 4, ENC_NA);
offset += 4;
offset += dissect_fullcollectionname(tvb, offset, tree);
ti = proto_tree_add_item(tree... | 50 |
86,705 | 1 | static void
CVE_2012_4288_VULN_dissect_xtp_ecntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint32 offset) {
guint32 len = tvb_length_remaining(tvb, offset);
guint32 start = offset;
proto_item *top_ti;
proto_tree *xtp_subtree;
struct xtp_ecntl ecntl[1];
guint64 *spans, *p;
guint32 spans_len;
guint ... | 51 |
46,166 | 1 | static gint
CVE_2012_4289_VULN_dissect_query_afp_set_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
{
guint16 bitmap;
PAD(1);
offset = decode_vol_did(tree, tvb, offset);
bitmap = decode_acl_list_bitmap(tvb, tree, offset);
offset += 2;
offset = decode_name(tree, pinfo, tvb, offset);
off... | 52 |
28,360 | 1 | static gint
CVE_2012_4289_VULN_dissect_reply_afp_get_acl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
{
guint16 bitmap;
bitmap = decode_acl_list_bitmap(tvb, tree, offset);
offset += 2;
offset = decode_uuid_acl(tvb, tree, offset, bitmap);
return offset;
}
| 53 |
85,178 | 1 | void CVE_2012_4293_VULN_proto_register_ecat_mailbox(void)
{
static const true_false_string flags_set_truth =
{
"Set",
"Not set"
};
static hf_register_info hf[] =
{
{ &hf_ecat_mailboxlength,
{ "Length", "ecat_mailbox.length",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL... | 54 |
107,759 | 1 | void
CVE_2012_5354_VULN_nsComboboxControlFrame::SetFocus(bool aOn, bool aRepaint)
{
nsWeakFrame weakFrame(this);
if (aOn) {
nsListControlFrame::ComboboxFocusSet();
mFocused = this;
} else {
mFocused = nsnull;
if (mDroppedDown) {
mListControlFrame->ComboboxFinish(mDisplayedIndex); // might d... | 55 |
75,324 | 1 | static void
CVE_2012_6056_VULN_dissect_sack_chunk(packet_info* pinfo, tvbuff_t *chunk_tvb, proto_tree *chunk_tree, proto_item *chunk_item, proto_item *flags_item, sctp_half_assoc_t* ha)
{
guint16 number_of_gap_blocks, number_of_dup_tsns;
guint16 gap_block_number, dup_tsn_number, start, end;
gint gap_block_offset,... | 56 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 4