Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
18
19
content
stringlengths
177
10.5k
max_stars_repo_path
stringlengths
39
40
vul4j_data_VUL4J-65
static public File allocateFile(File dir, String name) { int q = name.indexOf('?'); if (q > 0) { name = name.substring(0, q); } File file = new File(dir, name); int dot = name.indexOf('.'); String prefix = dot < 0 ? name : name.substring(0, dot); String suffix = dot < 0 ? "" : name.s...
./VJBench/llm-vul/VJBench-trans/VUL4J-65
vul4j_data_VUL4J-73
public boolean isPasswordValid(String encPass, String rawPass, Object salt) { String pass1 = encPass + ""; String pass2 = mergePasswordAndSalt(rawPass, salt, false); if (ignorePasswordCase) { pass1 = pass1.toLowerCase(Locale.ENGLISH); pass2 = pass2.toLowerCase(Locale.ENGLISH); } return PasswordEncoderUtils.eq...
./VJBench/llm-vul/VJBench-trans/VUL4J-73
vul4j_data_VUL4J-4
protected Object doGetDocument(Exchange exchange, Object body) throws Exception { if (body == null) { return null; } Object answer = null; Class<?> type = getDocumentType(); Exception cause = null; if (type != null) { try { answer = exchange.getContext().getTypeConver...
./VJBench/llm-vul/VJBench-trans/VUL4J-4
vul4j_data_VUL4J-53
void setTo(Calendar c, int i) { c.set(field,i-offset); } void setTo(Calendar c, int i) { int n = Math.min(i-offset, c.getActualMaximum(field)); c.set(field, n); }
./VJBench/llm-vul/VJBench-trans/VUL4J-53
vul4j_data_VUL4J-43
public static void writeEntry(ZipFile zipFile, ZipEntry entry, File destDir) throws IOException { File outFile = new File(destDir, entry.getName()); if (entry.isDirectory()) { outFile.mkdirs(); } else { outFile.getParentFile().mkdirs(); try (InputStream in = zipFile.getInputStream(entry)) { IOUtil.writeSt...
./VJBench/llm-vul/VJBench-trans/VUL4J-43
vul4j_data_VUL4J-61
private Stream<MapResult> xmlXpathToMapResult(@Name("url") String url, boolean simpleMode, String path, Map<String, Object> config) throws Exception { if (config == null) config = Collections.emptyMap(); boolean failOnError = (boolean) config.getOrDefault("failOnError", true); List<MapResult> result = new A...
./VJBench/llm-vul/VJBench-trans/VUL4J-61
vul4j_data_VUL4J-8
@Override public ByteBuffer encode(final String name) { final CharsetEncoder enc = newEncoder(); final CharBuffer cb = CharBuffer.wrap(name); CharBuffer tmp = null; ByteBuffer out = ByteBuffer.allocate(estimateInitialBufferSize(enc, cb.remaining())); while (cb.remaining() > 0) { final CoderR...
./VJBench/llm-vul/VJBench-trans/VUL4J-8
vul4j_data_VUL4J-66
protected static boolean isValid(String str) { if (str == null || str.length() == 0) return false; for (int i = 0; i < str.length(); i++) { switch (str.charAt(i)) { case '/': case '\\': case '?': case ':': case '<': case '>': case ';': ...
./VJBench/llm-vul/VJBench-trans/VUL4J-66
vul4j_data_VUL4J-26
public String getUrlRegex() { if (StringUtils.isNotEmpty(urlRegexExpression)) { return (String) parse(urlRegexExpression, String.class); } else if (StringUtils.isNotEmpty(urlRegex)) { return urlRegex; } else { return "^(https?|ftp):\\/\\/" + "(([a-z0-9$_\\.\\+!\\*\\'\...
./VJBench/llm-vul/VJBench-trans/VUL4J-26
vul4j_data_VUL4J-40
public boolean isAllowed(HttpServletRequest request) throws IOException { String requestBody = IOUtils.toString(request.getReader()); ScimUser scimUserFromRequest = JsonUtils.readValue(requestBody, ScimUser.class); String id = UaaUrlUtils.extractPathVariableFromUrl(USER_ID_PATH_PARAMETER_INDEX, UaaUrlUtils....
./VJBench/llm-vul/VJBench-trans/VUL4J-40
vul4j_data_VUL4J-6
public void parseCentralDirectoryFormat(final byte[] data, final int offset, final int length) { this.format = ZipShort.getValue(data, offset); this.algId = EncryptionAlgorithm.getAlgorithmByCode(ZipShort.getValue(data, offset + 2)); this.bitlen = ZipShort.getValue(data, offset + 4); this.flags = ZipSho...
./VJBench/llm-vul/VJBench-trans/VUL4J-6
vul4j_data_VUL4J-23
@Override public String encodeForJSString(String source) { return source == null ? null : Encode.forJavaScriptSource(source); } @Override public String encodeForJSString(String dataProvider) { if( dataProvider != null ){ return Encode.forJavaScript(source).replace("\\-", "\\u002D"); } return n...
./VJBench/llm-vul/VJBench-trans/VUL4J-23
vul4j_data_VUL4J-50
private void writeSession(SessionInformations session, boolean displayUser) throws IOException { final String nextColumnAlignRight = "</td><td align='right'>"; final String nextColumnAlignCenter = "</td><td align='center'>"; write("<td><a href='?part=sessions&amp;sessionId="); write(htmlEncodeButNotSpace(session.ge...
./VJBench/llm-vul/VJBench-trans/VUL4J-50
vul4j_data_VUL4J-44
public String encodeCharacter( char[] immune, Character c ) { String cStr = String.valueOf(c.charValue()); byte[] bytes; StringBuilder sb; if(UNENCODED_SET.contains(c)) return cStr; bytes = toUtf8Bytes(cStr); sb = new StringBuilder(bytes.length * 3); for(byte b : bytes) appendTwoUpperHex(sb.append('%'), b); ...
./VJBench/llm-vul/VJBench-trans/VUL4J-44
vul4j_data_VUL4J-20
public float[] toFloatArray() { float[] retval = new float[size()]; for (int i = 0; i < size(); i++) { retval[i] = ((COSNumber)getObject( i )).floatValue(); } return retval; } public float[] toFloatArray() { int size = size(); float[] retval = new float[size]; ...
./VJBench/llm-vul/VJBench-trans/VUL4J-20
vul4j_data_VUL4J-30
public void validate(Object object) throws ValidationException { String fieldName = getFieldName(); Object value = this.getFieldValue(fieldName, object); if (value == null || value.toString().length() == 0) { return; } if (!(value.getClass().equals(String.class)) || !Pattern.compile(getUrlRe...
./VJBench/llm-vul/VJBench-trans/VUL4J-30
vul4j_data_VUL4J-39
@Override public String toString() { StringBuilder sb = new StringBuilder(); if (origin != null) { sb.append("remoteAddress=").append(origin); } if (clientId != null) { if (sb.length() > 0) { sb.append(", "); } sb.append("clientId=").append(clientId); } ...
./VJBench/llm-vul/VJBench-trans/VUL4J-39
vul4j_data_VUL4J-12
private int extend(int v, final int t) { int vt = (1 << (t - 1)); while (v < vt) { vt = (-1 << t) + 1; v += vt; } return v; } private int extend(int v, final int t) { int vt = (1 << (t - 1)); if (v < vt) { vt = (-1 << t) + 1; v += vt; } return v; }
./VJBench/llm-vul/VJBench-trans/VUL4J-12
vul4j_data_VUL4J-19
@Override public void prepareForDecryption(PDEncryption encryption, COSArray documentIDArray, DecryptionMaterial decryptionMaterial) throws IOException { if(!(decryptionMaterial instanceof StandardDecryptionMaterial)) { throw new IOExcept...
./VJBench/llm-vul/VJBench-trans/VUL4J-19
vul4j_data_VUL4J-57
@SuppressWarnings({"unchecked", "rawtypes"}) @Override public boolean start() throws Exception { String job = step.getJob(); Item item = Jenkins.getActiveInstance().getItem(job, invokingRun.getParent(), Item.class); if (item == null) { throw new AbortException("No item named " + job + " found"); ...
./VJBench/llm-vul/VJBench-trans/VUL4J-57
vul4j_data_VUL4J-25
@Override @Nonnull public String getValidHref(final String url) { if (StringUtils.isNotEmpty(url)) { try { String unescapedURL = URLDecoder.decode(url, StandardCharsets.UTF_8.name()); unescapedURL = StringEscapeUtils.unescapeXml(unescapedURL); String encodedUrl = unescape...
./VJBench/llm-vul/VJBench-trans/VUL4J-25
vul4j_data_VUL4J-74
public SecureRandom getObject() throws Exception { SecureRandom rnd = SecureRandom.getInstance(algorithm); if (seed != null) { byte[] seedBytes = FileCopyUtils.copyToByteArray(seed.getInputStream()); rnd.setSeed(seedBytes); } else { rnd.nextBytes(new byte[1]); } return rnd; } public SecureRandom getObje...
./VJBench/llm-vul/VJBench-trans/VUL4J-74
vul4j_data_VUL4J-46
protected XmlFactory(ObjectCodec oc, int xpFeatures, int xgFeatures, XMLInputFactory xmlIn, XMLOutputFactory xmlOut, String nameForTextElem) { super(oc); _xmlParserFeatures = xpFeatures; _xmlGeneratorFeatures = xgFeatures; _cfgNameForTextElement = nameForTextElem; if (xmlIn == null) ...
./VJBench/llm-vul/VJBench-trans/VUL4J-46
vul4j_data_VUL4J-3
@Converter public SAXSource toSAXSourceFromStream(StreamSource source, Exchange exchange) throws SAXException { InputSource inputSource; if (source.getReader() != null) { inputSource = new InputSource(source.getReader()); } else { inputSource = new InputSource(source.getInputStream()); }...
./VJBench/llm-vul/VJBench-trans/VUL4J-3
vul4j_data_VUL4J-5
private void expand(ArchiveEntrySupplier supplier, EntryWriter writer, File targetDirectory) throws IOException { String targetDirPath = targetDirectory.getCanonicalPath(); ArchiveEntry nextEntry = supplier.getNextReadableEntry(); while (nextEntry != null) { File f = new File(targetDirectory, ne...
./VJBench/llm-vul/VJBench-trans/VUL4J-5
vul4j_data_VUL4J-10
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); OutputStream output = getOutputStream(); if (cachedContent != null) { output.write(cachedContent); } else { FileInputStream input = new FileInputStream(dfosFile); ...
./VJBench/llm-vul/VJBench-trans/VUL4J-10
vul4j_data_VUL4J-41
protected void extractFile( final File srcF, final File dir, final InputStream compressedInputStream, final String entryName, final Date entryDate, final boolean isDirectory, final Integer mode, String symlinkDestination ) throws IOException, ArchiverException...
./VJBench/llm-vul/VJBench-trans/VUL4J-41
vul4j_data_VUL4J-7
private int readStored(final byte[] buffer, final int offset, final int length) throws IOException { if (current.hasDataDescriptor) { if (lastStoredEntry == null) { readStoredEntry(); } return lastStoredEntry.read(buffer, offset, length); } final long csize = current.entr...
./VJBench/llm-vul/VJBench-trans/VUL4J-7
vul4j_data_VUL4J-59
void read(Tokeniser t, CharacterReader r) { char c = r.consume(); switch (c) { case '\t': case '\n': case '\r': case '\f': case ' ': break; case '"': t.transition(AttributeValue_doubleQuoted); break; case '&': ...
./VJBench/llm-vul/VJBench-trans/VUL4J-59
vul4j_data_VUL4J-1
@SuppressWarnings({ "unchecked", "rawtypes" }) public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) { final JSONLexer lexer = parser.lexer; if (lexer.token() == JSONToken.NULL) { lexer.nextToken(JSONToken.COMMA); return null; } if (lexer.token() == JSONToken.LIT...
./VJBench/llm-vul/VJBench-trans/VUL4J-1
vul4j_data_VUL4J-22
public static String getContextPath(HttpServletRequest request) { String contextPath = (String) request.getAttribute(INCLUDE_CONTEXT_PATH_ATTRIBUTE); if (contextPath == null) { contextPath = request.getContextPath(); } if ("/".equals(contextPath)) { contextPath = ""; } r...
./VJBench/llm-vul/VJBench-trans/VUL4J-22
vul4j_data_VUL4J-47
protected XmlFactory(ObjectCodec oc, int xpFeatures, int xgFeatures, XMLInputFactory xmlIn, XMLOutputFactory xmlOut, String nameForTextElem) { super(oc); _xmlParserFeatures = xpFeatures; _xmlGeneratorFeatures = xgFeatures; _cfgNameForTextElement = nameForTextElem; if (xmlIn == null) ...
./VJBench/llm-vul/VJBench-trans/VUL4J-47
vul4j_data_VUL4J-64
final static private XMLStreamReader createXMLStreamReader(InputStream inputStream) throws XMLStreamException, IOException { XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.IS_COALESCING, true); factory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, ...
./VJBench/llm-vul/VJBench-trans/VUL4J-64
vul4j_data_VUL4J-18
public String getForwardPage( HttpServletRequest request ) { return request.getPathInfo(); } public String getForwardPage( HttpServletRequest request ) { return "Wiki.jsp"; }
./VJBench/llm-vul/VJBench-trans/VUL4J-18
vul4j_data_VUL4J-55
public Calendar ceil(Calendar cal) { Calendar twoYearsFuture = (Calendar) cal.clone(); twoYearsFuture.add(Calendar.YEAR, 2); OUTER: while (true) { if (cal.compareTo(twoYearsFuture) > 0) { throw new RareOrImpossibleDateException(); } for (CalendarField f : CalendarFiel...
./VJBench/llm-vul/VJBench-trans/VUL4J-55
README.md exists but content is empty.
Downloads last month
4