Skip to content

Commit

Permalink
chromium-uaf.yml: simple timer checker
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed Jul 17, 2023
1 parent e74b832 commit 61961af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions assets/semgrep_rules/c/chromium-uaf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ rules:
- pattern-not-inside: receiver_.set_disconnect_with_reason_handler(...)
- pattern-not-inside: remote_.set_disconnect_handler(...)
- pattern-not-inside: remote_.set_disconnect_with_reason_handler(...)
- pattern-not-inside: timer_.Start(...)

metadata:
author: Andrea Brancaleoni <abc@pompel.me>
Expand Down
5 changes: 5 additions & 0 deletions t3sts/semgrep_rules/uaf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,9 @@ v8::Local<v8::Promise> uaf(v8::Isolate* isolate) {
// ok: chromium-unretained-uaf
remote_.set_disconnect_with_reason_handler(
base::BindOnce(&LoggerImpl::OnError, base::Unretained(this)));

// ok: chromium-unretained-uaf
timer_.Start(FROM_HERE, base::Seconds(1),
base::BindRepeating(base::Unretained(this), 42));

}

0 comments on commit 61961af

Please sign in to comment.