code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
IPV6DefragReverseSimpleTest(void) { DefragContext *dc = NULL; Packet *p1 = NULL, *p2 = NULL, *p3 = NULL; Packet *reassembled = NULL; int id = 12; int i; int ret = 0; DefragInit(); dc = DefragContextNew(); if (dc == NULL) goto end; p1 = IPV6BuildTestPacket(id, 0, 1, 'A'...
vuln
Vulnerable
C/C++
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * th...
vuln
Safe
Java
static av_always_inline void rv40_strong_loop_filter(uint8_t *src, const int step, const int stride, const int alpha, ...
vuln
Vulnerable
C/C++
handle_client_accesses(CMD_Request *rx_message, CMD_Reply *tx_message) { CLG_Status result; RPT_ClientAccess_Report report; unsigned long nc; IPAddr ip; int i; struct timeval now; LCL_ReadCookedTime(&now, NULL); nc = ntohl(rx_message->data.client_accesses.n_clients); tx_message->status = htons(STT_S...
vuln
Vulnerable
Unknown
function handler (type, name, fn) { if ( type === 'constructor' || type === '__proto__' || name === 'constructor' || name === '__proto__' ) { return } if (arguments.length > 2) { handlers[type][name] = fn } return handlers[type][name] }
vuln
Safe
JavaScript
/* 32-bit ELF support for ARM Copyright (C) 1998-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 ...
vuln
Vulnerable
C/C++
var hasExcape = /~/ var escapeMatcher = /~[01]/g function escapeReplacer (m) { switch (m) { case '~1': return '/' case '~0': return '~' } throw new Error('Invalid tilde escape: ' + m) } function untilde (str) { if (!hasExcape.test(str)) return str return str.replace(escapeMatcher, escapeReplacer) } ...
vuln
Vulnerable
JavaScript
int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len) { struct sock *sk = sock->sk; struct rds_sock *rs = rds_sk_to_rs(sk); DECLARE_SOCKADDR(struct sockaddr_in *, usin, msg->msg_name); __be32 daddr; __be16 dport; struct rds_message *rm = NULL; struct rds_connection *conn; int ret = 0; in...
vuln
Safe
C/C++
function Z(t){return!(tt(t)||Y(t)||Q(t)||K(t)||G(t)||X(t)||_(t))}
vuln
Vulnerable
JavaScript
public String getShortDescription() { if(note != null) { try { return Messages.Cause_RemoteCause_ShortDescriptionWithNote(addr, Jenkins.getInstance().getMarkupFormatter().translate(note)); } catch (IOException x) { // ignore ...
vuln
Safe
Java
static void add_pixels_clamped4_c(const DCTELEM *block, uint8_t *restrict pixels, int line_size) { int i; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; for(i=0;i<4;i++) { pixels[0] = cm[pixels[0] + block[0]]; pixels[1] = cm[pixels[1] + block[1]]; pixels[2] =...
vuln
Vulnerable
C/C++
function peg$parsecontext() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$currPos; if (input.charCodeAt(peg$currPos) === 58) { s2 = peg$c12; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c13); } } if (s2 !...
vuln
Safe
JavaScript
static int dt_remember_or_free_map(struct pinctrl *p, const char *statename, struct pinctrl_dev *pctldev, struct pinctrl_map *map, unsigned num_maps) { int i; struct pinctrl_dt_map *dt_map; /* Initialize common mapping table entry fields */ for (i = 0; i < num_maps; i++) { const char *devname; d...
vuln
Safe
Unknown
private void revertCaches(final boolean clearPropsAndLinksCache) { if (clearPropsAndLinksCache) { propsCache.clear(); linksCache.clear(); blobStringsCache.clear(); } localCache = (EntityIterableCacheAdapter) store.getEntityIterableCache().getCacheAdapter(); ...
vuln
Vulnerable
Java
/* * 32-bit Digest parameter name parser * * Copyright (C) 2001-2003 FhG Fokus * * This file is part of opensips, a free SIP server. * * opensips 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; either...
vuln
Vulnerable
C/C++
static int read_uncompressed_sgi(const SGIInfo *si, AVPicture *pict, ByteIOContext *f) { int x, y, z, chan_offset, ret = 0; uint8_t *dest_row; url_fseek(f, SGI_HEADER_SIZE, SEEK_SET); pict->linesize[0] = si->xsize; for (z = 0; z < si->zsize; z++) { #ifndef WORDS_BIGENDIAN ...
vuln
Safe
C/C++
def _run_ssh(self, command, check_exit=True, attempts=1): if not self.sshpool: self.sshpool = utils.SSHPool(self.config.san_ip, self.config.san_ssh_port, self.config.ssh_conn_timeout, ...
vuln
Vulnerable
Python
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-2016 Facebook, Inc. (http://www.facebook.com) | +---------...
vuln
Safe
C/C++
cJSON *cJSON_DetachItemFromObject( cJSON *object, const char *string ) { int i = 0; cJSON *c = object->child; while ( c && cJSON_strcasecmp( c->string, string ) ) { ++i; c = c->next; } if ( c ) return cJSON_DetachItemFromArray( object, i ); return 0; }
vuln
Vulnerable
C/C++
def run(self): """Runs the groups scanner.""" root = self._retrieve() with open(self.rules, 'r') as f: group_rules = yaml.load(f) root = self._apply_all_rules(root, group_rules) all_violations = self._find_violations(root) self._output_results(all_violati...
vuln
Vulnerable
Python
function createSection(name, inside) { var extendecInside = {}; extendecInside['section-header'] = { pattern: /^ ?\*{3}.+?\*{3}/, alias: 'keyword' }; // copy inside tokens for (var token in inside) { extendecInside[token] = inside[token]; } extendecInside['tag'] = { pattern: /([\r\n](?: |\...
vuln
Vulnerable
JavaScript
static void on_read(h2o_socket_t *sock, int status) { h2o_http2_conn_t *conn = sock->data; if (status != 0) { h2o_socket_read_stop(conn->sock); close_connection(conn); return; } update_idle_timeout(conn); parse_input(conn); /* write immediately, if there is no wri...
vuln
Vulnerable
C/C++
@Override public void detachSystemDataTransport(String packageName, int userId, int associationId) { mSystemDataTransferProcessor.detachSystemDataTransport(packageName, userId, associationId); }
vuln
Vulnerable
Java
void impeg2d_dec_hdr(void *pv_dec,impeg2d_video_decode_ip_t *ps_ip, impeg2d_video_decode_op_t *ps_op) { UWORD32 u4_bits_read; dec_state_t *ps_dec; UWORD32 u4_size = ps_ip->s_ivd_video_decode_ip_t.u4_num_Bytes; ps_dec = (dec_state_t *)pv_dec; ps_op->s_ivd_video_decode_op_t.u4_error_code = 0; if (u4_...
vuln
Safe
C/C++
var authorize = function (cb) { // Do not require auth for static paths and the API...this could be a bit brittle if (req.path.match(/^\/(static|javascripts|pluginfw|api)/)) return cb(true); if (req.path.toLowerCase().indexOf('/admin') != 0) { if (!settings.requireAuthentication) return cb(true); ...
vuln
Safe
JavaScript
void SafeBrowsingBlockingPage::DontProceed() { DCHECK(action_taken() != DONT_PROCEED_ACTION); if (action_taken() == PROCEED_ACTION) { InterstitialPage::DontProceed(); return; } RecordUserAction(DONT_PROCEED); FinishMalwareDetails(0); // No delay NotifySafeBrowsingService(sb_service_, unsafe_resou...
vuln
Vulnerable
C/C++
static int select_voice(cst_voice **voice, const char *voice_name, void *log_ctx) { int i; for (i = 0; i < FF_ARRAY_ELEMS(voice_entries); i++) { struct voice_entry *entry = &voice_entries[i]; if (!strcmp(entry->name, voice_name)) { *voice = entry->register_fn(NULL); if (!...
vuln
Vulnerable
C/C++
return_enc_padata(krb5_context context, krb5_data *req_pkt, krb5_kdc_req *request, krb5_keyblock *reply_key, krb5_db_entry *server, krb5_enc_kdc_rep_part *reply_encpart, krb5_boolean is_referral) { krb5_error_code code = 0; /* This should be initialized and ...
vuln
Vulnerable
C/C++
LPSTR tr_esc_str(LPCSTR arg, bool format) { LPSTR tmp = NULL; size_t cs = 0, x, ds, len; size_t s; if (NULL == arg) return NULL; s = strlen(arg); /* Find trailing whitespaces */ while ((s > 0) && isspace(arg[s - 1])) s--; /* Prepare a initial buffer with the size of the result string. */ ds = s + 1; ...
vuln
Vulnerable
Unknown
void WebGLRenderingContextBase::TexImageHelperHTMLVideoElement( const SecurityOrigin* security_origin, TexImageFunctionID function_id, GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, GLint xoffset, GLint yoffset, GLint zoffset, HTMLVideoElement* ...
vuln
Safe
C/C++
static int object_create(QemuOpts *opts, void *opaque) { const char *type = qemu_opt_get(opts, "qom-type"); const char *id = qemu_opts_id(opts); Object *obj; g_assert(type != NULL); if (id == NULL) { qerror_report(QERR_MISSING_PARAMETER, "id"); return -1; } obj = object_new(t...
vuln
Safe
C/C++
/* mqtt_client.c * * Copyright (C) 2006-2021 wolfSSL Inc. * * This file is part of wolfMQTT. * * wolfMQTT 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; either version 2 of the License, or * (at your...
vuln
Vulnerable
C/C++
function G(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.hasLoaded,a=o;return Object($.t)(e)&&!Object($.p)(e)&&"function"==typeof e.afterLoad&&(a=!0,X(e.afterLoad).call(this,t)),Object($.s)(e)?G.call(this,e(t),t,{hasLoaded:a}):Object($.p)(e)?M()(e).call(e,(function(e){return G.call(n,e...
vuln
Vulnerable
JavaScript
private static void copyToUpperTriangle(final double[] c, final int cols) { for(int i = 0, offC = 0; i < cols; i++, offC += cols) for(int j = (i + 1), offR = (i + 1) * cols; j < cols; j++, offR += cols) { final double prev = c[offC + j]; if(prev == 0) c[offC + j] = c[i + offR]; c[i + offR] = 0; ...
vuln
Safe
Java
package commands import ( "context" "fmt" "sync" tupleUtils "github.com/openfga/openfga/pkg/tuple" "github.com/openfga/openfga/pkg/utils" serverErrors "github.com/openfga/openfga/server/errors" "github.com/openfga/openfga/storage" openfgapb "go.buf.build/openfga/go/openfga/api/openfga/v1" ) // Keeping the in...
vuln
Safe
Go
nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp) { struct svc_procedure *proc; kxdrproc_t xdr; __be32 nfserr; __be32 *nfserrp; dprintk("nfsd_dispatch: vers %d proc %d\n", rqstp->rq_vers, rqstp->rq_proc); proc = rqstp->rq_procinfo; if (nfs_request_too_big(rqstp, proc)) { dprintk("nfsd: NFSv%d...
vuln
Safe
C/C++
@Override public Connection connect( final String driverProtocol, final HostSpec hostSpec, final Properties props, final boolean isInitialConnection, final JdbcCallable<Connection, SQLException> connectFunc) throws SQLException { if (this.secretsManagerClient == null || this.g...
vuln
Vulnerable
Java
private Element renderBlock(Element parent, BlockArea a, Document d) { Element e = Documents.createElement(d, SVGDocumentFrame.svgGroupEltName); double xSaved = xCurrent; double ySaved = yCurrent; WritingMode wm = a.getWritingMode(); boolean vertical = wm.isVertical(); Di...
vuln
Safe
Java
static void ssl3_take_mac(SSL *s) { const char *sender; int slen; /* If no new cipher setup return immediately: other functions will * set the appropriate error. */ if (s->s3->tmp.new_cipher == NULL) return; if (s->state & SSL_ST_CONNECT) ...
vuln
Safe
Unknown
static int perf_trace_event_perm(struct ftrace_event_call *tp_event, struct perf_event *p_event) { /* The ftrace function trace is allowed only for root. */ if (ftrace_event_is_function(tp_event) && perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN)) return -EPERM; /* No tracing, just counting, so ...
vuln
Vulnerable
C/C++
/* * Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com> * Copyright (c) 2009-2012, Pieter Noordhuis <pcnoordhuis at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following condition...
vuln
Vulnerable
C/C++
@Override public boolean keyPressed(int keyCode, int scanCode, int modifiers) { if (Minecraft.getInstance().options.keyInventory.matches(keyCode, scanCode) && !this.canSeeBackButton()) { this.onClose(); return true; } else if (keyCode == GLFW.GLFW_KEY_BACKSPACE) { back(true); return true; } else if (...
vuln
Vulnerable
Java
static void xbr3x(AVFrame *input, AVFrame *output, const uint32_t *r2y) { const int nl = output->linesize[0]>>2; const int nl1 = nl + nl; uint32_t pprev; uint32_t pprev2; int x,y; for (y = 0; y < input->height; y++) { uint32_t * E = (uint32_t *)(output->data[0] + y * output->linesize[0] ...
vuln
Vulnerable
C/C++
static int cbs_jpeg_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header) { AVBufferRef *data_ref; uint8_t *data; size_t data_size; int unit, start, end, marker, next_start, next_marker; int err, i, ...
vuln
Vulnerable
C/C++
bool qio_task_propagate_error(QIOTask *task, Error **errp) { if (task->err) { error_propagate(errp, task->err); return true; } return false; }
vuln
Vulnerable
C/C++
struct clock_source *dce100_clock_source_create( struct dc_context *ctx, struct dc_bios *bios, enum clock_source_id id, const struct dce110_clk_src_regs *regs, bool dp_clk_src) { struct dce110_clk_src *clk_src = kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); if (!clk_src) return NULL; if (dce110_clk_...
vuln
Safe
C/C++
evtchn_port_t evtchn_from_irq(unsigned irq) { const struct irq_info *info = NULL; if (likely(irq < nr_irqs)) info = info_for_irq(irq); if (!info) return 0; return info->evtchn; }
vuln
Safe
C/C++
public static String c(int id) { if (id == 36) { return "AsyncTask"; } for (int i = 0; i < cachedCustomComponents.size(); i++) { HashMap<String, Object> component = cachedCustomComponents.get(i); if (component != null) { Object componentId = c...
vuln
Safe
Java
flac_buffer_copy (SF_PRIVATE *psf) { FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; const FLAC__Frame *frame = pflac->frame ; const int32_t* const *buffer = pflac->wbuffer ; unsigned i = 0, j, offset, channels, len ; /* ** frame->header.blocksize is variable and we're using a constant blocksize ** of FL...
vuln
Vulnerable
C/C++
/* * Copyright (c) 2013 The TCPDUMP project * 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, this list of ...
vuln
Safe
C/C++
$sanitized_description = $hp->purify($fileinfo->getDescription(), CODENDI_PURIFIER_CONVERT_HTML); $link_show = '<a href="' . $query_link . '"' . $this->getVisioningAttributeForLink($fileinfo, $read_only, $lytebox_id) . ' title="' . $sani...
vuln
Vulnerable
PHP
void PrintWebViewHelper::OnPrintingDone(bool success) { notify_browser_of_print_failure_ = false; if (!success) LOG(ERROR) << "Failure in OnPrintingDone"; DidFinishPrinting(success ? OK : FAIL_PRINT); }
vuln
Vulnerable
C/C++
/* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** *******************...
vuln
Safe
C/C++
def main(argv=sys.argv): """[summary] Keyword Arguments: argv {[type]} -- [description] (default: {sys.argv}) Raises: UserError: [description] UserError: [description] UserError: [description] """ parser = argparse.ArgumentParser(argv[0]) parser.add_argument('-c...
vuln
Vulnerable
Python
win_close(win_T *win, int free_buf) { win_T *wp; int other_buffer = FALSE; int close_curwin = FALSE; int dir; int help_window = FALSE; tabpage_T *prev_curtab = curtab; frame_T *win_frame = win->w_frame->fr_parent; #ifdef FEAT_DIFF int had_diffmode = win->w_p_diff; #endif #ifdef ME...
vuln
Vulnerable
Unknown
static Image *ReadVIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define VFF_CM_genericRGB 15 #define VFF_CM_ntscRGB 1 #define VFF_CM_NONE 0 #define VFF_DEP_DECORDER 0x4 #define VFF_DEP_NSORDER 0x8 #define VFF_DES_RAW 0 #define VFF_LOC_IMPLICIT 1 #define VFF_MAPTYP_NONE 0 #define VFF_MAP...
vuln
Vulnerable
Unknown
static void sig_server_connect_copy(SERVER_CONNECT_REC **dest, IRC_SERVER_CONNECT_REC *src) { IRC_SERVER_CONNECT_REC *rec; g_return_if_fail(dest != NULL); if (!IS_IRC_SERVER_CONNECT(src)) return; rec = g_new0(IRC_SERVER_CONNECT_REC, 1); rec->chat_type = IRC_PROTOCOL; rec->max_cmds_at_once = src->max_c...
vuln
Safe
C/C++
public void connect() throws IOException { if(isStopped) { throw new IOException("Client has been stopped"); } if(Log.isInfoEnabled()) { Log.info("Connecting to {}:{}", hostname, port); } synchronized(app) { if(!app.getSshEngine().isStarted() && !app.getSshEngine().isStarting()) { if(!ap...
vuln
Vulnerable
Java
static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos, int *outFilterSize, int xInc, int srcW, int dstW, int filterAlign, int one, int flags, int cpu_flags, SwsVector *srcFilter, SwsV...
vuln
Vulnerable
C/C++
(function (tree) { var parseCopyProperties = [ 'paths', // option - unmodified - paths to search for imports on 'optimization', // option - optimization level (for the chunker) 'files', // list of files that have been imported, used for import-once 'content...
vuln
Safe
Java
public void delete(int startLine, int columnOnStartLine, int endLine, int columnOnEndLine) { StringBuilder changedContent = new StringBuilder(); if (startLine == endLine) { if(!checkLineAndColumn(endLine, columnOnEndLine, true)) return; if(!checkLineAndColumn(startLine, columnOnS...
vuln
Safe
Java
m.getIndexableText()+" "}else f=d.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.showRemotelyStoredLibrary=function(d){var f={},g=document.createElement("div");g.style.whiteSpace="nowrap";var m=document.createElement("h3");mxUtils.write(m,mxUtils.htmlEntities(d));m.style.cssText="width...
vuln
Safe
JavaScript
@Override public int next(int bits) { if (Thread.currentThread() != this.owner.get()) throw new ConcurrentModificationException(); return super.next(bits); }
vuln
Vulnerable
Java
static int tm2_read_stream(TM2Context *ctx, const uint8_t *buf, int stream_id, int buf_size) { int i; int cur = 0; int skip = 0; int len, toks; TM2Codes codes; len = AV_RB32(buf); buf += 4; cur += 4; skip = len * 4 + 4; if(len == 0) return 4; if (len >= INT_MAX/4-1 || le...
vuln
Safe
C/C++
void RemoveProcessIdFromGlobalMap(int32_t process_id) {
vuln
Safe
C/C++
static void read_len_table(uint8_t *dst, GetBitContext *gb){ int i, val, repeat; for(i=0; i<256;){ repeat= get_bits(gb, 3); val = get_bits(gb, 5); if(repeat==0) repeat= get_bits(gb, 8); while (repeat--) dst[i++] = val; } }
vuln
Vulnerable
C/C++
package plugin import ( "net" "os" "path" "strings" "github.com/docker/libnetwork/ipamapi" weaveapi "github.com/weaveworks/weave/api" "github.com/weaveworks/weave/common" "github.com/weaveworks/weave/common/docker" weavenet "github.com/weaveworks/weave/net" ipamplugin "github.com/weaveworks/weave/plugin/ipa...
vuln
Vulnerable
Go
package teamserver import ( "encoding/json" "net/http" "code.cloudfoundry.org/lager" "github.com/concourse/concourse/atc" "github.com/concourse/concourse/atc/api/accessor" "github.com/concourse/concourse/atc/api/present" ) type SetTeamResponse struct { Errors []string `json:"errors,omitempty"` ...
vuln
Vulnerable
Go
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # 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, either version ...
vuln
Safe
Python
package com.salesmanager.shop.admin.controller.customers; import com.fasterxml.jackson.databind.ObjectMapper; import com.salesmanager.core.business.services.customer.attribute.CustomerOptionService; import com.salesmanager.core.business.services.customer.attribute.CustomerOptionSetService; import com.salesmanager.core...
vuln
Vulnerable
Java
package server import ( "context" "encoding/json" "fmt" "time" "github.com/pkg/errors" "github.com/usememos/memos/api" metric "github.com/usememos/memos/plugin/metrics" "github.com/usememos/memos/server/profile" "github.com/usememos/memos/store" "github.com/usememos/memos/store/db" "github.com/gorilla/ses...
vuln
Safe
Go
@Override public @NotNull ItemStack clicked(final int slotId, final int clickedButton, final @NotNull ClickType mode, final @NotNull PlayerEntity playerIn) { if (slotId >= 0 && slotId < brewingStandInventory.getSlots()) { if (mode == ClickType.PICKUP || mode == Clic...
vuln
Safe
Java
public static void fetchUserdata(UUID id) { JsonObject json = new JsonObject(); json.addProperty("type", "getUser"); json.addProperty("uuid", id.toString()); NetworkManager.sendMessage(NetworkManager.GSON.toJson(json)); }
vuln
Vulnerable
Java
static Image *ReadPANGOImage(const ImageInfo *image_info, ExceptionInfo *exception) { cairo_font_options_t *font_options; cairo_surface_t *surface; char *caption, *property; cairo_t *cairo_image; const char *option; DrawInfo *draw_info; Image *image; MagickBoolea...
vuln
Safe
C/C++
int tcp_emu(struct socket *so, struct mbuf *m) { Slirp *slirp = so->slirp; unsigned n1, n2, n3, n4, n5, n6; char buff[257]; uint32_t laddr; unsigned lport; char *bptr; DEBUG_CALL("tcp_emu"); DEBUG_ARG("so = %p", so); DEBUG_ARG("m = %p", m); switch (so->so_emu) { int x, ...
vuln
Safe
C/C++
bool HHVM_FUNCTION(apc_store_as_primed_do_not_use, const String& key, const Variant& var) { if (!apcExtension::Enable) return false; if (isKeyInvalid(key)) { throw_invalid_argument("apc key: (contains invalid characters)"); return false; } apc_store().setWithoutTTL(...
vuln
Safe
C/C++
void cgit_clone_objects(void) { if (!ctx.qry.path) { cgit_print_error_page(400, "Bad request", "Bad request"); return; } if (!strcmp(ctx.qry.path, "info/packs")) { print_pack_info(); return; } send_file(git_path("objects/%s", ctx.qry.path)); }
vuln
Vulnerable
Unknown
protected OkHttpClient getHttpClient() { if (okHttpClient == null) { okHttpClient = new OkHttpClient(); } Authenticator proxyAuthenticator = getAuthenticator(); return okHttpClient.newBuilder() .addInterceptor(new RetryInterceptor(retryCount)) .connectTimeout(timeout, timeoutUnit) ...
vuln
Safe
Java
@Override public boolean validateExpression(String expression, String validation) { if (!validateExpressionEnabled) { throw new DiscoveryException("Strategy endpoint for validate-expression is disabled"); } Map<String, String> map = null; try { map = StringUt...
vuln
Safe
Java
void ExtensionsGuestViewMessageFilter::FrameNavigationHelper::FrameDeleted(
vuln
Safe
C/C++
private void validateAgainstXSD(InputStream xml) throws IOException, SAXException { try ( InputStream xsd = getClass().getResourceAsStream("/ESAPI-properties.xsd"); ) { SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = factory.newSchema(n...
vuln
Safe
Java
char *suhosin_decrypt_single_cookie(char *name, int name_len, char *value, int value_len, char *key, char **where TSRMLS_DC) { int o_name_len = name_len; char *buf, *buf2, *d, *d_url; int l; buf = estrndup(name, name_len); name_len = php_url_decode(buf, name_len); normalize_varname(buf); name_len = strlen...
vuln
Safe
C/C++
void do_addo (void) { T2 = T0; T0 += T1; if (likely(!((T2 ^ T1 ^ (-1)) & (T2 ^ T0) & (1 << 31)))) { xer_ov = 0; } else { xer_so = 1; xer_ov = 1; } }
vuln
Vulnerable
C/C++
static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define ThrowDCMException(exception,message) \ { \ RelinquishDCMMemory(&info,&map,stream_info,stack,data); \ ThrowReaderException((exception),(message)); \ } char explicit_vr[MagickPathExtent], implicit_vr[MagickPathExtent...
vuln
Vulnerable
C/C++
static void ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, int ExifLength, int NestingLevel) { int de; int a; int NumDirEntries; int ThumbnailOffset = 0; int ThumbnailSize = 0; char IndentString[25]; unsigned OffsetVal; if (NestingLevel > 4){ ErrNo...
vuln
Safe
Unknown
krb5_encode_krbsecretkey(krb5_key_data *key_data_in, int n_key_data, krb5_kvno mkvno) { struct berval **ret = NULL; int currkvno; int num_versions = 1; int i, j, last; krb5_error_code err = 0; krb5_key_data *key_data = NULL; if (n_key_data < 0) return NULL; ...
vuln
Safe
C/C++
private void endMotionEvent(MotionEvent event, float x, float y, boolean forceCancel) { mTrackingPointer = -1; mAmbientState.setSwipingUp(false); if ((mTracking && mTouchSlopExceeded) || Math.abs(x - mInitialExpandX) > mTouchSlop || Math.abs(y - mInitialExpandY) > mTouchSlop ...
vuln
Vulnerable
Java
long Chapters::Atom::Parse(IMkvReader* pReader, long long pos, long long size) { const long long stop = pos + size; while (pos < stop) { long long id, size; long status = ParseElementHeader(pReader, pos, stop, id, size); if (status < 0) // error return status; if (size == 0) // weird continue; if (id == 0...
vuln
Vulnerable
C/C++
static int cbs_mpeg2_read_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit) { BitstreamContext bc; int err; err = bitstream_init(&bc, unit->data, 8 * unit->data_size); if (err < 0) return err; if (MPEG2_START_IS_SLICE(unit->type)) { MPEG2RawSli...
vuln
Vulnerable
C/C++
def scan_local(self, path, rules=None) -> dict: """ Scans local package Args: path (str): path to package rules (set, optional): Set of rule names to use. Defaults to all rules. Raises: Exception: Analyzer exception Returns: dict...
vuln
Vulnerable
Python
// SPDX-License-Identifier: (GPL-2.0 OR MIT) /* * SerDes PHY driver for Microsemi Ocelot * * Copyright (c) 2018 Microsemi * */ #include <linux/err.h> #include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> #include <linux/of_platform.h> #include <linux/phy/phy.h> #include <linux/platform_dev...
vuln
Vulnerable
C/C++
private static String fetchData(String url, String id) { try { LoggingHandler.felog.debug("Fetching " + id + " from " + url); URL uri = new URL(url); HttpsURLConnection huc = (HttpsURLConnection) uri.openConnection(); InputStream is; try { ...
vuln
Vulnerable
Java
package smokescreen import ( "context" "crypto/tls" "errors" "fmt" "io" "net" "net/http" "os" "os/signal" "strings" "syscall" "time" proxyproto "github.com/armon/go-proxyproto" "github.com/rs/xid" "github.com/sirupsen/logrus" "github.com/stripe/goproxy" "github.com/stripe/smokescreen/internal/einhorn...
vuln
Safe
Go
static always_inline void gen_sradi (DisasContext *ctx, int n) { int sh = SH(ctx->opcode) + (n << 5); if (sh != 0) { int l1, l2; TCGv t0; l1 = gen_new_label(); l2 = gen_new_label(); tcg_gen_brcondi_tl(TCG_COND_GE, cpu_gpr[rS(ctx->opcode)], 0, l1); t0 = tcg_temp_ne...
vuln
Vulnerable
C/C++
static void slc_bump(struct slcan *sl) { struct sk_buff *skb; struct can_frame cf; int i, tmp; u32 tmpid; char *cmd = sl->rbuff; cf.can_id = 0; switch (*cmd) { case 'r': cf.can_id = CAN_RTR_FLAG; /* fallthrough */ case 't': /* store dlc ASCII value and terminate SFF CAN ID string */ cf.can_dlc = sl->...
vuln
Vulnerable
C/C++
QPDFWriter::writeLinearized() { // Optimize file and enqueue objects in order discardGeneration(this->m->object_to_object_stream, this->m->object_to_object_stream_no_gen); bool need_xref_stream = (! this->m->object_to_object_stream.empty()); this->m->pdf.optimize(this->m->object_...
vuln
Safe
Unknown
/** * Copyright (c) 2006-2020, JGraph Ltd * Copyright (c) 2006-2020, draw.io AG */ //Add a closure to hide the class private variables without changing the code a lot (function() { var _token = null; window.GitLabClient = function(editorUi) { GitHubClient.call(this, editorUi, 'gitlabauth'); }; // Extends DrawioC...
vuln
Vulnerable
JavaScript
@NonNull public static ComponentsBlocker getInstance(@NonNull String packageName, int userHandle, boolean reloadFromDisk) { if (sInstance == null) { sInstance = new ComponentsBlocker(packageName, userHandle); } else if (reloadFromDisk || !sInstance.packageName.equals(packageName)) { ...
vuln
Vulnerable
Java
mwifiex_set_wmm_params(struct mwifiex_private *priv, struct mwifiex_uap_bss_param *bss_cfg, struct cfg80211_ap_settings *params) { const u8 *vendor_ie; const u8 *wmm_ie; u8 wmm_oui[] = {0x00, 0x50, 0xf2, 0x02}; vendor_ie = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT, WLAN_OUI_TYPE_MICROSO...
vuln
Vulnerable
C/C++
void ide_atapi_cmd(IDEState *s) { uint8_t *buf = s->io_buffer; const struct AtapiCmd *cmd = &atapi_cmd_table[s->io_buffer[0]]; #ifdef DEBUG_IDE_ATAPI { int i; printf("ATAPI limit=0x%x packet:", s->lcyl | (s->hcyl << 8)); for(i = 0; i < ATAPI_PACKET_SIZE; i++) { printf(" %...
vuln
Vulnerable
C/C++