text
stringlengths
79
3.72M
<vulnerable_code> FILE *file; ogg_stream_state *stream; int seq; gboolean started; gboolean stopping; volatile gint hangingup; volatile gint destroyed; janus_refcount ref; /* Remove the reference to the core plugin session */ janus_refcount_decrease(&session->handle->ref); /* This session can be destroyed, fr...
<vulnerable_code>static URI_INLINE void URI_FUNC(PreventLeakage)(URI_TYPE(Uri) * uri, unsigned int revertMask, UriMemoryManager * memory) { if (revertMask & URI_NORMALIZE_SCHEME) { memory->free(memory, (URI_CHAR *)uri->scheme.first); uri->scheme.first = NULL; uri->scheme.afterLast = NULL; } if (revertMask &...
<vulnerable_code> return retval; } /* * Return a string format of an X509_NAME in buf where * size is an in/out parameter. On input it is the size * of the buffer, and on output it is the actual length * of the name. * If buf is NULL, returns the length req'd to hold name */ static char * X509_NAME_oneline_e...
<vulnerable_code> return val ? Integer::One() : Integer::Zero(); } ANONYMOUS_NAMESPACE_END NAMESPACE_BEGIN(CryptoPP) const ECP::Point& ECP::Add(const Point &P, const Point &Q) const { AdditionFunction add(*this); return (m_R = add(P, Q)); } const ECP::Point& ECP::Double(const Point &P) const { AdditionFunction a...
<vulnerable_code> import java.net.URI; import java.util.Collection; import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; /** public static Set<String> resolveValidRedirects(KeycloakSession session, String rootUrl, Set<String> validRedirects) { // If the valid redirect URI is...
<vulnerable_code><commit_title>[PATCH] Check the redirect URI is http(s) when used for a form Post<commit_description><fixed_code> /* * Copyright 2023 Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); *...
<vulnerable_code><commit_title>[PATCH] Check the redirect URI is http(s) when used for a form Post<commit_description><fixed_code> /* * Copyright 2023 Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); *...
<vulnerable_code>import org.keycloak.testsuite.AssertEvents; import org.keycloak.testsuite.pages.ErrorPage; import org.keycloak.testsuite.pages.InstalledAppRedirectPage; import org.keycloak.testsuite.util.ClientManager; import org.keycloak.testsuite.util.OAuthClient; import org.openqa.selenium.By; import javax.ws.rs.co...
<vulnerable_code>import java.io.IOException; import java.net.URI; import java.security.Signature; import java.util.List; import java.util.Objects; import java.util.logging.Level; assertThat(signature, matchesRegex("^[A-Za-z0-9+/ ]+[= ]*$")); } } }<commit_title>[PATCH] Check the redirect URI is h...
<vulnerable_code>% o exception: return any errors or warnings in this structure. % */ MagickExport void RemoveDuplicateLayers(Image **images, ExceptionInfo *exception) { register Image *curr, *next; RectangleInfo bounds; assert((*images) != (const Image *) NULL); assert((*images)->signatur...
<vulnerable_code> # arg 1: The exit code. renderer_process_terminated = pyqtSignal(TerminationStatus, int) def __init__(self, *, win_id: int, private: bool, parent: QWidget = None) -> None: self.is_private = private self._layout = miscwidgets.WrapperLayout(self) self...
<vulnerable_code> @pyqtSlot(certificateerror.CertificateErrorWrapper) def _on_ssl_errors(self, error): self._has_ssl_errors = True url = error.url() log.webview.debug("Certificate error: {}".format(error)) if error.is_overridable():<commit_title>[PATCH] Security: Remember hosts...
<vulnerable_code> if navigation.is_main_frame: self.settings.update_for_url(navigation.url) @pyqtSlot() def _on_ssl_errors(self): self._has_ssl_errors = True def _connect_signals(self): view = self._widget<commit_title>[PATCH] Security: Remember hosts with ignored cert e...
<vulnerable_code># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from unittest import mock from synapse.events import make_event_from_dict from synapse.events.snapshot import EventContext f...
<vulnerable_code> if isinstance(run_conf, dict) and any(run_conf) } if request.method == "GET" and (ui_fields_defined or show_trigger_form_if_no_params): # Populate conf textarea with conf requests parameter, or dag.params default_conf = "" <commit_title>[PATCH] Chang...
<vulnerable_code> static void snd_usb_mixer_free(struct usb_mixer_interface *mixer) { kfree(mixer->id_elems); if (mixer->urb) { kfree(mixer->urb->transfer_buffer); void snd_usb_mixer_disconnect(struct usb_mixer_interface *mixer) { usb_kill_urb(mixer->urb); usb_kill_urb(mixer->rc_urb); } #ifdef CONFIG_PM<commit_...
<vulnerable_code> return(MagickFalse); (void) QueryColorCompliance("#0000",AllCompliance, &clip_mask->background_color,exception); clip_mask->background_color.alpha=(Quantum) TransparentAlpha; (void) SetImageBackgroundColor(clip_mask,exception); if (image->debug != MagickFalse) (void) LogMagickEvent(...
<vulnerable_code> * * Author: Feike W. Dillema, feico@dillema.net. * based on newbie code by Yusuke DOI, Keio Univ. Murai Lab. ****************************************************************************/ /* static u_char *dname_redirect (u_char *, u_char *); static u_char *mesg_read_sec (G_List *, u_char *...
<vulnerable_code> errcnt++; } for (i = 0; T.iflist[i] && i < MAXINTERFACES; i++); if (i + argcnt-1 > MAXINTERFACES) { syslog (LOG_ERR, "line %d: to many interfaces, more than %d", linenum, MAXINTERFACES);<commit_title>[PATCH] Patch provided by Gabor Lencse for generating better<commit_description><fi...
<vulnerable_code>#include <inttypes.h> #include <locale.h> #include <libxml/parser.h> #include <libxml/tree.h> } } PLIST_API void plist_from_xml(const char *plist_xml, uint32_t length, plist_t * plist) { xmlDocPtr plist_doc = xmlParseMemory(plist_xml, length); xmlNodePtr root_node = xmlDocGetRootElement(...
<vulnerable_code> SPDM_ERROR_CODE_SESSION_REQUIRED, 0, response_size, response); } session_state = libspdm_secured_message_get_session_state( session_info->secured_message_context); if (session_state != LIBS...
<vulnerable_code> *messages=(char *) ResizeQuantumMemory(*messages,offset+length+1, sizeof(char *)); } (void) memcpy(*messages+offset,message,length); (*messages)[length+offset] ='\0'; return(length);<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/724<commit_description><f...
<vulnerable_code> cockpit_authorize_logger (authorize_logger, 0); } static char * base64_decode_string (const char *enc) { if (enc == NULL) return NULL; char *dec = g_strdup (enc); gsize len; g_base64_decode_inplace (dec, &len); dec[len] = '\0'; return dec; } <commit_title>[PATCH] ws: Fix bug parsing...
<vulnerable_code> if (cockpit_auth_check_cookie (test->auth, "/cockpit", headers)) g_assert_not_reached (); g_hash_table_destroy (headers); } <commit_title>[PATCH] ws: Fix bug parsing invalid base64 headers<commit_description>The len parameter to g_base64_decode_inplace() is a inout parameter, and needs to be...
<vulnerable_code> const char *sp = (char*) text.pData_+1; // current byte (space pointer) const char *eot = (char*) text.pData_+text.size_; // end of text // Look for newline while (*sp != '\n' && sp < eot ) { sp++; if ( sp == eot ) }...
<vulnerable_code><commit_title>[PATCH 1/3] Add bounds check on allocation size.<commit_description><fixed_code> # -*- coding: utf-8 -*- from system_tests import CaseMeta, path class LargeAllocationInPngChunk(metaclass=CaseMeta): """ Regression test for the bug described in: https://github.com/Exiv2/exiv2...
<vulnerable_code> } long length = (long) atol(startOfLength); enforce(length >= 0, Exiv2::kerCorruptedMetadata); enforce(length <= (eot - sp)/2, Exiv2::kerCorruptedMetadata); // Allocate space if (length == 0)<commit_title>[PATCH 1/3] Add bounds check on allocation size....
<vulnerable_code> } else { // FIXME: the buffer is probably copied twice, it should be optimized DataBuf buf(size_); uint32_t idxBuf = 0; for (int i = 0; i < sizes.count(); i++) {<commit_title>[PATCH 1/3] Add ...
<vulnerable_code><commit_title>[PATCH 1/3] Add bounds check on allocation size.<commit_description><fixed_code> # -*- coding: utf-8 -*- from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors class OutOfMemoryInLoaderTiffGetData(metaclass=CaseMeta): """ Regression test for the bug described in: ...
<vulnerable_code> register const struct in6_addr *addr; dp = (const struct ip6_rthdr *)bp; len = dp->ip6r_len; /* 'ep' points to the end of available data. */ ep = ndo->ndo_snapend; ND_TCHECK(dp->ip6r_segleft); ND_PRINT((ndo, "srcrt (len=%d", dp->ip6r_len)); /*)*/ ND_PRINT((ndo, ", type=%d", dp->ip6r_type));...
<vulnerable_code>package apoc.load; import apoc.util.FileUtils; import apoc.result.MapResult; import apoc.result.NodeResult; import apoc.util.Util; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.neo4j.procedure.*; import org.w3c.dom.CharacterData; import org.w3c.d...
<vulnerable_code>package apoc.load; import apoc.util.TestUtil; import org.apache.commons.lang.exception.ExceptionUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.QueryExecutionException; import org.neo4j.helpers.colle...
<vulnerable_code> CredentialsProvider credentialsProvider = (CredentialsProvider) context.getAttribute(HttpClientContext.CREDS_PROVIDER); HttpHost targetHost = (HttpHost) context.getAttribute(HttpCoreContext.HTTP_TARGET_HOST); Credentials credentials = credentialsProvider....
<vulnerable_code>// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // $j.ajaxSetup({timeout: AJAX_TIMEOUT}); var reportLogs = true; if ( !window.console ) { window.console =<commit_title>[PATCH] Use canEdit['System'] and value of new ZM_LOG_INJECT to<commit_description><fixed_code> // ...
<vulnerable_code> int parse_unix(grpc_uri *uri, grpc_resolved_address *resolved_addr) { struct sockaddr_un *un = (struct sockaddr_un *)resolved_addr->addr; memset(un, 0, sizeof(*un)); un->sun_family = AF_UNIX; strncpy(un->sun_path, uri->path, sizeof(un->sun_path) - 1 /* null term'd */); resolved_addr->len = ...
<vulnerable_code>import org.gradle.internal.build.RootBuildState; import org.gradle.internal.buildtree.BuildTreeState; import org.gradle.internal.classpath.ClassPath; import org.gradle.internal.instantiation.InstantiatorFactory; import org.gradle.internal.invocation.BuildController; import org.gradle.internal.logging.s...
<vulnerable_code>#define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_SUBMINOR_VERSION 1 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif #endif /* ! FLEXINT_H */ /* TODO: this is always defined, so inline it */ #define yyconst const #if defined(__GNUC__) && _...
<vulnerable_code> _properties = { Confirmation.USER_REGISTRATION: ConfirmationType("check_prereg_key_and_redirect"), Confirmation.INVITATION: ConfirmationType( "check_prereg_key_and_redirect", validity_in_days=settings.INVITATION_LINK_VALIDITY_DAYS ), Confirmation.EMAIL_CHANGE: ConfirmationType...
<vulnerable_code> with queries_captured() as queries, cache_tries_captured() as cache_tries: self.register(self.nonreg_email("test"), "test") # Ensure the number of queries we make is not O(streams) self.assert_length(queries, 89) # We can probably avoid a couple cache hits h...
<vulnerable_code>import logging import urllib from typing import Any, Dict, List, Optional from urllib.parse import urlencode from django.conf import settings @has_request_variables def check_prereg_key_and_redirect( request: HttpRequest, confirmation_key: str, full_name: Optional[str] = REQ(default=None) ) -> H...
<vulnerable_code> accounts_home, accounts_home_from_multiuse_invite, accounts_register, check_prereg_key_and_redirect, create_realm, find_account, realm_redirect, ) from zerver.views.report import ( path("accounts/register/", accounts_register, name="accounts_register"), path( ...
<vulnerable_code> sizeof(*colormap)); if ((pixels == (unsigned char *) NULL) || (colormap == (unsigned char *) NULL)) ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); /* Write colormap to file. */ q=colormap; q=colormap; if (image->colors <= 256) for (i=0; i < (ssize_t...
<vulnerable_code> } #ifdef USE_M17N if (w == 2 && WcOption.use_wide) addstr(graph2_symbol[(int)c]); else #endif addch(*graph_symbol[(int)c]); } else { #ifdef USE_M17N symbol = get_symbol(DisplayCharset, &w); addstr(symbol[(int)c]); #else symbol = get_symbol(); addch(*symbol[(int)...
<vulnerable_code> symbol = get_symbol(DisplayCharset, &w); #endif } Strcat_charp(tmp, symbol[(int)c]); #ifdef USE_M17N p += len - 1; pr += len - 1;<commit_title>[PATCH] Prevent array index out of bounds for symbol<commit_description>Bug-Debian: https://github.com/tats/w3m/issues/38<fixed_code> sy...
<vulnerable_code> #ifdef USE_M17N if (width == 2) p = alt2_symbol[(int)symbol]; else #endif p = alt_symbol[(int)symbol]; for (i = 0; i < 2 && *p; i++, p++) buf[i] = (*p == ' ') ? NBSP_CODE : *p; <commit_title>[PATCH] Prevent array index out of bounds for symbol<commit_description>Bug-Debian: https://gith...
<vulnerable_code> plist_free(node); return NULL; } /* enforce key type */ plist_get_data(key)->type = PLIST_KEY; if (!plist_get_data(key)->strval) {<commit_title>[PATCH] bplist: Disallow key nodes with non-string node types<commit_description>As reported in #86, th...
<vulnerable_code> return result; } void mono_reflection_create_dynamic_method (MonoReflectionDynamicMethod *mb) { ReflectionMethodBuilder rmb; MonoMethodSignature *sig; MonoClass *klass; GSList *l; int i; sig = dynamic_method_to_signature (mb); reflection_methodbuilder_from_dynamic_method (&rmb, mb); klass...
<vulnerable_code>mono_runtime_shutdown (void) { mono_domain_foreach (fire_process_exit_event, NULL); } <commit_title>[PATCH] Don't use finalization to cleanup dynamic methods.<commit_description>* reflection.c: Use a reference queue to cleanup dynamic methods instead of finalization. * runtime.c: Shutdown the dynam...
<vulnerable_code> (void) RelinquishUniqueFileResource(blob_info->filename); blob_info=DestroyImageInfo(blob_info); if ((picon == (Image *) NULL) || (affinity_image == (Image *) NULL)) return(MagickFalse); quantize_info=AcquireQuantizeInfo(image_info); status=RemapImage(quantize_info,picon,affinity_image); ...
<vulnerable_code>class GlyphCache::Loader { public: Loader(const Face & face, const bool dumb_font); //return result indicates success. Do not use if failed. operator bool () const throw(); unsigned short int units_per_em() const throw(); GlyphCache::GlyphCache(const Face & face, const uint32 face_opt...
<vulnerable_code> telemetry::category _misc_cat(face.tele.misc); #endif Face::Table silf(face, Tag::Silf, 0x00050000); if (silf) options &= ~gr_face_dumbRendering; else if (!(options & gr_face_dumbRendering)) return false; if (!face.readGlyphs(options)) ...
<vulnerable_code>{ FeatureMap testFeatureMap; dummyFace.replace_table(TtfUtil::Tag::Feat, &table, sizeof(T)); gr_face * face = gr_make_face_with_ops(&dummyFace, &face_handle::ops, gr_face_dumbRendering); if (!face) throw std::runtime_error("failed to load font"); bool readStatus = testFeatureMap.rea...
<vulnerable_code> } if (need_dev) { /* Get mount point or device file. */ if (kern_path(dev_name, LOOKUP_FOLLOW, &path)) { error = -ENOENT; goto out; }<commit_title>[PATCH] TOMOYO: Fix oops in tomoyo_mount_acl().<commit_description>In tomoyo_mount_acl() since 2.6.36, kern_path() was called without checking...
<vulnerable_code>}; #endif /* CONFIG_SYSCTL */ /******************************************************************** * * Random functions for networking * ********************************************************************/ /* * TCP initial sequence number picking. This uses the random number * generator to ...
<vulnerable_code><commit_title>[PATCH] net: Compute protocol sequence numbers and fragment IDs using<commit_description><fixed_code> #include <linux/kernel.h> #include <linux/init.h> #include <linux/cryptohash.h> #include <linux/module.h> #include <linux/cache.h> #include <linux/random.h> #include <linux/hrtimer.h> #in...
<vulnerable_code>#include <net/timewait_sock.h> #include <net/tcp_states.h> #include <net/xfrm.h> #include "ackvec.h" #include "ccid.h"<commit_title>[PATCH] net: Compute protocol sequence numbers and fragment IDs using<commit_description><fixed_code> #include <net/timewait_sock.h> #include <net/tcp_states.h> #include ...
<vulnerable_code>#include <net/transp_v6.h> #include <net/ip6_checksum.h> #include <net/xfrm.h> #include "dccp.h" #include "ipv6.h" dh->dccph_checksum = dccp_v6_csum_finish(skb, &np->saddr, &np->daddr); } static inline __u32 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr, __be16 sport, __be16 dpo...
<vulnerable_code> #include <net/inet_connection_sock.h> #include <net/inet_hashtables.h> #include <net/ip.h> /*<commit_title>[PATCH] net: Compute protocol sequence numbers and fragment IDs using<commit_description><fixed_code> #include <net/inet_connection_sock.h> #include <net/inet_hashtables.h> #include <net/secure...
<vulnerable_code>#include <linux/net.h> #include <net/ip.h> #include <net/inetpeer.h> /* * Theory of operations.<commit_title>[PATCH] net: Compute protocol sequence numbers and fragment IDs using<commit_description><fixed_code> #include <linux/net.h> #include <net/ip.h> #include <net/inetpeer.h> #include <net/secure...
<vulnerable_code>#include <linux/ip.h> #include <linux/netfilter.h> #include <net/netfilter/nf_nat.h> #include <net/netfilter/nf_nat_core.h> #include <net/netfilter/nf_nat_rule.h><commit_title>[PATCH] net: Compute protocol sequence numbers and fragment IDs using<commit_description><fixed_code> #include <linux/ip.h> #...
<vulnerable_code>#include <linux/sysctl.h> #endif #include <net/atmclip.h> #define RT_FL_TOS(oldflp4) \ ((u32)(oldflp4->flowi4_tos & (IPTOS_RT_MASK | RTO_ONLINK)))<commit_title>[PATCH] net: Compute protocol sequence numbers and fragment IDs using<commit_description><fixed_code> #include <linux/sysctl.h> #endif #in...
<vulnerable_code>#include <net/timewait_sock.h> #include <net/xfrm.h> #include <net/netdma.h> #include <linux/inet.h> #include <linux/ipv6.h><commit_title>[PATCH] net: Compute protocol sequence numbers and fragment IDs using<commit_description><fixed_code> #include <net/timewait_sock.h> #include <net/xfrm.h> #include ...
<vulnerable_code>#include <net/inet_connection_sock.h> #include <net/inet_hashtables.h> #include <net/inet6_hashtables.h> #include <net/ip.h> int __inet6_hash(struct sock *sk, struct inet_timewait_sock *tw)<commit_title>[PATCH] net: Compute protocol sequence numbers and fragment IDs using<commit_description><fixed_cod...
<vulnerable_code>#include <net/timewait_sock.h> #include <net/netdma.h> #include <net/inet_common.h> #include <asm/uaccess.h> <commit_title>[PATCH] net: Compute protocol sequence numbers and fragment IDs using<commit_description><fixed_code> #include <net/timewait_sock.h> #include <net/netdma.h> #include <net/inet_com...
<vulnerable_code> config = (jnpr_ether_config_t *)ctx->encoder->config; tcpedit_dlt_cleanup(config->subctx); safe_free(config->subctx); safe_free(plugin->config); plugin->config = NULL; plugin->config_size = 0;<commit_title>[PATCH] Bug #702 fix double free in Juniper DLT<...
<vulnerable_code> err = rpmsg_ctrldev_register_device(rpdev_ctrl); if (err) { kfree(vch); return ERR_PTR(err); } <commit_title>[PATCH] rpmsg: virtio: Fix possible double free in<commit_description><fixed_code> err = rpmsg_ctrldev_register_device(rpdev_ctrl); if (err) { /* vch will be free in virtio_rpmsg_re...
<vulnerable_code> } else { if (reg->dmax != ONIG_INFINITE_DISTANCE) { *low = p - reg->dmax; if (*low > s) { *low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s, *low, (const UChar** )low_prev); if (low_prev && IS_NULL...
<vulnerable_code> new_object.id = object_id; new_object.length = object_length; if (object_data) { new_object.data = malloc(object_length + add_v1_record); if (new_object.data == NULL) {<commit_title>[PATCH] coolkey: Make sure the object ID is unique when filling list<commit_description>Thanks to oss-fuzz https...
<vulnerable_code>import java.net.URL; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.olat.core.logging.OLATRuntimeException; import org.olat.core.util.WebappHelper; import org.olat.test.OlatTestCase; import org.springframework.beans.factory.annotation.Autowired; import org.wildfly.c...
<vulnerable_code> hasLeafs = pageTreeRoot->IsLeafParent(); if(pageTreeRoot->GetNodesCount() == 0) break; else pageTreeRoot = pageTreeRoot->GetPageTreeChild(0); } return hasLeafs;<commit_title>[PATCH] Fix segfault when using return value of GetPageTreeChild<commit_...
<vulnerable_code> spos = a->start.pos; epos = a->end.pos; } pos = form_update_line(l, &p, spos, epos, COLPOS(l, epos) - col, rows > 1, form->type == FORM_INPUT_PASSWORD);<commit_title>[PATCH] Prevent segfault for formUpdateBuffer<commit_description>Bug-Debian: https://github.com/tats/w3m/issu...
<vulnerable_code> if (status == MagickFalse) { quantum_info=DestroyQuantumInfo(quantum_info); return(DestroyImageList(image)); } SetImageColorspace(image,YCbCrColorspace,exception);<commit_title>[PATCH] fix memory leak in ReadYCBCRImage as SetImageExtent failure<commit_description><fixed_code...
<vulnerable_code> *r = -1; if (irq->shorthand == APIC_DEST_SELF) { *r = kvm_apic_set_irq(src->vcpu, irq, dest_map); return true; }<commit_title>[PATCH] KVM: x86: Avoid theoretical NULL pointer dereference in<commit_description><fixed_code> *r = -1; if (irq->shorthand == APIC_DEST_SELF) { if (KVM_BUG_ON(!src...
<vulnerable_code>from __future__ import absolute_import import datetime import logging import os # (ie test_recent_date is failing) update it to ~6 months before the current date. RECENT_DATE = datetime.date(2019, 1, 1) class DummyConnection(object): """Used to detect a failed ConnectionCls import.""" con...
<vulnerable_code> with pytest.raises(MaxRetryError): pool.request("GET", "/test", retries=2) def test_percent_encode_invalid_target_chars(self): with HTTPConnectionPool(self.host, self.port) as pool: r = pool.request("GET", "/echo_params?q=\r&k=\n \n")<commit_title>[P...
<vulnerable_code> or list of paths can be provided, e.g., ``fromxml('example.html', './/tr', ('th', 'td'))``. """ source = read_source_from_arg(source) else: assert False, 'bad parameters' self.missing = kwargs.get('missing', None) def __iter__(self): vmatch = s...
<vulnerable_code>validate_commit_metadata (GVariant *commit_data, const char *ref, const char *required_metadata, gboolean require_xa_metadata, GError **error) { g_autoptr(GVariant) commit_metadata = NULL; ...
<vulnerable_code> return FALSE; if (external_metadata) op->external_metadata = g_bytes_new (external_metadata, strlen (external_metadata) + 1); return TRUE; } return NULL; } return g_bytes_new_take (g_steal_pointer (&metadata_contents), metadata_contents_length + 1); } static void if (xa_me...
<vulnerable_code> GCancellable *cancellable, GError **error) { g_autofree char *metadata_contents = NULL; g_autofree char *to_checksum = NULL; g_autoptr(GFile) root = NULL; if (metadata == NULL) return FALSE; if (!ostree_repo_get_remote_option (repo...
<vulnerable_code> /* ...but clean it before doing the actual write */ vcpu->arch.time_offset = data & ~(PAGE_MASK | 1); vcpu->arch.time_page = gfn_to_page(vcpu->kvm, data >> PAGE_SHIFT); <commit_title>[PATCH] KVM: x86: fix for buffer overflow in handling of<commit_description><fixed_code> /* ...but clean it...
<vulnerable_code> if (setOptimizer) { em.createNativeQuery("ALTER SESSION SET optimizer_mode = FIRST_ROWS").executeUpdate(); } Sort sort = Sort.of(); if (colToSort != null) { sort = sort.copyOfWithAdditional(Sort.Order.of(sortingDirection, colToSort, lowerSortCol))...
<vulnerable_code>package ch.puzzle.itc.mobiliar.business.domain.commons; import com.google.common.collect.ImmutableList; import java.io.Serializable; import java.util.Iterator; import java.util.List; import java.util.Objects; import static com.google.common.base.Strings.isNullOrEmpty; public final class Sort implem...
<vulnerable_code> boolean lowerSortCol = ShakedownTestFilterTypes.APPSERVER_NAME.getFilterTabColumnName().equals(colToSort); Sort sort = Sort.of(); if (colToSort != null) { sort = sort.copyOfWithAdditional(Sort.Order.of(sortingDirection, colToSort, lowerSortCol)); } sort = sort.copyOfWithAdditional(Sort...
<vulnerable_code> String uniqueCol ="d.id"; // when Query query = service.addFilterAndCreateQuery(stringQuery, filters, Sort.of(Sort.Order.asc(colToSort), Sort.Order.desc(uniqueCol)), false, false); // then assertThat(query.getParameters().size(), is(1)); String uniqueCo...
<vulnerable_code> self.config.verbose = True def add_pending(self, f): # Ignore symlinks if os.path.islink(f): return # Get the file mode to check and see if it's a block/char device # If recursion was specified, and the file is not the same ...
<vulnerable_code>static int fstypes_count; static sa_fstype_t *fstypes; sa_fstype_t * register_fstype(const char *name, const sa_share_ops_t *ops) {<commit_title>[PATCH] Move nfs.c:foreach_nfs_shareopt() to<commit_description><fixed_code> static int fstypes_count; static sa_fstype_t *fstypes; /* * Invokes the specif...
<vulnerable_code> */ static int nfs_exportfs_temp_fd = -1; typedef int (*nfs_shareopt_callback_t)(const char *opt, const char *value, void *cookie); typedef int (*nfs_host_callback_t)(const char *sharepath, const char *host, const char *security, const char *access, void *cookie); /* * Invokes the specified...
<vulnerable_code> """ def neither_403_nor_404(mirror_error): if isinstance(mirror_error, six.moves.urllib.error.HTTPError): if mirror_error.code in {403, 404}: return False elif isinstance(mirror_error, requests.exceptions.HTTPError): if mirror_error.response.status_code in...
<vulnerable_code>package com.vaadin.flow.templatemodel; import java.util.Arrays; import java.util.Collections; import java.util.Date; import java.util.Map; import java.util.stream.Collectors; void setAge(int age); } @Test public void onlyDenyProperty_noAllowedProperties() { ModelDescripto...
<vulnerable_code> // [databind#2688]: apache/drill s.add("oadd.org.apache.xalan.lib.sql.JNDIConnectionPool"); DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s); } <commit_title>[PATCH] Fix #2698<commit_description><fixed_code> // [databind#2688]: apache/drill s.ad...
<vulnerable_code> int defaultRead) throws SQLException, AuthorizeException { Group role = groupService.create(context); groupService.setName(role, "COLLECTION_" + collection.getID().toString() + "_" + typeOfGroupString + "_DEFAULT_READ"); ...
<vulnerable_code> Group createDefaultReadGroup(Context context, Collection collection, String typeOfGroupString, int defaultRead) throws SQLException, AuthorizeException; /** * Returns Collections for which the current user has 'submit' privileges. * NOTE: for better performance, this method r...
<vulnerable_code>import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.UUID; groups.add(group); List<ResourcePolicy> policies = resourcePolicyService.find(context, null, groups, ...
<vulnerable_code>{ if(s->avctx->hwaccel && s->avctx->hwaccel->decode_slice || !s->cur_pic.f || s->cur_pic.field_picture || s->avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO ) return 0;...
<vulnerable_code> static enum AVPixelFormat h263_get_format(AVCodecContext *avctx) { /* MPEG-4 Studio Profile only, not supported by hardware */ if (avctx->bits_per_raw_sample > 8) { av_assert1(avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO); return avctx->pix_fmt; } av_assert1(s->bi...
<vulnerable_code> s->avctx->has_b_frames = !s->low_delay; if (s->studio_profile) { av_assert0(s->avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO); if (!s->avctx->bits_per_raw_sample) { av_log(s->avctx, AV_LOG_ERROR, "Missing VOL header\n"); return AVERROR_INVALIDDATA;<co...
<vulnerable_code> Assert.fail("Server should have disabled the checkbox again."); } Assert.assertEquals("Value 'foo' should have been re-selected", "[bar, foo]", infoLabel.getText()); Assert.assertTrue( "Value 'foo' should have been re-selected on the...
<vulnerable_code>import com.vaadin.flow.data.selection.MultiSelect; import com.vaadin.flow.data.selection.MultiSelectionEvent; import com.vaadin.flow.data.selection.MultiSelectionListener; import com.vaadin.flow.function.SerializableConsumer; import com.vaadin.flow.function.SerializablePredicate; import com.vaadin.flow...
<vulnerable_code> ['@semantic-release/git', { assets: [changelogFile, 'package.json', 'package-lock.json', 'npm-shrinkwrap.json'], }], [ "@saithodev/semantic-release-backmerge", { "branches": [ { from: "beta", to: "alpha" }, { from: "release", t...
<vulnerable_code> raise Exception("Windows doesn't support double dotted directories") file_path = Path(static_file_directory) / "dotted.." / "dot.txt" Path.mkdir(file_path.parent, exist_ok=True) with open(file_path, "w") as f: f.write("DOT\n") yield file_path def get_file_path(static_...