Potential Use after Free in PrivacyGuard_jni.cpp

Aperta
#1,334 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
android, cpp
Ambito
mobile-dev

Direzione di ricerca

Inizia in third_party/oneds_sdk/public/lib/jni/PrivacyGuard_jni.cpp alle righe 64-72 e 117-125, quindi esamina JStringToStdString e InitializationConfiguration. Riproduci la build segnalata trattando gli avvisi come errori e verifica che le sei diagnostiche di dangling-assignment siano scomparse, senza lasciare campi di configurazione che puntino a dati di stringa distrutti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug help wanted

Looks like use after free for whatever the char* is pointing to in the InitializationConfiguration

2025-03-09T03:08:06.0300303Z ../../third_party/oneds_sdk/public/lib/jni/PrivacyGuard_jni.cpp:64:40: error: object backing the pointer config.NotificationEventName will be destroyed at the end of the full-expression [-Werror,-Wdangling-assignment-gsl]
2025-03-09T03:08:06.0300589Z 64 | config.NotificationEventName = JStringToStdString(env, NotificationEventName).c_str();
2025-03-09T03:08:06.0300768Z | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-03-09T03:08:06.0301025Z ../../third_party/oneds_sdk/public/lib/jni/PrivacyGuard_jni.cpp:68:55: error: object backing the pointer config.SemanticContextNotificationEventName will be destroyed at the end of the full-expression [-Werror,-Wdangling-assignment-gsl]
2025-03-09T03:08:06.0301322Z 68 | config.SemanticContextNotificationEventName = JStringToStdString(env, SemanticContextEventName).c_str();
2025-03-09T03:08:06.0301514Z | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-03-09T03:08:06.0301761Z ../../third_party/oneds_sdk/public/lib/jni/PrivacyGuard_jni.cpp:72:35: error: object backing the pointer config.SummaryEventName will be destroyed at the end of the full-expression [-Werror,-Wdangling-assignment-gsl]
2025-03-09T03:08:06.0302026Z 72 | config.SummaryEventName = JStringToStdString(env, SummaryEventName).c_str();
2025-03-09T03:08:06.0302187Z | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-03-09T03:08:06.0302414Z ../../third_party/oneds_sdk/public/lib/jni/PrivacyGuard_jni.cpp:117:40: error: object backing the pointer config.NotificationEventName will be destroyed at the end of the full-expression [-Werror,-Wdangling-assignment-gsl]
2025-03-09T03:08:06.0302663Z 117 | config.NotificationEventName = JStringToStdString(env, NotificationEventName).c_str();
2025-03-09T03:08:06.0302824Z | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-03-09T03:08:06.0303057Z ../../third_party/oneds_sdk/public/lib/jni/PrivacyGuard_jni.cpp:121:55: error: object backing the pointer config.SemanticContextNotificationEventName will be destroyed at the end of the full-expression [-Werror,-Wdangling-assignment-gsl]
2025-03-09T03:08:06.0303328Z 121 | config.SemanticContextNotificationEventName = JStringToStdString(env, SemanticContextEventName).c_str();
2025-03-09T03:08:06.0303567Z | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-03-09T03:08:06.0304070Z ../../third_party/oneds_sdk/public/lib/jni/PrivacyGuard_jni.cpp:125:35: error: object backing the pointer config.SummaryEventName will be destroyed at the end of the full-expression [-Werror,-Wdangling-assignment-gsl]
2025-03-09T03:08:06.0304558Z 125 | config.SummaryEventName = JStringToStdString(env, SummaryEventName).c_str();
2025-03-09T03:08:06.0304829Z | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-03-09T03:08:06.0304958Z 6 errors generated.

Lingua principale
C
Stelle
102
Fork
66
Merge medio
3g 10h
PR unite (30g)
10

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/cpp_client_telemetry

Tutte le issue di microsoft/cpp_client_telemetry

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.