code
stringlengths
23
2.05k
label_name
stringlengths
6
7
label
int64
0
37
public void translate(MapInfoRequestPacket packet, GeyserSession session) { long mapId = packet.getUniqueMapId(); ClientboundMapItemDataPacket mapPacket = session.getStoredMaps().remove(mapId); if (mapPacket != null) { // Delay the packet 100ms to prevent the client from ignorin...
CWE-287
4
public AuthorizationCodeTokenRequest newTokenRequest(String authorizationCode) { return new AuthorizationCodeTokenRequest(transport, jsonFactory, new GenericUrl(tokenServerEncodedUrl), authorizationCode).setClientAuthentication( clientAuthentication).setRequestInitializer(requestInitializer).setSc...
CWE-863
11
public void translate(BlockPickRequestPacket packet, GeyserSession session) { Vector3i vector = packet.getBlockPosition(); int blockToPick = session.getConnector().getWorldManager().getBlockAt(session, vector.getX(), vector.getY(), vector.getZ()); // Block is air - chunk caching...
CWE-287
4
public void translate(ServerStopSoundPacket packet, GeyserSession session) { // Runs if all sounds are stopped if (packet.getSound() == null) { StopSoundPacket stopPacket = new StopSoundPacket(); stopPacket.setStoppingAllSound(true); stopPacket.setSoundName(""); ...
CWE-287
4
public void testAADLengthComputation() { Assert.assertArrayEquals(AAD_LENGTH, com.nimbusds.jose.crypto.AAD.computeLength(AAD)); }
CWE-345
22
public void existingDocumentNonTerminalFromUIDeprecatedCheckEscaping() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); ...
CWE-862
8
public String getEncryptedValue() { try { Cipher cipher = KEY.encrypt(); // add the magic suffix which works like a check sum. return new String(Base64.encode(cipher.doFinal((value+MAGIC).getBytes("UTF-8")))); } catch (GeneralSecurityException e) { thr...
CWE-326
9
private void initAndSaveDocument(XWikiContext context, XWikiDocument newDocument, String title, String template, String parent) throws XWikiException { XWiki xwiki = context.getWiki(); // Set the locale and default locale, considering that we're creating the original version of the docu...
CWE-862
8
public String accessToken(String username) { Algorithm algorithm = Algorithm.HMAC256(SECRET); return JWT.create() .withExpiresAt(new Date(new Date().getTime() + ACCESS_EXPIRE_TIME)) .withIssuer(ISSUER) .withClaim("username", username) ...
CWE-20
0
public void translate(ServerSetActionBarTextPacket packet, GeyserSession session) { String text; if (packet.getText() == null) { //TODO 1.17 can this happen? text = " "; } else { text = MessageTranslator.convertMessage(packet.getText(), session.getLocale()); }...
CWE-287
4
public void testGetAndRemove() { final HttpHeadersBase headers = newEmptyHeaders(); headers.add("name1", "value1"); headers.add("name2", "value2", "value3"); headers.add("name3", "value4", "value5", "value6"); assertThat(headers.getAndRemove("name1", "defaultvalue")).isEqual...
CWE-74
1
public void newDocumentWebHomeButTerminalFromURL() throws Exception { // new document = xwiki:X.Y.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X", "Y"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when(document.ge...
CWE-862
8
public void translate(FilterTextPacket packet, GeyserSession session) { if (session.getOpenInventory() instanceof CartographyContainer) { // We don't want to be able to rename in the cartography table return; } packet.setFromServer(true); session.sendUpstreamP...
CWE-287
4
private <P extends T> void translate0(GeyserSession session, PacketTranslator<P> translator, P packet) { if (session.isClosed()) { return; } try { translator.translate(packet, session); } catch (Throwable ex) { GeyserConnector.getInstance().getLog...
CWE-287
4
public void notExistingDocumentFromUIButSpaceTooLong() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when(docu...
CWE-862
8
private CallbackHandler getCallbackHandler( @UnderInitialization(WrappedFactory.class) LibPQFactory this, Properties info) throws PSQLException { // Determine the callback handler CallbackHandler cbh; String sslpasswordcallback = PGProperty.SSL_PASSWORD_CALLBACK.get(info); if (sslpasswordc...
CWE-665
32
public void translate(ContainerClosePacket packet, GeyserSession session) { byte windowId = packet.getId(); //Client wants close confirmation session.sendUpstreamPacket(packet); session.setClosingInventory(false); if (windowId == -1 && session.getOpenInventory() instanceof ...
CWE-287
4
public static boolean isPermitted( final Optional<AuthenticationService> authenticationService, final Optional<User> optionalUser, final JsonRpcMethod jsonRpcMethod) { AtomicBoolean foundMatchingPermission = new AtomicBoolean(); if (authenticationService.isPresent()) { if (optionalUs...
CWE-400
2
public void shouldNotGetModificationsFromOtherBranches() throws Exception { makeACommitToSecondBranch(); hg(workingDirectory, "pull").runOrBomb(null); List<Modification> actual = hgCommand.modificationsSince(new StringRevision(REVISION_0)); assertThat(actual.size(), is(2)); ...
CWE-77
14
public void translate(ServerScoreboardObjectivePacket packet, GeyserSession session) { WorldCache worldCache = session.getWorldCache(); Scoreboard scoreboard = worldCache.getScoreboard(); Objective objective = scoreboard.getObjective(packet.getName()); int pps = worldCache.increaseAn...
CWE-287
4
public void translate(ServerKeepAlivePacket packet, GeyserSession session) { if (!session.getConnector().getConfig().isForwardPlayerPing()) { return; } NetworkStackLatencyPacket latencyPacket = new NetworkStackLatencyPacket(); latencyPacket.setFromServer(true); la...
CWE-287
4
public void translate(CommandBlockUpdatePacket packet, GeyserSession session) { String command = packet.getCommand(); boolean outputTracked = packet.isOutputTracked(); if (packet.isBlock()) { CommandBlockMode mode; switch (packet.getMode()) { case CHAI...
CWE-287
4
public String resolveDriverClassName(DriverClassNameResolveRequest request) { return driverResources.resolveSqlDriverNameFromJar(request.getJdbcDriverFileUrl()); }
CWE-20
0
public void newDocumentWebHomeTopLevelFromURL() throws Exception { // new document = xwiki:X.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when(document.getDocumentR...
CWE-862
8
public void addShouldIncreaseAndRemoveShouldDecreaseTheSize() { final HttpHeadersBase headers = newEmptyHeaders(); assertThat(headers.size()).isEqualTo(0); headers.add("name1", "value1", "value2"); assertThat(headers.size()).isEqualTo(2); headers.add("name2", "value3", "value...
CWE-74
1
public User updateUser(JpaUser user) throws NotFoundException, UnauthorizedException { if (!UserDirectoryUtils.isCurrentUserAuthorizedHandleRoles(securityService, user.getRoles())) throw new UnauthorizedException("The user is not allowed to set the admin role on other users"); JpaUser updateUser = User...
CWE-327
3
public void translate(AdventureSettingsPacket packet, GeyserSession session) { boolean isFlying = packet.getSettings().contains(AdventureSetting.FLYING); if (!isFlying && session.getGameMode() == GameMode.SPECTATOR) { // We should always be flying in spectator mode session.se...
CWE-287
4
public static synchronized InitialContext getInitialContext(final Hints hints) throws NamingException { return getInitialContext(); }
CWE-20
0
public void subValidateFail(ViolationCollector col) { col.addViolation(FAILED+"subclass"); }
CWE-74
1
public static void init(final InitialContext applicationContext) { synchronized (GeoTools.class) { context = applicationContext; } fireConfigurationChanged(); }
CWE-20
0
public void multipleValuesPerNameShouldBeAllowed() { final HttpHeadersBase headers = newEmptyHeaders(); headers.add("name", "value1"); headers.add("name", "value2"); headers.add("name", "value3"); assertThat(headers.size()).isEqualTo(3); final List<String> values = h...
CWE-74
1
public void addViolation(String propertyName, String message) { violationOccurred = true; String messageTemplate = escapeEl(message); context.buildConstraintViolationWithTemplate(messageTemplate) .addPropertyNode(propertyName) .addConstraintViolation(); }
CWE-74
1
public void testContains() { final HttpHeadersBase headers = newEmptyHeaders(); headers.addLong("long", Long.MAX_VALUE); assertThat(headers.containsLong("long", Long.MAX_VALUE)).isTrue(); assertThat(headers.containsLong("long", Long.MIN_VALUE)).isFalse(); headers.addInt("in...
CWE-74
1
public void translate(ServerSetSlotPacket packet, GeyserSession session) { if (packet.getWindowId() == 255) { //cursor GeyserItemStack newItem = GeyserItemStack.from(packet.getItem()); session.getPlayerInventory().setCursor(newItem, session); InventoryUtils.updateCursor(s...
CWE-287
4
public void getWithDefaultValueWorks() { final HttpHeadersBase headers = newEmptyHeaders(); headers.add("name1", "value1"); assertThat(headers.get("name1", "defaultvalue")).isEqualTo("value1"); assertThat(headers.get("noname", "defaultvalue")).isEqualTo("defaultvalue"); }
CWE-74
1
public void newDocumentButNonTerminalFromURL() throws Exception { // new document = xwiki:X.Y DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X"), "Y"); XWikiDocument document = mock(XWikiDocument.class); when(document.getDocumentReference()).t...
CWE-862
8
public void checkConnection(UrlArgument repoUrl) { final String ref = fullUpstreamRef(); final CommandLine commandLine = git().withArgs("ls-remote").withArg(repoUrl).withArg(ref); final ConsoleResult result = commandLine.runOrBomb(new NamedProcessTag(repoUrl.forDisplay())); if (!has...
CWE-77
14
public void existingDocumentFromUITemplateSpecified() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when(docum...
CWE-862
8
public void translate(MoveEntityAbsolutePacket packet, GeyserSession session) { session.setLastVehicleMoveTimestamp(System.currentTimeMillis()); float y = packet.getPosition().getY(); if (session.getRidingVehicleEntity() instanceof BoatEntity) { // Remove the offset to prevents ...
CWE-287
4
public void iteratorSetShouldFail() { final HttpHeadersBase headers = newEmptyHeaders(); headers.add("name1", "value1", "value2", "value3"); headers.add("name2", "value4"); assertThat(headers.size()).isEqualTo(4); assertThatThrownBy(() -> headers.iterator().next().setValue("...
CWE-74
1
public void translate(AnimatePacket packet, GeyserSession session) { // Stop the player sending animations before they have fully spawned into the server if (!session.isSpawned()) { return; } switch (packet.getAction()) { case SWING_ARM: // De...
CWE-287
4
private DefaultHttpClient makeHttpClient() { DefaultHttpClient defaultHttpClient = new DefaultHttpClient(); try { logger.debug("Installing forgiving hostname verifier and trust managers"); X509TrustManager trustManager = createTrustManager(); X509HostnameVerifier hostNameVerifier = createHo...
CWE-346
16
public static CharSequence createOptimized(String value) { return io.netty.handler.codec.http.HttpHeaders.newEntity(value); }
CWE-20
0
public void cleanup() { }
CWE-362
18
private static AsciiString normalizeName(CharSequence name) { checkArgument(requireNonNull(name, "name").length() > 0, "name is empty."); return HttpHeaderNames.of(name); }
CWE-74
1
public Map<String, FileEntry> generatorCode(TableDetails tableDetails, String tablePrefix, Map<String, String> customProperties, List<TemplateFile> templateFiles) { Map<String, FileEntry> map = new HashMap<>(templateFiles.size()); // 模板渲染 Map<String, Object> context = GenUtils.getContext(tableDetails, table...
CWE-20
0
final void addObject(CharSequence name, Object... values) { final AsciiString normalizedName = normalizeName(name); requireNonNull(values, "values"); for (Object v : values) { requireNonNullElement(values, v); addObject(normalizedName, v); } }
CWE-74
1
/*package*/ static Secret tryDecrypt(Cipher cipher, byte[] in) throws UnsupportedEncodingException { try { String plainText = new String(cipher.doFinal(in), "UTF-8"); if(plainText.endsWith(MAGIC)) return new Secret(plainText.substring(0,plainText.length()-MAGIC.length...
CWE-326
9
public void correctExample() throws Exception { assertThat(ConstraintViolations.format(validator.validate(new CorrectExample()))) .isEmpty(); assertThat(TestLoggerFactory.getAllLoggingEvents()) .isEmpty(); }
CWE-74
1
public void translate(ShowCreditsPacket packet, GeyserSession session) { if (packet.getStatus() == ShowCreditsPacket.Status.END_CREDITS) { ClientRequestPacket javaRespawnPacket = new ClientRequestPacket(ClientRequest.RESPAWN); session.sendDownstreamPacket(javaRespawnPacket); ...
CWE-287
4
int bmp_validate(jas_stream_t *in) { int n; int i; uchar buf[2]; assert(JAS_STREAM_MAXPUTBACK >= 2); /* Read the first two characters that constitute the signature. */ if ((n = jas_stream_read(in, (char *) buf, 2)) < 0) { return -1; } /* Put the characters read back onto the stream. */ for (i = n - 1; i >=...
CWE-20
0
void HeaderMapImpl::insertByKey(HeaderString&& key, HeaderString&& value) { EntryCb cb = ConstSingleton<StaticLookupTable>::get().find(key.getStringView()); if (cb) { key.clear(); StaticLookupResponse ref_lookup_response = cb(*this); if (*ref_lookup_response.entry_ == nullptr) { maybeCreateInline(...
CWE-400
2
void UTFstring::UpdateFromUTF8() { delete [] _Data; // find the size of the final UCS-2 string size_t i; for (_Length=0, i=0; i<UTF8string.length(); _Length++) { uint8 lead = static_cast<uint8>(UTF8string[i]); if (lead < 0x80) i++; else if ((lead >> 5) == 0x6) i += 2; else if ((lead ...
CWE-200
10
void RemoteFsDevice::load() { if (RemoteFsDevice::constSambaAvahiProtocol==details.url.scheme()) { // Start Avahi listener... Avahi::self(); QUrlQuery q(details.url); if (q.hasQueryItem(constServiceNameQuery)) { details.serviceName=q.queryItemValue(constServiceNameQuery);...
CWE-20
0
ECDSA_PrivateKey::create_signature_op(RandomNumberGenerator& /*rng*/, const std::string& params, const std::string& provider) const { #if defined(BOTAN_HAS_BEARSSL) if(provider == "bearssl" || provider.empty()) { try ...
CWE-200
10
RemoteDevicePropertiesWidget::RemoteDevicePropertiesWidget(QWidget *parent) : QWidget(parent) , modified(false) , saveable(false) { setupUi(this); if (qobject_cast<QTabWidget *>(parent)) { verticalLayout->setMargin(4); } type->addItem(tr("Samba Share"), (int)Type_Samba); type->ad...
CWE-20
0
int CephxSessionHandler::_calc_signature(Message *m, uint64_t *psig) { const ceph_msg_header& header = m->get_header(); const ceph_msg_footer& footer = m->get_footer(); // optimized signature calculation // - avoid temporary allocated buffers from encode_encrypt[_enc_bl] // - skip the leading 4 byte wrapper ...
CWE-287
4
error_t coapServerInitResponse(CoapServerContext *context) { CoapMessageHeader *requestHeader; CoapMessageHeader *responseHeader; //Point to the CoAP request header requestHeader = (CoapMessageHeader *) context->request.buffer; //Point to the CoAP response header responseHeader = (CoapMessageHeader *...
CWE-20
0
void RemoteFsDevice::serviceRemoved(const QString &name) { if (name==details.serviceName && constSambaAvahiProtocol==details.url.scheme()) { sub=tr("Not Available"); updateStatus(); } }
CWE-20
0
static void HeaderMapImplGetByteSize(benchmark::State& state) { HeaderMapImpl headers; addDummyHeaders(headers, state.range(0)); uint64_t size = 0; for (auto _ : state) { size += headers.byteSize(); } benchmark::DoNotOptimize(size); }
CWE-400
2
v8::Local<v8::Object> CreateNativeEvent( v8::Isolate* isolate, v8::Local<v8::Object> sender, content::RenderFrameHost* frame, electron::mojom::ElectronBrowser::MessageSyncCallback callback) { v8::Local<v8::Object> event; if (frame && callback) { gin::Handle<Event> native_event = Event::Create(is...
CWE-668
7
void CarbonProtocolReader::skip(const FieldType ft) { switch (ft) { case FieldType::True: case FieldType::False: { break; } case FieldType::Int8: { readRaw<int8_t>(); break; } case FieldType::Int16: { readRaw<int16_t>(); break; } case FieldType::Int32: { ...
CWE-674
28
void jas_matrix_clip(jas_matrix_t *matrix, jas_seqent_t minval, jas_seqent_t maxval) { int i; int j; jas_seqent_t v; jas_seqent_t *rowstart; jas_seqent_t *data; int rowstep; if (jas_matrix_numrows(matrix) > 0 && jas_matrix_numcols(matrix) > 0) { assert(matrix->rows_); rowstep = jas_matrix_rowstep(matrix);...
CWE-20
0
TEST_F(RouterTest, MissingRequiredHeaders) { NiceMock<Http::MockRequestEncoder> encoder; Http::ResponseDecoder* response_decoder = nullptr; expectNewStreamWithImmediateEncoder(encoder, &response_decoder, Http::Protocol::Http10); expectResponseTimerCreate(); Http::TestRequestHeaderMapImpl headers; HttpTestU...
CWE-670
36
void jas_matrix_asl(jas_matrix_t *matrix, int n) { int i; int j; jas_seqent_t *rowstart; int rowstep; jas_seqent_t *data; if (jas_matrix_numrows(matrix) > 0 && jas_matrix_numcols(matrix) > 0) { assert(matrix->rows_); rowstep = jas_matrix_rowstep(matrix); for (i = matrix->numrows_, rowstart = matrix->rows_[...
CWE-20
0
static void setAppend(SetType& set, const VariantType& v) { auto value_type = type(v); if (value_type != HPHP::serialize::Type::INT64 && value_type != HPHP::serialize::Type::STRING) { throw HPHP::serialize::UnserializeError( "Unsupported keyset element of type " + folly::to<s...
CWE-674
28
void RemoteFsDevice::serviceAdded(const QString &name) { if (name==details.serviceName && constSambaAvahiProtocol==details.url.scheme()) { sub=tr("Available"); updateStatus(); } }
CWE-20
0
inline typename V::SetType FBUnserializer<V>::unserializeSet() { p_ += CODE_SIZE; // the set size is written so we can reserve it in the set // in future. Skip past it for now. unserializeInt64(); typename V::SetType ret = V::createSet(); size_t code = nextCode(); while (code != FB_SERIALIZE_STOP) { ...
CWE-674
28
R_API RBinJavaAnnotation *r_bin_java_annotation_new(ut8 *buffer, ut64 sz, ut64 buf_offset) { ut32 i = 0; RBinJavaAnnotation *annotation = NULL; RBinJavaElementValuePair *evps = NULL; ut64 offset = 0; annotation = R_NEW0 (RBinJavaAnnotation); if (!annotation) { return NULL; } // (ut16) read and set annotation_...
CWE-119
26
void Phase2() final { Local<Context> context_handle = Deref(context); Context::Scope context_scope{context_handle}; Local<Object> object = Local<Object>::Cast(Deref(reference)); result = Unmaybe(object->Delete(context_handle, key->CopyInto())); }
CWE-913
24
boost::int64_t lazy_entry::int_value() const { TORRENT_ASSERT(m_type == int_t); boost::int64_t val = 0; bool negative = false; if (*m_data.start == '-') negative = true; parse_int(negative?m_data.start+1:m_data.start, m_data.start + m_size, 'e', val); if (negative) val = -val; return val; }
CWE-119
26
void RemoteDevicePropertiesWidget::setType() { if (Type_SshFs==type->itemData(type->currentIndex()).toInt() && 0==sshPort->value()) { sshPort->setValue(22); } if (Type_Samba==type->itemData(type->currentIndex()).toInt() && 0==smbPort->value()) { smbPort->setValue(445); } }
CWE-20
0
set<int> PipeSocketHandler::listen(const SocketEndpoint& endpoint) { lock_guard<std::recursive_mutex> guard(globalMutex); string pipePath = endpoint.name(); if (pipeServerSockets.find(pipePath) != pipeServerSockets.end()) { throw runtime_error("Tried to listen twice on the same path"); } sockaddr_un loc...
CWE-362
18
int ConnectionImpl::saveHeader(const nghttp2_frame* frame, HeaderString&& name, HeaderString&& value) { StreamImpl* stream = getStream(frame->hd.stream_id); if (!stream) { // We have seen 1 or 2 crashes where we get a headers callback but there is no associated // stream data....
CWE-400
2
CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE { size_t origin = parameters.size() > 1 ? 1 : 0; if (parameters[origin].empty()) { user->WriteNumeric(ERR_NOORIGIN, "No origin specified"); return CMD_FAILURE; } ClientProtocol::Messages::Pong pong(parameters[0], origin ?...
CWE-732
13
static int emulate_store_desc_ptr(struct x86_emulate_ctxt *ctxt, void (*get)(struct x86_emulate_ctxt *ctxt, struct desc_ptr *ptr)) { struct desc_ptr desc_ptr; if (ctxt->mode == X86EMUL_MODE_PROT64) ctxt->op_bytes = 8; get(ctxt, &desc_ptr); if (ctxt->op_bytes == 2) { ctxt->op_bytes = 4; desc_...
CWE-200
10
R_API ut64 r_bin_java_element_pair_calc_size(RBinJavaElementValuePair *evp) { ut64 sz = 0; if (evp == NULL) { return sz; } // evp->element_name_idx = r_bin_java_read_short(bin, bin->b->cur); sz += 2; // evp->value = r_bin_java_element_value_new (bin, offset+2); if (evp->value) { sz += r_bin_java_element_valu...
CWE-119
26
cosine_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer *buf, int *err, gchar **err_info) { int pkt_len; char line[COSINE_LINE_LENGTH]; if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) return FALSE; if (file_gets(line, COSINE_LINE_LENGTH, wth->random_fh) == NULL) { *err = f...
CWE-119
26
int my_redel(const char *org_name, const char *tmp_name, time_t backup_time_stamp, myf MyFlags) { int error=1; DBUG_ENTER("my_redel"); DBUG_PRINT("my",("org_name: '%s' tmp_name: '%s' MyFlags: %d", org_name,tmp_name,MyFlags)); if (my_copystat(org_name,tmp_name,MyFlags) < 0) goto end; if...
CWE-362
18
static port::StatusOr<CudnnRnnSequenceTensorDescriptor> Create( GpuExecutor* parent, int max_seq_length, int batch_size, int data_size, const absl::Span<const int>& seq_lengths, bool time_major, cudnnDataType_t data_type) { CHECK_GT(max_seq_length, 0); int dims[] = {batch_size, data_size, 1}...
CWE-20
0
static int em_jmp_far(struct x86_emulate_ctxt *ctxt) { int rc; unsigned short sel, old_sel; struct desc_struct old_desc, new_desc; const struct x86_emulate_ops *ops = ctxt->ops; u8 cpl = ctxt->ops->cpl(ctxt); /* Assignment of RIP may only fail in 64-bit mode */ if (ctxt->mode == X86EMUL_MODE_PROT64) ops->get_...
CWE-200
10
RemoteFsDevice::RemoteFsDevice(MusicLibraryModel *m, const DeviceOptions &options, const Details &d) : FsDevice(m, d.name, createUdi(d.name)) , mountToken(0) , currentMountStatus(false) , details(d) , proc(0) , mounterIface(0) , messageSent(false) { opts=options; // details.path=Utils...
CWE-20
0
auto Phase3() -> Local<Value> final { return Boolean::New(Isolate::GetCurrent(), did_set); }
CWE-913
24
void Init(void) { for(int i = 0;i < 19;i++) { #ifdef DEBUG_QMCODER char string[5] = "X0 "; string[1] = (i / 10) + '0'; string[2] = (i % 10) + '0'; X[i].Init(string); string[0] = 'M'; M[i].Init(string); #else X[i].Init(); ...
CWE-119
26
R_API RBinJavaAttrInfo *r_bin_java_synthetic_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) { ut64 offset = 0; RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset); if (!attr) { return NULL; } offset += 6; attr->type = R_BIN_JAVA_ATTR_TYPE_SYNTHETIC_ATTR; attr->...
CWE-119
26
IntegrationStreamDecoderPtr HttpIntegrationTest::sendRequestAndWaitForResponse( const Http::TestHeaderMapImpl& request_headers, uint32_t request_body_size, const Http::TestHeaderMapImpl& response_headers, uint32_t response_size, int upstream_index) { ASSERT(codec_client_ != nullptr); // Send the request to ...
CWE-400
2
ECDSA_Signature_Operation::raw_sign(const uint8_t msg[], size_t msg_len, RandomNumberGenerator& rng) { BigInt m(msg, msg_len, m_group.get_order_bits()); #if defined(BOTAN_HAS_RFC6979_GENERATOR) const BigInt k = generate_rfc6979_nonce(m_x, m_group.get_order(), m, m_rfc6979_h...
CWE-200
10
R_API RBinJavaAttrInfo *r_bin_java_annotation_default_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) { ut64 offset = 0; RBinJavaAttrInfo *attr = NULL; attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset); offset += 6; if (attr && sz >= offset) { attr->type = R_BIN_JAVA_ATTR_TYPE_AN...
CWE-119
26
parse_cosine_hex_dump(FILE_T fh, struct wtap_pkthdr *phdr, int pkt_len, Buffer* buf, int *err, gchar **err_info) { guint8 *pd; gchar line[COSINE_LINE_LENGTH]; int i, hex_lines, n, caplen = 0; /* Make sure we have enough room for the packet */ ws_buffer_assure_space(buf, COSINE_MAX_PACKET_LEN); pd = ws_buffer...
CWE-119
26
void* TFE_HandleToDLPack(TFE_TensorHandle* h, TF_Status* status) { const Tensor* tensor = GetTensorFromHandle(h, status); TF_DataType data_type = static_cast<TF_DataType>(tensor->dtype()); TensorReference tensor_ref(*tensor); // This will call buf_->Ref() auto* tf_dlm_tensor_ctx = new TfDlManagedTensorCtx(ten...
CWE-20
0
mptctl_eventenable (unsigned long arg) { struct mpt_ioctl_eventenable __user *uarg = (void __user *) arg; struct mpt_ioctl_eventenable karg; MPT_ADAPTER *ioc; int iocnum; if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) { printk(KERN_ERR MYNAM "%s@%d::mptctl_eventenable - " "Unable to ...
CWE-362
18
compat_mpt_command(struct file *filp, unsigned int cmd, unsigned long arg) { struct mpt_ioctl_command32 karg32; struct mpt_ioctl_command32 __user *uarg = (struct mpt_ioctl_command32 __user *) arg; struct mpt_ioctl_command karg; MPT_ADAPTER *iocp = NULL; int iocnum, iocnumX; int nonblock = (filp->f_flags & O_NO...
CWE-362
18
std::shared_ptr<SQLiteDBInstance> getTestDBC() { auto dbc = SQLiteDBManager::getUnique(); char* err = nullptr; std::vector<std::string> queries = { "CREATE TABLE test_table (username varchar(30) primary key, age int)", "INSERT INTO test_table VALUES (\"mike\", 23)", "INSERT INTO test_table VALUE...
CWE-77
14
void RemoteFsDevice::unmount() { if (details.isLocalFile()) { return; } if (!isConnected() || proc) { return; } if (messageSent) { return; } if (constSambaProtocol==details.url.scheme() || constSambaAvahiProtocol==details.url.scheme()) { mounter()->umount(mo...
CWE-20
0
void HeaderMapImpl::appendToHeader(HeaderString& header, absl::string_view data) { if (data.empty()) { return; } if (!header.empty()) { header.append(",", 1); } header.append(data.data(), data.size()); }
CWE-400
2
QPDFObjectHandle::parse(PointerHolder<InputSource> input, std::string const& object_description, QPDFTokenizer& tokenizer, bool& empty, StringDecrypter* decrypter, QPDF* context) { return parseInternal(input, object_description, tokenizer, empt...
CWE-20
0
MpdCantataMounterInterface * RemoteFsDevice::mounter() { if (!mounterIface) { if (!QDBusConnection::systemBus().interface()->isServiceRegistered(MpdCantataMounterInterface::staticInterfaceName())) { QDBusConnection::systemBus().interface()->startService(MpdCantataMounterInterface::staticInterfac...
CWE-20
0
std::string get_wml_location(const std::string &filename, const std::string &current_dir) { DBG_FS << "Looking for '" << filename << "'." << std::endl; assert(game_config::path.empty() == false); std::string result; if (filename.empty()) { LOG_FS << " invalid filename" << std::endl; return result; } if (...
CWE-200
10
MpdCantataMounterInterface * RemoteFsDevice::mounter() { if (!mounterIface) { if (!QDBusConnection::systemBus().interface()->isServiceRegistered(MpdCantataMounterInterface::staticInterfaceName())) { QDBusConnection::systemBus().interface()->startService(MpdCantataMounterInterface::staticInterfac...
CWE-20
0
int jas_seq2d_output(jas_matrix_t *matrix, FILE *out) { #define MAXLINELEN 80 int i; int j; jas_seqent_t x; char buf[MAXLINELEN + 1]; char sbuf[MAXLINELEN + 1]; int n; fprintf(out, "%"PRIiFAST32" %"PRIiFAST32"\n", jas_seq2d_xstart(matrix), jas_seq2d_ystart(matrix)); fprintf(out, "%"PRIiFAST32" %"PRIiFAST32"...
CWE-20
0