text stringlengths 79 3.72M |
|---|
<vulnerable_code> }
public static Result editAccountSettings() {
User user = UsersDao.get().getById(session(USER_ID)); //TODO change session to userId
return ok(account.render(user));
}
}<commit_title>[PATCH] Fixed building queries - preventing SQL-injection<commit_description><fixed_code>
... |
<vulnerable_code>
public static Result showUser(int foreignerId) {
int userId = Integer.parseInt(session("user_id"));
User user = UsersDao.get().getById(foreignerId + "");
boolean isYourFriend = UsersDao.get().areFriends(userId, foreignerId);
if (user != null) {
return ok(user_info.render(user, isYourFrien... |
<vulnerable_code>package database;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
Connection connection = null;
try {
connection = DB.getConnection();
String sql = connection.nativeSQL("INSERT INTO exercise_ratings(user_id, exercise_id, rating)... |
<vulnerable_code>package database;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
Connection connection = null;
try {
connection = DB.getConnection();
String sql = connection.nativeSQL("INSERT INTO gym_ratings(user_id, gym_id, rating) VALUES" +... |
<vulnerable_code>import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
... |
<vulnerable_code>import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.ArrayList;
private WorkoutDao() {}
public List<Workout> getAll() {
return getWorkouts("SELECT workouts.*, gyms.... |
<vulnerable_code> const accountId = isScoped ? Number(urlParam) : '';
return accountId;
};<commit_title>[PATCH] fix: Render valid urls only in custom attributes (#3921)<commit_description><fixed_code>
const accountId = isScoped ? Number(urlParam) : '';
return accountId;
};
export const isValidURL = value => {
... |
<vulnerable_code> frontendURL,
conversationUrl,
accountIdFromPathname,
} from '../URLHelper';
describe('#URL Helpers', () => {
expect(accountIdFromPathname('')).toBe('');
});
});
});<commit_title>[PATCH] fix: Render valid urls only in custom attributes (#3921)<commit_description><fixed_code>
fronten... |
<vulnerable_code>import { mapGetters } from 'vuex';
export default {
computed: {
...mapGetters({
Number.isInteger(Number(attributeValue)) && Number(attributeValue) > 0
);
},
isAttributeLink(attributeValue) {
/* eslint-disable no-useless-escape */
const URL_REGEX = /^https?:\/\/(... |
<vulnerable_code> expect(wrapper.vm.attributeDisplayType(9988)).toBe('number');
});
it('return true if link is passed', () => {
const Component = {
render() {},
title: 'TestComponent',
mixins: [attributeMixin],
};
const wrapper = shallowMount(Component, { store, localVue });
ex... |
<vulnerable_code>/*
* Copyright 2016 Erwin Müller <erwin.mueller@deventm.org>
*
* 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
*
* U... |
<vulnerable_code> }
s->width = AV_RL16(&s->avctx->extradata[6]);
s->height = AV_RL16(&s->avctx->extradata[8]);
if ((ret = av_image_check_size(s->width, s->height, 0, avctx)) < 0) {
s->width= s->height= 0;
return ret;
}<commit_title>[PATCH] avcodec/vqavideo: Set video size<commit_descr... |
<vulnerable_code> href = ' style="cursor: default;"';
if (item_link == 'menu_item') {
href += ' title="' + htmlspecialchars(item.name) + '|"';
} else if (item_link == 'content_item' || item_link == 'content_item_or_url') {
href += ' title="' + htmlspecialchars(item.name) + '|"';
... |
<vulnerable_code>I={};A=a.branches.length-1;if(-1!==c){N=a._lFB(b,c,"panel_instances");for(t=0;t<A;++t)if(F=a.branches[t].refiners[a.branches[t+1].from])I["refiner__"+(E=F.name)]=F.id;if(F=a.branches[A].refiners[a.path])I["refiner__"+(E=F.name)]=F.id;d&&(I["refiner__"+d.name]=d.id)}N?(N.cmsSetsPath(b),N.cmsSetsRefiner(... |
<vulnerable_code>
@Override
public Response processControlCommand(ControlCommand command) throws Exception {
String control = command.getCommand();
if (control != null && control.equals("shutdown")) {
System.exit(0);
}
return null;
}
<commit_title>[PATCH] Remove u... |
<vulnerable_code> socket.io : https://www.npmjs.com/package/socket.io
swagger : https://www.npmjs.com/package/swagger-ui-express
uuid : https://www.npmjs.com/package/uuid
yamljs : https://www.npmjs.com/package/yamljs
}
*/
* @license For c... |
<vulnerable_code><commit_title>[PATCH] [mirotalk] - #139 add xss sanitize on server side<commit_description><fixed_code>
'use strict';
const xss = require('xss');
/**
* Prevent XSS injection by client side
* @param {object} cfg
* @returns sanitized object
*/
const checkXSS = (cfg) => {
// Object to string and... |
<vulnerable_code> * @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version... |
<vulnerable_code>#include "pcidsk_exception.h"
#include "core/pcidsk_utils.h"
#include <vector>
#include <string>
#include <cassert>
if (loaded_) {
return;
}
seg_data.SetSize((int)data_size - 1024);
ReadFromFile(seg_data.buffer, 0, data_size - 1024);
<commit_title>[PATCH] PCIDSK: fix write he... |
<vulnerable_code> suc_count = fail_count = 0
for k, v in variable_dict.items():
if session.scalar(select(models.Variable).where(models.Variable.key == k)):
logging.warning("Variable: %s already exist, skipping.", k)
skipped.add(k)
... |
<vulnerable_code> .replace(/</g, '<')
.replace(/>/g, '>');
window.escapeTag = function (input, ...parts) {
let output = input[0];
for (let i = 0; i < parts.length; i++) {
output = output + escapeHTML(parts[i]) + input[i + 1];<commit_title>[PATCH] Use arrow function /2<commit_description><fixed_code>
.repla... |
<vulnerable_code>
self.url_preview_ip_range_whitelist = generate_ip_set(
config.get("url_preview_ip_range_whitelist", ()),
config_path=("url_preview_ip_range_blacklist",),
)
self.url_preview_url_blacklist = config.get("url_preview_url_blacklist", ())<... |
<vulnerable_code> This includes:
* IPv4-Compatible IPv6 Address (see RFC 4291, section 2.5.5.1)
* IPv4-Mapped IPv6 Address (see RFC 4291, section 2.5.5.1)
* 6to4 Address (see RFC 3056, section 2)
Args:<commit_title>[PATCH] Fix copy and paste errors<commit_description>Co-authored-by: Denis Kasak <dk... |
<vulnerable_code> if (image->type != GrayscaleType)
(void) TransformImageColorspace(image,GRAYColorspace,exception);
if (image->storage_class == PseudoClass)
colormap_index=(ssize_t *) AcquireQuantumMemory(image->colors,
sizeof(*colormap_index));
else
colormap_index=(ssize_t *) AcquireQuantumMemo... |
<vulnerable_code> while (token[0] == ' ') {
token++;
}
op->operands[operand].type = ARM_NOTYPE;
op->operands[operand].reg_type = ARM_UNDEFINED;
op->operands[operand].shift = ARM_NO_SHIFT;<commit_title>[PATCH] Fix #12376 - crash in: rasm2 -a arm -b 64 '0 ,0,0,0,0,0,0,'<commit_description><fixed_code>
while... |
<vulnerable_code>// THE SOFTWARE.
// 'use strict'
var INDENT = ' ';
function inlineRule(objRule) {
var str = '';
objRule &&
Object.keys(objRule).forEach(function (rule) {
str += rule + ':' + objRule[rule] + ';';
});
return str;
}
<commit_title>[PATCH] fix-linters<commit_description>Signed-off-b... |
<vulnerable_code> case NGHTTP2_ERR_FLOODED:
return "Flooding was detected in this HTTP/2 session, and it must be "
"closed";
default:
return "Unknown error code";
}<commit_title>[PATCH] Implement max settings option<commit_description><fixed_code>
case NGHTTP2_ERR_FLOODED:
return "Flooding... |
<vulnerable_code> option->opt_set_mask |= NGHTTP2_OPT_MAX_OUTBOUND_ACK;
option->max_outbound_ack = val;
}<commit_title>[PATCH] Implement max settings option<commit_description><fixed_code>
option->opt_set_mask |= NGHTTP2_OPT_MAX_OUTBOUND_ACK;
option->max_outbound_ack = val;
}
void nghttp2_option_set_max_setting... |
<vulnerable_code>
(*session_ptr)->max_send_header_block_length = NGHTTP2_MAX_HEADERSLEN;
(*session_ptr)->max_outbound_ack = NGHTTP2_DEFAULT_MAX_OBQ_FLOOD_ITEM;
if (option) {
if ((option->opt_set_mask & NGHTTP2_OPT_NO_AUTO_WINDOW_UPDATE) &&
if (option->opt_set_mask & NGHTTP2_OPT_MAX_OUTBOUND_ACK) {
... |
<vulnerable_code> test_nghttp2_session_set_local_window_size) ||
!CU_add_test(pSuite, "session_cancel_from_before_frame_send",
test_nghttp2_session_cancel_from_before_frame_send) ||
!CU_add_test(pSuite, "session_removed_closed_stream",
test_nghttp2_ses... |
<vulnerable_code> nghttp2_session_del(session);
}
static void
prepare_session_removed_closed_stream(nghttp2_session *session,
nghttp2_hd_deflater *deflater) {<commit_title>[PATCH] Implement max settings option<commit_description><fixed_code>
nghttp2_session_del(session);
}
voi... |
<vulnerable_code> INTEGER("^[+-]?\\d+$"),
DECIMAL("^[+-]?((\\d+(\\.\\d+)?)|(\\.\\d+))$"),
MONEY("^[+-]?((\\d+(\\.\\d+)?)|(\\.\\d+))$"),
TEXT("^[a-zA-Z0-9_-]+$"), //Very restricted to prevent SQL Injection
COORDINATE("^(-?\\d+(\\.\\d+)?)|(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$"),
BOOLEAN("^(?i... |
<vulnerable_code> assertTrue(ValueType.TEXT.matches("XYZ"));
assertTrue(ValueType.TEXT.matches("123abc"));
assertTrue(ValueType.TEXT.matches("___XYZ123abcABC"));
assertTrue(ValueType.TEXT.matches("r2-d2"));
}
@Test<commit_title>[PATCH] Revert "Update: Make `-` a valid TEXT value ... |
<vulnerable_code>from io import StringIO
from django.core.management import call_command
from django.test import override_settings
from django.urls import reverse
from cookie_consent.cache import delete_cache
from cookie_consent.models import CookieGroup
from django_webtest import WebTest
from openforms.config.model... |
<vulnerable_code>from rest_framework.reverse import reverse
from openforms.config.models import GlobalConfiguration
from ..context_processors import sdk_urls
"enabled": config.display_sdk_information,
**sdk_urls(request=None),
}<commit_title>[PATCH 2/2] :bug: CVE-2022-31040 -- Fixes open redirect... |
<vulnerable_code>from urllib.parse import urlparse, urlunparse
from corsheaders.conf import conf as cors_conf
from corsheaders.middleware import CorsMiddleware
are allowed to access Open Forms. We leverage this configuration to block or allow
redirects to external hosts.
"""
cors = CorsMiddleware()
... |
<vulnerable_code>def link_dialog(request):
# list of wiki pages
name = request.values.get("pagename", "")
if name:
from MoinMoin import search
# XXX error handling!
<tr>
<td>
<span fckLang="PageDlgName">Page Name</span><br>
<input id="txtPagename" name="p... |
<vulnerable_code> "Faulty method invocation. Neither class '%s' "
+ "nor its super classes declare event handler method '%s'",
instance.getClass().getName(), methodName));
throw new IllegalStateException("Faulty method invocation");
... |
<vulnerable_code>}
function apiPost(functionCall, postParameters, callbackFunction) {
new Ajax.Request(baseurl+"?p="+encodeURIComponent(functionCall),
{
method:"post",<commit_title>[PATCH] security: add protection against XSRF (Cross Site Request<commit_description><fixed_code>
}
function apiPost(functionCall, ... |
<vulnerable_code> &ctxt->exception);
}
/* Does not support long mode */
static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
u16 selector, int seg, u8 cpl,
enum x86_transfer_type transfer,
rpl = selector & 3;
/* NULL selector is not valid for TR, CS and SS (except for long m... |
<vulnerable_code> next();
});
app.get("/health", (req, res) => res.sendStatus(200));
const handler = (res, params) => {
app.get("/", (req, res) => handler(res, req.query));
app.post("/", (req, res) => handler(res, req.body));
app.get("/dynamic", (req, res) =>
handler(res, { ...req.query, renderToHtml: true })
);
... |
<vulnerable_code>#!/usr/bin/python3
import requests, json, sys, time, os, html
#call parameters
ChargePoint = str(sys.argv[1])
code = str(sys.argv[2])
#Debug = int(os.environ.get('debug'))
Debug = 0
moddir = '/var/www/html/openWB/modules/soc_eq/'
def printDebug(message, level):
htmlmsg = ... |
<vulnerable_code>#!/usr/bin/python3
import os, requests, json, time, sys, os
from datetime import datetime, timezone
from requests.exceptions import Timeout, RequestException
from json import JSONDecodeError
ramdiskdir = '/var/www/html/openWB/ramdisk/'
moduledir = '/var/www/html/openWB/modules/soc_eq/'
req_timeout=(... |
<vulnerable_code> }
if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),"return");
if (image==NULL)
ThrowReaderException(CorruptImageError,"ImproperImageHeader")
else
if ((image != image2) && (image2 != (Image *) NULL))
image2=DestroyImage(image2);
return (image);
}
<commit_title>[PAT... |
<vulnerable_code>/*******************************/
const UA_ConnectionConfig UA_ConnectionConfig_default = {
0, /* .protocolVersion */
65535, /* .sendBufferSize, 64k per chunk */
65535, /* .recvBufferSize, 64k per chunk */
0, /* .localMaxMessageSize, 0 -> unlimited */
0, /* .remoteMaxMe... |
<vulnerable_code> UA_SecureChannel_init(&testChannel, &UA_ConnectionConfig_default);
UA_SecureChannel_setSecurityPolicy(&testChannel, &dummyPolicy, &dummyCertificate);
testingConnection = createDummyConnection(65535, &sentData);
UA_Connection_attachSecureChannel(&testingConnection, &testChannel);
te... |
<vulnerable_code> return Version(major, minor, micro, release, pre, post, dev)
__version_info__ = Version(9, 11, 0, "final")
__version__ = __version_info__._get_canonical()<commit_title>[PATCH] Merge pull request from GHSA-jh85-wwv9-24hv<commit_description>* Add `restrict_base_path` and make it the default
New op... |
<vulnerable_code> base = config.get('base_path')
if isinstance(base, str):
base = [base]
self.base_path = base
self.encoding = config.get('encoding')
self.check_paths = config.get('check_paths')
self.auto_append = config.get('auto_append')
for base in s... |
<vulnerable_code> )
class TestSnippetsAutoAppend(util.MdCase):
"""Test snippet file case."""
<commit_title>[PATCH] Merge pull request from GHSA-jh85-wwv9-24hv<commit_description>* Add `restrict_base_path` and make it the default
New option to restrict snippets to be actual children of the base path
for a ... |
<vulnerable_code> }
}
/**
* Return true iff <b>guard</b> obeys the restrictions defined in <b>rst</b>.
* (If <b>rst</b> is NULL, there are no restrictions.)
if (! rst)
return 1; // No restriction? No problem.
// Only one kind of restriction exists right now
return tor_memneq(guard->identity, rst->exclud... |
<vulnerable_code>
/** Return true iff router1 and router2 have similar enough network addresses
* that we should treat them as being in the same family */
static inline int
addrs_in_same_network_family(const tor_addr_t *a1,
const tor_addr_t *a2)
{<commit_title>[PATCH] Consider the exit fam... |
<vulnerable_code> return(SetStreamBuffering(image_info,blob_info));
}
#if defined(MAGICKCORE_HAVE_POPEN) && defined(MAGICKCORE_PIPES_SUPPORT)
if ((*filename == '|') && (strchr(filename,'`') == (char *) NULL) &&
(strchr(filename,'"') == (char *) NULL))
{
char
fileMode[MagickPathExtent]... |
<vulnerable_code> Jsi_ValueToNumber(interp, v);
nv = v->d.num;
}
_this->d.obj->ot = JSI_OT_NUMBER;
_this->d.obj->d.num = nv;
Jsi_ValueToObject(interp, _this);
Jsi_ValueMakeNumber(interp, ret, nv);
return JSI_OK;
}<commit_title>[PATCH] Fix issue ... |
<vulnerable_code> GF_ChannelLayoutBox *ptr = (GF_ChannelLayoutBox *) s;
ISOM_DECREASE_SIZE(s, 1)
ptr->layout.stream_structure = gf_bs_read_u8(bs);
if (ptr->layout.stream_structure & 1) {
ISOM_DECREASE_SIZE(s, 1)
ptr->layout.definedLayout = gf_bs_read_u8(bs);
u32 remain = (u32) ptr->size;
if (ptr->layout.s... |
<vulnerable_code> e = CanAccessMovie(movie, GF_ISOM_OPEN_WRITE);
if (e) return e;
trak = gf_isom_get_track_from_file(movie, trackNumber);
if (!trak) return GF_BAD_PARAM;
<commit_title>[PATCH] fixed #2606<commit_description><fixed_code>
e = CanAccessMovie(movie, GF_ISOM_OPEN_WRITE);
if (e) return e;
if (!layout)... |
<vulnerable_code>export const AuthButton = () => {
const [App, setApp] = useContext(AppContext);
const { isAuthenticated } = App;
console.log(' -> The App: ', App);
const setAccessToken = (accessToken) => {
sessionStorage.setItem('accessToken', accessToken);
setApp("accessToken",accessToken);
setAp... |
<vulnerable_code>export const InteractiveGraph = ({ symbol, symbolName }) => {
const [history, setHistory] = useState([]);
const [App, setApp] = useContext(AppContext);
const { isAuthenticated, messages } = App;
const lsDataPoints = JSON.parse(localStorage.getItem("dataPoints")) || {
EOD: true,
};
const... |
<vulnerable_code> setApp('messages', messages);
};
messages.forEach(({ message, classification }, index) => {
messageList.push(
<MessageTemplate
messageIndex={index}
key={`messageId-${index}`}
message={message}
classification={classification}
buttonOnclick={remo... |
<vulnerable_code>export const SymbolChooser = ({ symbolChangeHandler, symbol, symbolName }) => {
let [symbols, setSymbols] = useState({});
const [App] = useContext(AppContext);
const { isAuthenticated } = App;
const selectedOption = {
value: symbol,
label: symbolName,
}
useEffec... |
<vulnerable_code>
function AppProvider(props) {
const accessToken = sessionStorage.getItem('accessToken') || undefined;
console.log(' -> initial auth state: ', !!(accessToken));
const [App, setApp] = useState({
accessToken,
isAuthenticated: !!(accessToken),
messages: [],
});<commit_title>[PATCH] Fou... |
<vulnerable_code>import org.gradle.api.internal.file.AbstractFileTreeElement;
import org.gradle.internal.file.Chmod;
import org.gradle.util.internal.GFileUtils;
import java.io.File;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* Returns a safe name for the name of a file contained in the archive.
... |
<vulnerable_code> }
@Override
protected String safeEntryName() {
return entry.getName();
}
<commit_title>[PATCH] Refactor AbstractArchiveFileTreeElement to use ZipSlip by<commit_description><fixed_code>
}
@Override
protected String getEntryName() {
... |
<vulnerable_code>import java.util.concurrent.atomic.AtomicBoolean;
import static java.lang.String.format;
import static org.gradle.util.internal.ZipSlip.safeZipEntryName;
public class ZipFileTree extends AbstractArchiveFileTree {
private final Provider<File> fileProvider;
}
@Override
prot... |
<vulnerable_code> } else if (url.password) {
result += ':'+ url.password;
result += '@';
}
result += url.host + url.pathname;<commit_title>[PATCH] [fix] Readd the empty userinfo to `url.href` (#226)<commit_description>If the userinfo is present but empty, the parsed host is also empty, and
`url.pathname` ... |
<vulnerable_code> assume(parsed.pathname).equals('/');
assume(parsed.href).equals('http://user%40:pas%3As%40@www.example.com/');
});
});
it('accepts multiple ???', function () {<commit_title>[PATCH] [fix] Readd the empty userinfo to `url.href` (#226)<commit_description>If the userinfo is present but... |
<vulnerable_code> var selects = django.jQuery(selectsSelector);
selects.find('option').each(function() {
if (this.value === objId) {
this.innerHTML = newRepr;
this.value = newId;
}
});<commit_title>[PATCH] [1.9.x] Fixed XSS in admin's add/ch... |
<vulnerable_code> """
list_editable foreign keys have add/change popups.
"""
s1 = Section.objects.create(name='Test section')
Article.objects.create(
content='<p>Middle content</p>',
date=datetime.datetime(2008, 3, 18, 11, 54, 58),
section=s1,
... |
<vulnerable_code><commit_title>[PATCH] Move JWT login code to a separate handler.<commit_description><fixed_code>
# Copyright 2023 Matrix.org Foundation C.I.C.
#
# 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 o... |
<vulnerable_code>
# JWT configuration variables.
self.jwt_enabled = hs.config.jwt.jwt_enabled
self.jwt_secret = hs.config.jwt.jwt_secret
self.jwt_subject_claim = hs.config.jwt.jwt_subject_claim
self.jwt_algorithm = hs.config.jwt.jwt_algorithm
self.jwt_issuer = hs.config.j... |
<vulnerable_code>if TYPE_CHECKING:
from txredisapi import ConnectionHandler
from synapse.handlers.oidc import OidcHandler
from synapse.handlers.saml import SamlHandler
def get_sso_handler(self) -> SsoHandler:
return SsoHandler(self)
@cache_in_self
def get_sync_handler(self) -> SyncHan... |
<vulnerable_code> zfile.extractall(path=dst_path)
# ================================ untar file
# untar the provided file to the dst_path
def untar_file(tar_path, dst_path):
with tarfile.open(tar_path , mode='r') as tfile:
tfile.extractall(path=dst_path)
# ================================ list zi... |
<vulnerable_code>{
#if defined(MAGICKCORE_LOCALE_SUPPORT)
if (c_locale != (locale_t) NULL)
return(tolower_l(c,c_locale));
#endif
return(tolower(c));
}
/*
{
#if defined(MAGICKCORE_LOCALE_SUPPORT)
if (c_locale != (locale_t) NULL)
return(toupper_l(c,c_locale));
#endif
return(toupper(c));
}
/*<commit_ti... |
<vulnerable_code> // (URI Fragments within 302 Location URI are lost over HTTPS)
// Loading the redirect.html before triggering the OAuth Flow seems to fix it.
else if ('oauth_redirect' in p) {
location.assign(decodeURIComponent(p.oauth_redirect));
return;
}
<commit_title>[PATCH] fix(xss): oauth_redirect ... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4048,
/**/<commit_title>[PATCH] patch 8.2.4049: Vim9: reading before the start of the line<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
40... |
<vulnerable_code> len = get_env_len(arg);
if (len == 0)
{
semsg(_(e_syntax_error_at_str), start - 1);
return FAIL;
}
<commit_title>[PATCH] patch 8.2.4049: Vim9: reading before the start of the line<commit_description><fixed_code>
len = get_env_len(arg);
if (len == 0)
{
semsg(_(e_syntax_err... |
<vulnerable_code>
/* POST create user */
router.post('/new', function(req, res, next) {
console.log(req.body);
var username = req.body.username;
var password = req.body.password;
}
var conn = mysql.createConnection({
host : "localhost",
user : "root",
password: "root",
port : 3306... |
<vulnerable_code>import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoUnit;
import java.util.Arrays;
import java.util.Collection;
import java.util.stream.Collectors;
import com.vaadin.flow.server.connect.Endpoint;
import c... |
<vulnerable_code> //
_tmpBuffer = new unsigned short
[checkArraySize (uiMult (maxScanLineSize, numScanLines),
sizeof (unsigned short))];
const ChannelList &channels = header().channels();<commit_title>[PATCH] reduce B44 _tmpBufferSize (was allocating two bytes per byte)<com... |
<vulnerable_code> switch (a->name)
{
case MAPI_ATTACH_LONG_FILENAME:
if (file->name) XFREE(file->name);
file->name = strdup( (char*)a->values[0].data.buf );
break;
case MAPI_ATTACH_DATA_OBJ:
file->len = a->values[0].len;
if (file->data) XFREE (file->data);
file->data = CHECKED_XMALLOC (u... |
<vulnerable_code> int j;
for (j = 0; j < a->num_values; j++)
{
body[j] = XMALLOC(VarLenData, 1);
body[j]->len = a->values[j].len;
body[j]->data = CHECKED_XCALLOC(unsigned char, a->values[j].len);
memmove (body[j]->data, a->values[j].data.buf, body[j]->len);
}
return body;
}
for (i = 0; mapi... |
<vulnerable_code> parser.feed_data(text)
@pytest.mark.parametrize(
"hdr",
(
parser.feed_data(text)
def test_parse(parser: Any) -> None:
text = b"GET /test HTTP/1.1\r\n\r\n"
messages, upgrade, tail = parser.feed_data(text)
assert r"\n" not in exc_info.value.message
def test_http_... |
<vulnerable_code> rz_list_append(string_list, bin_string);
}
static void try_free_empty_list(RzList *list) {
if (list != NULL) {
rz_list_free(list);
}
}
static void free_rz_section(RzBinSection *section) {
if (!section) {
return;
RZ_FREE(addr);
}
LuacBinInfo *luac_build_info(LuaProto *proto) {
if (!proto) {... |
<vulnerable_code> return NULL;
}
return bin_info_obj->symbol_list;
}
static RzList *entries(RzBinFile *bf) {
return NULL;
}
return bin_info_obj->entry_list;
}
static RzList *strings(RzBinFile *bf) {
return NULL;
}
return bin_info_obj->string_list;
}
RzBinPlugin rz_bin_plugin_luac = {
.license = "LGPL3... |
<vulnerable_code> return false;
}
private static final Set<UpnpHeader.Type> allowedUpnpHeaders=new HashSet<>(Arrays.asList(UpnpHeader.Type.EXT, UpnpHeader.Type.ST, UpnpHeader.Type.SERVER, UpnpHeader.Type.USN, UpnpHeader.Type.LOCATION, UpnpHeader.Type.MAX_AGE));
/*
* Fix DDOS and SSRF issue : https://github.com/4... |
<vulnerable_code>
/* If this is a symlink, read the link contents. */
if (archive_entry_filetype(entry) == AE_IFLNK) {
h = __archive_read_ahead(a,
(size_t)cpio->entry_bytes_remaining, NULL);
if (h == NULL)<commit_title>[PATCH] Reject cpio symlinks that exceed 1MB<commit_description><fixed_code>
/* If this is... |
<vulnerable_code> struct radio_pdu_node_tx *node_tx);
static void connection_release(struct connection *conn);
static void terminate_ind_rx_enqueue(struct connection *conn, u8_t reason);
static u8_t conn_update(struct connection *conn, struct pdu_data *pdu_data_rx);
#if defined(CONFIG_BT_CTLR_XTAL_ADVANCED) && \... |
<vulnerable_code> if msg_obj.channel is None:
raise ExecutionError(f"Failed to issue command. I could not find the "
"notification channel.")
msg_obj.author = issuer
prefix = await cog.bot.get_prefix(msg_obj)... |
<vulnerable_code> .isProductionMode();
String template = getErrorHtml(productionMode);
template = template.replace("{{path}}", path);
template = template.replace("{{additionalInfo}}", additionalInfo);
if (template.contains("{{routes}}")) {
template = template.... |
<vulnerable_code><commit_title>[PATCH] fix: set routes first into the template<commit_description>fixes psi#26<fixed_code>
/*
* Copyright 2000-2021 Vaadin Ltd.
*
* 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... |
<vulnerable_code> buf->str[--buf->len] = 0;
}
int ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in)
{
char *param, buffer[128], tmp[128];
case '<':
tag_close = in[1] == '/';
len = 0;
if (sscanf(in+tag_close+1, "%127[^<>]>%n", buffer, &len) >= ... |
<vulnerable_code> else
ks->ks_v_out_map[inx].om_cl = *key_find_cl (ks->ks_key, col_id);
ks->ks_v_out_map[inx].om_ssl = ssl;
if (col)
ks->ks_v_out_map[inx].om_ref = col_ref_func (ks->ks_key, col, ks->ks_v_out_map[inx].om_ssl);
ssl->ssl_type = SSL_VEC;
if (!ssl->ssl_box_index)
ssl->ssl_box_index = cc_new_ins... |
<vulnerable_code> * Writes the SOT marker (Start of tile-part)
*
* @param p_j2k J2K codec.
* @param p_data FIXME DOC
* @param p_data_written FIXME DOC
* @param p_stream the stream to write data to.
* @param p_manager the user event manager.
*/
st... |
<vulnerable_code> const BYTE* palette = Stream_Pointer(s) + 16;
const INT32 bytesPerPixel = ((bpp + 1) / 8);
if (!Stream_SafeSeek(s, 16ULL + 7ULL * bytesPerPixel)) // 64 / 4
return FALSE;
for (y = 7; y >= 0; y--)
static BOOL update_recv_secondary_order(rdpUpdate* update, wStream* s, BYTE flags)
{
BOOL rc = FALS... |
<vulnerable_code> env->parse_depth++;
if (env->parse_depth > ParseDepthLimit)
return ONIGERR_PARSE_DEPTH_LIMIT_OVER;
prev_cc = (CClassNode* )NULL;
r = fetch_token_in_cc(tok, src, end, env);
if (r == TK_CHAR && tok->u.c == '^' && tok->escaped == 0) {
parse_exp(Node** np, PToken* tok, int term, UChar** src, ... |
<vulnerable_code> */
protected StaticFileHandler createStaticFileHandler(
VaadinServletService servletService) {
return new StaticFileServer(servletService);
}
protected void servletInitialized() throws ServletException {<commit_title>[PATCH] refactor: use StaticFileHandler as a ser... |
<vulnerable_code>const exec = require('child_process').exec;
module.exports = async function (bin, options) {
return new Promise((resolve, reject) => {
const cmd = `${process.cwd()}/node_modules/.bin/${bin}`;
console.log(`Running \`${cmd}\``);
<commit_title>[PATCH] fixes(CVE-2022-25923): resolves ... |
<vulnerable_code> goto err_exit;
}
}
if ((int) ref_function_name_length < 0) {
goto err_exit;
}
for (j = 0; j < ref_function_name_length; j++) {<commit_title>[PATCH] fix #11274 attempt.<commit_description>basically with the given name function section size
was way above, we consider as faulty even thou... |
<vulnerable_code>@cached(ttl=60)
def get_allowed_tenants() -> List[str]:
config = InstanceConfig.fetch()
entries = [f"https://sts.windows.net/{x}" for x in config.allowed_aad_tenants]
return entries
code=ErrorCode.INVALID_REQUEST, errors=["missing issuer from token"]
)
if token["i... |
<vulnerable_code> return rv;
}
#define oidc_cache_crypto_openssl_error(r, fmt, ...) \
oidc_error(r, "%s: %s", apr_psprintf(r->pool, fmt, ##__VA_ARGS__), ERR_error_string(ERR_get_error(), NULL))
#define OIDC_CACHE_CIPHER EVP_aes_256_gcm()
#define OIDC_CACHE_TAG_LEN 16
#if (OPENSSL_VERSION_NUMBER >= 0x10... |
<vulnerable_code> * returns a deep copy of the result, thus doesn't alter inputs.
*/
function mergeScaleConfig(/* config objects ... */) {
return helpers.merge({}, [].slice.call(arguments), {
merger: function(key, target, source, options) {
if (key === 'xAxes' || key === 'yAxes') {
var slen = source[key].len... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.