Skip to content

Commit 3f4bdf1

Browse files
committed
Merge branch 'master' into ref/metrics-mri
* master: fix: Apply clippy 1.60 lints (#1220) build: Update symbolic to 8.7.0 (#1216)
2 parents bc1468f + 9ad1c1d commit 3f4bdf1

File tree

7 files changed

+32
-40
lines changed

7 files changed

+32
-40
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
**Bug Fixes**:
6+
7+
- Prevent potential OOM panics when handling corrupt Unreal Engine crashes. ([#1216](https://github.com/getsentry/relay/pull/1216))
8+
59
**Internal**:
610

711
- Remove unused item types. ([#1211](https://github.com/getsentry/relay/pull/1211))

Cargo.lock

Lines changed: 14 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

relay-general/src/store/normalize/request.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ fn normalize_url(request: &mut Request) {
7676
};
7777
}
7878

79+
#[allow(clippy::ptr_arg)] // normalize_method must be &mut String for `apply`.
7980
fn normalize_method(method: &mut String, meta: &mut Meta) -> ProcessingResult {
8081
method.make_ascii_uppercase();
8182

@@ -86,6 +87,7 @@ fn normalize_method(method: &mut String, meta: &mut Meta) -> ProcessingResult {
8687

8788
Ok(())
8889
}
90+
8991
/// Decodes an urlencoded body.
9092
fn urlencoded_from_str(raw: &str) -> Option<Value> {
9193
// Binary strings would be decoded, but we know url-encoded bodies are ASCII.

relay-general/src/store/schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ where
8585
}
8686

8787
fn verify_value_characters(
88-
value: &mut String,
88+
value: &mut str,
8989
meta: &mut Meta,
9090
state: &ProcessingState<'_>,
9191
) -> ProcessingResult {

relay-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ serde = { version = "1.0.114", features = ["derive"] }
6666
serde_json = "1.0.55"
6767
serde_urlencoded = "0.7.0"
6868
smallvec = { version = "1.4.0", features = ["serde"] }
69-
symbolic = { version = "8.5.0", optional = true, default-features=false, features=["unreal-serde"] }
69+
symbolic = { version = "8.7.0", optional = true, default-features=false, features=["unreal-serde"] }
7070
take_mut = "0.2.2"
7171
tokio = { version = "1.0", features = ["rt-multi-thread"] } # in sync with reqwest
7272
tokio-timer = "0.2.13"

relay-server/src/utils/rate_limits.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ where
365365
let mut enforcement = Enforcement::default();
366366

367367
if let Some(category) = summary.event_category {
368-
let event_limits = (&mut self.check)(scoping.item(category), 1)?;
368+
let event_limits = (self.check)(scoping.item(category), 1)?;
369369
let longest = event_limits.longest();
370370
enforcement.event = CategoryLimit::new(category, 1, longest);
371371

@@ -381,7 +381,7 @@ where
381381

382382
if !enforcement.event.is_active() && summary.attachment_quantity > 0 {
383383
let item_scoping = scoping.item(DataCategory::Attachment);
384-
let attachment_limits = (&mut self.check)(item_scoping, summary.attachment_quantity)?;
384+
let attachment_limits = (self.check)(item_scoping, summary.attachment_quantity)?;
385385
enforcement.attachments = CategoryLimit::new(
386386
DataCategory::Attachment,
387387
summary.attachment_quantity,
@@ -398,7 +398,7 @@ where
398398

399399
if summary.session_quantity > 0 {
400400
let item_scoping = scoping.item(DataCategory::Session);
401-
let session_limits = (&mut self.check)(item_scoping, summary.session_quantity)?;
401+
let session_limits = (self.check)(item_scoping, summary.session_quantity)?;
402402
enforcement.sessions = CategoryLimit::new(
403403
DataCategory::Session,
404404
summary.session_quantity,

relay-server/src/utils/unreal.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
use relay_config::Config;
1+
use chrono::{TimeZone, Utc};
22
use symbolic::unreal::{
33
Unreal4Context, Unreal4Crash, Unreal4Error, Unreal4ErrorKind, Unreal4FileType, Unreal4LogEntry,
44
};
55

6+
use relay_config::Config;
67
use relay_general::protocol::{
78
AsPair, Breadcrumb, ClientSdkInfo, Context, Contexts, DeviceContext, Event, EventId,
89
GpuContext, LenientString, LogEntry, Message, OsContext, TagEntry, Tags, Timestamp, User,
@@ -133,8 +134,12 @@ fn merge_unreal_logs(event: &mut Event, data: &[u8]) -> Result<(), Unreal4Error>
133134
.get_or_insert_with(Array::default);
134135

135136
for log in logs {
137+
let timestamp = log
138+
.timestamp
139+
.map(|ts| Timestamp(Utc.timestamp(ts.unix_timestamp(), ts.nanosecond())));
140+
136141
breadcrumbs.push(Annotated::new(Breadcrumb {
137-
timestamp: Annotated::from(log.timestamp.map(Timestamp)),
142+
timestamp: Annotated::from(timestamp),
138143
category: Annotated::from(log.component),
139144
message: Annotated::new(log.message),
140145
..Breadcrumb::default()

0 commit comments

Comments
 (0)