code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
void dtls1_stop_timer(SSL *s) { /* Reset everything */ memset(&(s->d1->timeout), 0, sizeof(struct dtls1_timeout_st)); memset(&(s->d1->next_timeout), 0, sizeof(struct timeval)); s->d1->timeout_duration = 1; BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0, &(s->d1->next_timeo...
vuln
Safe
Unknown
function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) { global $wpdb; $last_changed = wp_cache_get_last_changed( 'posts' ); $hash = md5( $page_path . serialize( $post_type ) ); $cache_key = "get_page_by_path:$hash:$last_changed"; $cached = wp_cache_get( $cache_key, 'posts' ); if ( false...
vuln
Safe
PHP
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
vuln
Safe
JavaScript
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
vuln
Vulnerable
Python
static CharDriverState *qemu_chr_open_win_pipe(QemuOpts *opts) { const char *filename = qemu_opt_get(opts, "path"); CharDriverState *chr; WinCharState *s; chr = g_malloc0(sizeof(CharDriverState)); s = g_malloc0(sizeof(WinCharState)); chr->opaque = s; chr->chr_write = win_chr_write; chr->...
vuln
Safe
C/C++
processDataRcvd(tcps_sess_t *pThis, const char c, struct syslogTime *stTime, const time_t ttGenTime, multi_submit_t *pMultiSub, unsigned *const __restrict__ pnMsgs) { DEFiRet; const tcpLstnParams_t *const cnf_params = pThis->pLstnInfo->cnf_params; ISOBJ_TYPE_assert(pThis, tcps_sess); int iMaxLine = glbl.GetMax...
vuln
Safe
Unknown
static ssize_t bat_socket_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct socket_client *socket_client = file->private_data; struct socket_packet *socket_packet; size_t packet_len; int error; if ((file->f_flags & O_NONBLOCK) && (socket_client->queue_len == 0)) return -EA...
vuln
Vulnerable
C/C++
static int atalk_create(struct net *net, struct socket *sock, int protocol, int kern) { struct sock *sk; int rc = -ESOCKTNOSUPPORT; if (!net_eq(net, &init_net)) return -EAFNOSUPPORT; /* * We permit SOCK_DGRAM and RAW is an extension. It is trivial to do * and gives you the full ELAP frame. Should be hand...
vuln
Safe
C/C++
DeepTiledInputFile::DeepTiledInputFile (InputPartData* part) : _data (new Data (part->numThreads)) { _data->_deleteStream=false; try { multiPartInitialize(part); } catch(...) { delete _data; throw; } }
vuln
Safe
Unknown
package envoyconfig import ( "context" "encoding/base64" "fmt" "net" "net/url" "sort" "time" envoy_config_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" envoy_config_listener_v3 "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3" envoy_config_route_v3 "github.com/envoypr...
vuln
Safe
Go
public int addDisparity( GrayF32 disparity, GrayU8 mask, Se3_F64 world_to_view, DisparityParameters parameters, Point2Transform2_F64 rectNorm_to_dispPixel, PixelTransform<Point2D_F64> dispPixel_to_rectNorm ) { InputSanityCheck.checkSameShape(disparity, mask); MultiViewStereoOps.maskOutPointsInCloud...
vuln
Safe
Java
static int count_comp_fors(struct compiling *c, const node *n) { int n_fors = 0; int is_async; count_comp_for: is_async = 0; n_fors++; REQ(n, comp_for); if (TYPE(CHILD(n, 0)) == ASYNC) { is_async = 1; } if (NCH(n) == (5 + is_async)) { n = CHILD(n, 4 + is_async); } ...
vuln
Vulnerable
C/C++
static void i6300esb_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); k->config_read = i6300esb_config_read; k->config_write = i6300esb_config_write; k->realize = i6300esb_realize; k->vendor_id = PCI_VENDOR_ID_INTEL;...
vuln
Vulnerable
C/C++
BlockDriverAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque, int type) { struct qemu_laio_state *s = aio_ctx; struct qemu_laiocb *laiocb; struct iocb *iocbs; off_t offset = ...
vuln
Vulnerable
C/C++
static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb) { MLPHeaderInfo mh; int substr, ret; if ((ret = ff_mlp_read_major_sync(m->avctx, &mh, gb)) != 0) return ret; if (mh.group1_bits == 0) { av_log(m->avctx, AV_LOG_ERROR, "invalid/unknown bits per sample\n"); return A...
vuln
Safe
C/C++
private static void checkAndExtractEntry(InputStream zipStream, ZipEntry zipEntry, Path targetFolder) throws IOException { if (!Files.exists(targetFolder)) { try { Files.createDirectories(targetFolder); } catch (IOException e) { throw new IOException("Can'...
vuln
Safe
Java
private Object /* pick one type, and fixate on it */ dance(final String type, final String text) /* for inside the thread */ { final Message msg = Message.obtain(); /* t(*A*t) */ Thread t = new Thread() { public void run() { Looper.prepare(); int bogon = (int)SystemClock.elapsedRealtime(); Noti...
vuln
Safe
Java
epsclosure (position_set *s, struct dfa const *d) { int i, j; char *visited; /* array of booleans, enough to use char, not int */ position p, old; CALLOC(visited, d->tindex); for (i = 0; i < s->nelem; ++i) if (d->tokens[s->elems[i].index] >= NOTCHAR && d->tokens[s->elems[i].index] != BACKREF #if...
vuln
Vulnerable
Unknown
(_, leadingTags, character) => `${leadingTags}\u00ad${character}`
vuln
Safe
JavaScript
/* * Copyright (c) Christos Zoulas 2003. * All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice immediately at th...
vuln
Safe
C/C++
void line6_disconnect(struct usb_interface *interface) { struct usb_line6 *line6 = usb_get_intfdata(interface); struct usb_device *usbdev = interface_to_usbdev(interface); if (!line6) return; if (WARN_ON(usbdev != line6->usbdev)) return; if (line6->urb_listen != NULL) line6_stop_listen(line6); snd_card_...
vuln
Vulnerable
Unknown
static int server_process_entry( Server *s, const void *buffer, size_t *remaining, ClientContext *context, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len) { /* Process a sin...
vuln
Safe
C/C++
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
vuln
Safe
Java
static void record_init(node_t * n) { field_t *info; pointf ul, sz; int flip, len; char *textbuf; /* temp buffer for storing labels */ int sides = BOTTOM | RIGHT | TOP | LEFT; /* Always use rankdir to determine how records are laid out */ flip = NOT(GD_realflip(agraphof(n))); reclblp =...
vuln
Safe
Unknown
aubio_onset_t * new_aubio_onset (const char_t * onset_mode, uint_t buf_size, uint_t hop_size, uint_t samplerate) { aubio_onset_t * o = AUBIO_NEW(aubio_onset_t); /* check parameters are valid */ if ((sint_t)hop_size < 1) { AUBIO_ERR("onset: got hop_size %d, but can not be < 1\n", hop_size); goto beach...
vuln
Safe
Unknown
static bool new_idmap_permitted(struct user_namespace *ns, int cap_setid, struct uid_gid_map *new_map) { /* Allow mapping to your own filesystem ids */ if ((new_map->nr_extents == 1) && (new_map->extent[0].count == 1)) { u32 id = new_map->extent[0].lower_first; if (cap_setid == CAP_SETUID) { kuid_t uid ...
vuln
Vulnerable
C/C++
def render(self, request): action = "download" if "action" in request.args: action = request.args["action"][0] if "file" in request.args: filename = lenient_force_utf_8(request.args["file"][0]) filename = sanitise_filename_slashes(os.path.realpath(filename)) if not os.path.exists(filename): retu...
vuln
Safe
Python
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
vuln
Vulnerable
C/C++
/* * . .o8 oooo * .o8 "888 `888 * .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo * 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' * 888 888 888 888 8...
vuln
Safe
JavaScript
GetOutboundPinholeTimeout(struct upnphttp * h, const char * action, const char * ns) { int r; static const char resp[] = "<u:%sResponse " "xmlns:u=\"%s\">" "<OutboundPinholeTimeout>%d</OutboundPinholeTimeout>" "</u:%sResponse>"; char body[512]; int bodylen; struct NameValueParserData data; char * int_ip...
vuln
Safe
C/C++
static int bdrv_open_driver(BlockDriverState *bs, BlockDriver *drv, const char *node_name, QDict *options, int open_flags, Error **errp) { Error *local_err = NULL; int ret; bdrv_assign_node_name(bs, node_name, &local_err); if (local_err) { ...
vuln
Vulnerable
C/C++
int __cil_build_ast_node_helper(struct cil_tree_node *parse_current, uint32_t *finished, void *extra_args) { struct cil_args_build *args = extra_args; struct cil_db *db = args->db; struct cil_tree_node *ast_current = args->ast; struct cil_tree_node *tunif = args->tunif; struct cil_tree_node *in = args->in; struct...
vuln
Vulnerable
Unknown
public void readExternal(DataInput in) throws IOException { if (!isEmpty()) { throw new NotActiveException(); } boolean fLite = in.readBoolean(); if (fLite) { int c = ExternalizableHelper.readInt(in); if...
vuln
Vulnerable
Java
static int do_read_inode(struct inode *inode) { struct f2fs_sb_info *sbi = F2FS_I_SB(inode); struct f2fs_inode_info *fi = F2FS_I(inode); struct page *node_page; struct f2fs_inode *ri; projid_t i_projid; /* Check if ino is within scope */ if (f2fs_check_nid_range(sbi, inode->i_ino)) return -EINVAL; node_page...
vuln
Vulnerable
Unknown
int MirrorJob::Do() { int res; int m=STALL; FileInfo *file; Job *j; switch(state) { case(INITIAL_STATE): remove_this_source_dir=(remove_source_dirs && source_dir.last_char()!='/'); if(!strcmp(target_dir,".") || !strcmp(target_dir,"..") || (FlagSet(SCAN_ALL_FIRST) && parent_mirror)...
vuln
Safe
C/C++
private boolean loadTimingPoints(final BeatmapData data) { // Load timing points timingPoints.clear(); for (final String tempString : data.getData("TimingPoints")) { String[] rawData = tempString.split("[,]"); // Ignoring malformed timing point if (rawData.len...
vuln
Vulnerable
Java
status_t OMXNodeInstance::getParameter( OMX_INDEXTYPE index, void *params, size_t /* size */) { Mutex::Autolock autoLock(mLock); if (isProhibitedIndex_l(index)) { android_errorWriteLog(0x534e4554, "29422020"); return BAD_INDEX; } OMX_ERRORTYPE err = OMX_GetParameter(mHandle...
vuln
Safe
C/C++
static av_cold int mss1_decode_init(AVCodecContext *avctx) { MSS1Context * const c = avctx->priv_data; int ret; c->ctx.avctx = avctx; c->pic = av_frame_alloc(); if (!c->pic) return AVERROR(ENOMEM); ret = ff_mss12_decode_init(&c->ctx, 0, &c->sc, NULL); avctx->pix_fmt = AV_PIX_FM...
vuln
Vulnerable
C/C++
package com.salesmanager.shop.admin.model.merchant; import com.salesmanager.core.model.reference.language.Language; import java.io.Serializable; import javax.validation.constraints.NotEmpty; public class StoreLandingDescription implements Serializable { /** * */ private static final long serialVersionUID...
vuln
Vulnerable
Java
public void Play() { // Play song if (currentIndexSongList < 0) { if (isExternalStoragePermissionDenied()) { requestPermissionForReading(); } else { try { if (currentPath == null) chooseDirectory(); ...
vuln
Safe
Java
function factory(options) { options = options || {} var objectPath = function(obj) { return Object.keys(objectPath).reduce(function(proxy, prop) { if(prop === 'create') { return proxy; } /*istanbul ignore else*/ if (typeof objectPath[prop] === 'function') { ...
vuln
Vulnerable
JavaScript
static MagickBooleanType TIFFWritePhotoshopLayers(Image* image, const ImageInfo *image_info,EndianType endian,ExceptionInfo *exception) { BlobInfo *blob; CustomStreamInfo *custom_stream; Image *base_image, *next; ImageInfo *clone_info; MagickBooleanType status; PhotoshopProfil...
vuln
Vulnerable
C/C++
static int handle_recv_1(void *object, IP_Port source, const uint8_t *packet, uint16_t length, void *userdata) { Onion *onion = (Onion *)object; if (length > ONION_MAX_PACKET_SIZE) { return 1; } if (length <= 1 + RETURN_1) { return 1; } if (packet[1 + RETURN_1] != NET_PACKET_A...
vuln
Safe
C/C++
public Sorting getSorting() { return sorting; }
vuln
Vulnerable
Java
char *gf_text_get_utf8_line(char *szLine, u32 lineSize, FILE *txt_in, s32 unicode_type) { u32 i, j, len; char *sOK; char szLineConv[2048]; unsigned short *sptr; memset(szLine, 0, sizeof(char)*lineSize); sOK = gf_fgets(szLine, lineSize, txt_in); if (!sOK) return NULL; if (unicode_type<=1) { j=0; len = (u32)...
vuln
Vulnerable
C/C++
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); audioManager = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE); preferences = getSharedPreferences("io.github.anen...
vuln
Vulnerable
Java
@Override public boolean execute(Action a, GameState gs) { Attack action = (Attack)a; //Check if action is feasible before execution if(action.isFeasible(gs)) { int unitId = action.getUnitId(); int targetId = action.getTargetId(); Unit attacker = (Unit) ...
vuln
Safe
Java
PgDatabase *add_database(const char *name) { PgDatabase *db = find_database(name); /* create new object if needed */ if (db == NULL) { db = slab_alloc(db_cache); if (!db) return NULL; list_init(&db->head); if (strlcpy(db->name, name, sizeof(db->name)) >= sizeof(db->name)) { log_warning("Too long db n...
vuln
Safe
Unknown
static void recalculate_apic_map(struct kvm *kvm) { struct kvm_apic_map *new, *old = NULL; struct kvm_vcpu *vcpu; int i; new = kzalloc(sizeof(struct kvm_apic_map), GFP_KERNEL); mutex_lock(&kvm->arch.apic_map_lock); if (!new) goto out; new->ldr_bits = 8; /* flat mode is default */ new->cid_shift = 8; n...
vuln
Safe
C/C++
int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, struct snd_rawmidi_params * params) { char *newbuf, *oldbuf; struct snd_rawmidi_runtime *runtime = substream->runtime; snd_rawmidi_drain_input(substream); if (params->buffer_size < 32 || params->buffer_size > 1024L * 1024L) { return -E...
vuln
Safe
C/C++
int journal_remote_handle_raw_source( sd_event_source *event, int fd, uint32_t revents, RemoteServer *s) { RemoteSource *source; int r; /* Returns 1 if there might be more data pending, * 0 if data is currently exhausted,...
vuln
Vulnerable
Unknown
static void processCertificateElements(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, u_int16_t p_offset, u_int16_t certificate_len) { struct ndpi_packet_struct *packet = &flow->packet; u_int num_found = 0, i; char buffer[64] = { '\0' }, rdnSeqBuf[2048] = { ...
vuln
Safe
C/C++
function PMA_getHtmlForForeignKey($save_row, $i, $existrel_foreign, $myfield, $db, $myfield_md5, $tbl_storage_engine, $options_array ) { $html_output = '<td>'; if (! empty($save_row[$i]['Key'])) { $foreign_db = false; $foreign_table = false; $foreign_column = false; // fore...
vuln
Vulnerable
PHP
main(int argc, const char **argv) { const char * prog = *argv; const char * outfile = NULL; const char * suffix = NULL; const char * prefix = NULL; int done = 0; /* if at least one file is processed */ struct global global; global_init(&global); while (--argc > 0) { ++argv; if (s...
vuln
Vulnerable
C/C++
static rgbConvFn findRgbConvFn(SwsContext *c) { const enum PixelFormat srcFormat = c->srcFormat; const enum PixelFormat dstFormat = c->dstFormat; const int srcId = c->srcFormatBpp; const int dstId = c->dstFormatBpp; rgbConvFn conv = NULL; #define IS_NOT_NE(bpp, fmt) \ (((bpp + 7) >> 3) == 2 && \...
vuln
Safe
C/C++
int tcp_test(const char* ip_str, const short port) { int sock, i; struct sockaddr_in s_in; int packetsize = 1024; unsigned char packet[packetsize]; struct timeval tv, tv2, tv3; int caplen = 0; int times[REQUESTS]; int min, avg, max, len; struct net_hdr nh; tv3.tv_sec=0; tv3....
vuln
Vulnerable
Unknown
static void scsi_read_complete(void * opaque, int ret) { SCSIGenericReq *r = (SCSIGenericReq *)opaque; int len; if (ret) { DPRINTF("IO error ret %d\n", ret); scsi_command_complete(r, ret); return; } len = r->io_header.dxfer_len - r->io_header.resid; DPRINTF("Data ready ta...
vuln
Safe
C/C++
int bdrv_open(BlockDriverState *bs, const char *filename, QDict *options, int flags, BlockDriver *drv) { int ret; char tmp_filename[PATH_MAX + 1]; BlockDriverState *file = NULL; QDict *file_options = NULL; if (options == NULL) { options = qdict_new(); } bs->op...
vuln
Safe
C/C++
/* Mach-O support for BFD. Copyright (C) 1999-2020 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Fou...
vuln
Safe
C/C++
void fp24_exp_cyc_sim(fp24_t e, const fp24_t a, const bn_t b, const fp24_t c, const bn_t d) { int n0, n1; int8_t naf0[RLC_FP_BITS + 1], naf1[RLC_FP_BITS + 1], *_k, *_m; fp24_t r, t0[1 << (EP_WIDTH - 2)]; fp24_t s, t1[1 << (EP_WIDTH - 2)]; size_t l, l0, l1; if (bn_is_zero(b)) { return fp24_exp_cyc(e, c, d); } ...
vuln
Safe
C/C++
/* * Copyright ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing...
vuln
Vulnerable
Java
static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { char buffer[MagickPathExtent], format, magick[MagickPathExtent]; const char *value; MagickBooleanType status; MagickOffsetType scene; Quantum index; QuantumAny ...
vuln
Safe
C/C++
static bool parse_chained_fixups(struct MACH0_(obj_t) *bin, ut32 offset, ut32 size) { struct dyld_chained_fixups_header header; if (size < sizeof (header)) { return false; } if (r_buf_fread_at (bin->b, offset, (ut8 *)&header, "7i", 1) != sizeof (header)) { return false; } if (header.fixups_version > 0) { ep...
vuln
Vulnerable
C/C++
int ff_unlock_avcodec(const AVCodec *codec) { if (codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE || !codec->init) return 0; av_assert0(ff_avcodec_locked); ff_avcodec_locked = 0; atomic_fetch_add(&entangled_thread_counter, -1); if (ff_mutex_unlock(&codec_mutex)) return -1; re...
vuln
Safe
C/C++
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* vim: set sw=4 sts=4 expandtab: */ /* rsvg.c: SAX-based renderer for SVG files into a GdkPixbuf. Copyright (C) 2000 Eazel, Inc. Copyright (C) 2002 Dom Lachowicz <cinamod@hotmail.com> This program is free software; you can redi...
vuln
Vulnerable
C/C++
private void getExtensions(String browser, String browserLocation, String userName, long ingestJobId) { FileManager fileManager = currentCase.getServices().getFileManager(); String browserName = browser; List<AbstractFile> extensionFiles; String extensionsName = EXTENSIONS_FILE_NAME; ...
vuln
Vulnerable
Java
@Override protected void handleProducer(final CommandProducer cmdProducer) { checkArgument(state == State.Connected); final long producerId = cmdProducer.getProducerId(); final long requestId = cmdProducer.getRequestId(); // Use producer name provided by client if present fin...
vuln
Vulnerable
Java
void CLASS parse_makernote(int base, int uptag) { unsigned offset = 0, entries, tag, type, len, save, c; unsigned ver97 = 0, serial = 0, i, wbi = 0, wb[4] = {0, 0, 0, 0}; uchar buf97[324], ci, cj, ck; short morder, sorder = order; char buf[10]; unsigned SamsungKey[11]; uchar NikonKey; #ifdef LIBRAW_LIBRA...
vuln
Safe
C/C++
static int virtio_balloon_init_pci(PCIDevice *pci_dev) { VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); VirtIODevice *vdev; vdev = virtio_balloon_init(&pci_dev->qdev); if (!vdev) { return -1; } virtio_init_pci(proxy, vdev); return 0; }
vuln
Safe
C/C++
static void sas_discover_domain(struct work_struct *work) { struct domain_device *dev; int error = 0; struct sas_discovery_event *ev = to_sas_discovery_event(work); struct asd_sas_port *port = ev->port; clear_bit(DISCE_DISCOVER_DOMAIN, &port->disc.pending); if (port->port_dev) return; error = sas_get_port_d...
vuln
Safe
Unknown
static void parse_mb_skip(Wmv2Context *w) { int mb_x, mb_y; MpegEncContext *const s = &w->s; uint32_t *const mb_type = s->current_picture_ptr->mb_type; w->skip_type = get_bits(&s->gb, 2); switch (w->skip_type) { case SKIP_TYPE_NONE: for (mb_y = 0; mb_y < s->mb_height; mb_y++) ...
vuln
Vulnerable
C/C++
int compat_get_timex(struct timex *txc, const struct compat_timex __user *utp) { struct compat_timex tx32; if (copy_from_user(&tx32, utp, sizeof(struct compat_timex))) return -EFAULT; txc->modes = tx32.modes; txc->offset = tx32.offset; txc->freq = tx32.freq; txc->maxerror = tx32.maxerror; txc->esterror...
vuln
Vulnerable
C/C++
static int fix_acl(int fd, uid_t uid, bool allow_user) { assert(fd >= 0); assert(uid_is_valid(uid)); #if HAVE_ACL int r; /* We don't allow users to read coredumps if the uid or capabilities were changed. */ if (!allow_user) return 0; if (uid_is_system(u...
vuln
Safe
C/C++
OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE hComp, OMX_IN OMX_BUFFERHEADERTYPE* buffer) { (void) hComp; int push_cnt = 0,i=0; unsigned nPortIndex = 0; OMX_ERRORTYPE ret = OMX_ErrorNone; struct vdec_input_frameinfo frameinfo; struct vdec_bufferpayload *temp_buffer; struct vd...
vuln
Vulnerable
C/C++
void Scrollbar::autoscrollPressedPart(double delay) { if (m_pressedPart == ThumbPart || m_pressedPart == NoPart) return; if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) && thumbUnderMouse(this)) { theme()->invalidatePart(this, m_pressedPart); setHoveredPart(Thu...
vuln
Safe
C/C++
lyd_dup_to_ctx(const struct lyd_node *node, int options, struct ly_ctx *ctx) { struct ly_ctx *log_ctx; struct lys_node_list *slist; struct lys_node *schema; const char *yang_data_name; const struct lys_module *trg_mod; const struct lyd_node *next, *elem; struct lyd_node *ret, *parent, *key, ...
vuln
Vulnerable
Unknown
/* $Id$ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; eit...
vuln
Safe
C/C++
@Override public void tick() { if (!world.isClient()) { if (Math.abs(getVelocity().x) < 0.01 && Math.abs(getVelocity().x) < 0.01 && Math.abs(getVelocity().y) < 0.01) { discard(); } } super.tick(); if (getOwner() == null) { return;...
vuln
Safe
Java
static int iccompareproc(i_ctx_t *i_ctx_p, ref *space, ref *testspace) { int code1, code2; ref ICCdict1, ICCdict2, *tempref1, *tempref2; int buff_size; code1 = array_get(imemory, space, 1, &ICCdict1); if (code1 < 0) return 0; code2 = array_get(imemory, testspace, 1, &ICCdict2); if (...
vuln
Vulnerable
Unknown
// Copyright 2016 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
vuln
Safe
Go
static const char *quote_arg(const char *arg) { /* count chars to quote */ int len = 0, n = 0; int force_quotes = 0; char *q, *d; const char *p = arg; if (!*p) force_quotes = 1; while (*p) { if (isspace(*p) || *p == '*' || *p == '?' || *p == '{' || *p == '\'') force_quotes = 1; else if (*p == '"') n++;...
vuln
Vulnerable
Unknown
@Override public Response intercept(Chain chain) throws IOException { Request request = chain.request(); String ua = request.header(UA_KEY); if (Check.isEmpty(ua)) { request = request.newBuilder() .addHeader("user-agent", WAP_USER_AGENT...
vuln
Safe
Java
static Array HHVM_METHOD(Memcache, getextendedstats, const String& /*type*/ /* = null_string */, int /*slabid*/ /* = 0 */, int /*limit*/ /* = 100 */) { auto data = Native::data<MemcacheData>(this_); memcached_return_t ret; memcached_stat_st *stats; stats = memc...
vuln
Vulnerable
C/C++
public String getStringParameterSQL(String param) { // DASHBUILDE-113: SQL Injection on data set lookup filters String escapedParam = param.replaceAll("'", "''"); return "'" + escapedParam + "'"; }
vuln
Safe
Java
@Override public void init(Context context, IWindowManager windowManager, WindowManagerFuncs windowManagerFuncs) { mContext = context; mWindowManager = windowManager; mWindowManagerFuncs = windowManagerFuncs; mWindowManagerInternal = LocalServices.getService(WindowManager...
vuln
Safe
Java
yyparse (void *yyscanner, YR_COMPILER* compiler) { /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ /* Default value used for initialization, for pacifying older GCCs or non-GCC compilers. */ YY_INITIAL_VALUE (static YYSTYPE yyval_default;) YYSTYPE yylval YY_INITIAL_VALU...
vuln
Safe
Unknown
int WebObjects_translate(request_rec *r) { WebObjects_config *wc; WOURLComponents url; WOURLError urlerr; WOURLError charcheck; // get the module configuration (this is the structure created by WebObjects_create_config()) wc = ap_get_module_config(r->server->module_config, &WebObjects_module); ...
vuln
Safe
C/C++
QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head, const GraphicHwOps *hw_ops, void *opaque) { int width = 640; int height = 480; QemuConsole *s; DisplayState *ds; ds = get_alloc_displaystate(); trace_console_gfx...
vuln
Safe
C/C++
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
vuln
Vulnerable
Python
int PKCS7_dataFinal(PKCS7 *p7, BIO *bio) { int ret = 0; int i, j; BIO *btmp; PKCS7_SIGNER_INFO *si; EVP_MD_CTX *mdc, ctx_tmp; STACK_OF(X509_ATTRIBUTE) *sk; STACK_OF(PKCS7_SIGNER_INFO) *si_sk = NULL; ASN1_OCTET_STRING *os = NULL; EVP_MD_CTX_init(&ctx_tmp); i = OBJ_obj2nid(p7->typ...
vuln
Vulnerable
Unknown
def main() -> None: if len(sys.argv) < 2: print(f"usage: {__file__} [OUTPUT_FILE]") sys.exit(1) filename = sys.argv[1] task_config = TaskConfig( job_id=UUID(int=0), task=TaskDetails( type=TaskType.libfuzzer_fuzz, duration=1, target_exe="fu...
vuln
Safe
Python
rsvg_new_symbol (void) { RsvgNodeSymbol *symbol; symbol = g_new (RsvgNodeSymbol, 1); _rsvg_node_init (&symbol->super); symbol->vbox.active = FALSE; symbol->preserve_aspect_ratio = RSVG_ASPECT_RATIO_XMID_YMID; symbol->super.draw = _rsvg_node_draw_nothing; symbol->super.set_atts = rsvg_node_sy...
vuln
Vulnerable
Unknown
// Package instance provides a mini Prometheus scraper and remote_writer. package instance import ( "bytes" "context" "crypto/md5" "encoding/hex" "encoding/json" "errors" "fmt" "math" "os" "path/filepath" "strings" "sync" "time" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/grafana...
vuln
Safe
Go
void DownloadCoreServiceImpl::SetDownloadManagerDelegateForTesting( std::unique_ptr<ChromeDownloadManagerDelegate> new_delegate) { manager_delegate_.swap(new_delegate); DownloadManager* dm = BrowserContext::GetDownloadManager(profile_); dm->SetDelegate(manager_delegate_.get()); manager_delegate_->SetDown...
vuln
Vulnerable
C/C++
void QuickOpen::Load(uint64 BlockPos) { if (!Loaded) { // If loading for the first time, perform additional intialization. SeekPos=Arc->Tell(); UnsyncSeekPos=false; SaveFilePos SavePos(*Arc); Arc->Seek(BlockPos,SEEK_SET); // If BlockPos points to original main header, we'll have the infini...
vuln
Safe
C/C++
static void *arm_coherent_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs) { pgprot_t prot = __get_dma_pgprot(attrs, pgprot_kernel); void *memory; if (dma_alloc_from_coherent(dev, size, handle, &memory)) return memory; return __dma_alloc(dev, size, handle, gfp,...
vuln
Vulnerable
C/C++
free_conversation (GdmSessionConversation *conversation) { if (conversation->job != NULL) { g_warning ("Freeing conversation '%s' with active job", conversation->service_name); } g_free (conversation->service_name); g_free (conversation->starting_username); g_fre...
vuln
Vulnerable
Unknown
@Override public Point2 config(){ if (tile == null) return null; return Point2.unpack(link).sub(tile.x, tile.y); }
vuln
Safe
Java
Mat_VarReadNextInfo4(mat_t *mat) { int M,O,data_type,class_type; mat_int32_t tmp; long nBytes; size_t readresult; matvar_t *matvar = NULL; union { mat_uint32_t u; mat_uint8_t c[4]; } endian; if ( mat == NULL || mat->fp == NULL ) return NULL; el...
vuln
Vulnerable
C/C++
void t2p_read_tiff_size(T2P* t2p, TIFF* input){ uint64* sbc=NULL; #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT) unsigned char* jpt=NULL; tstrip_t i=0; tstrip_t stripcount=0; #endif uint64 k = 0; if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){ #ifdef CCITT_SUPPORT if(t2p->pdf_compression == T2P_COMP...
vuln
Vulnerable
Unknown