Skip to content

[Cobalt] Add URL sanitization for URLs provided by the platform. - #12470

Open
jshorta wants to merge 1 commit into
youtube:mainfrom
jshorta:fix-macro-536946433
Open

[Cobalt] Add URL sanitization for URLs provided by the platform.#12470
jshorta wants to merge 1 commit into
youtube:mainfrom
jshorta:fix-macro-536946433

Conversation

@jshorta

@jshorta jshorta commented Sep 4, 2026

Copy link
Copy Markdown

Use deep link resolution for URLs that don't start with the YTLR prefix.

Bug: 503024637

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


cobalt: Sanitize platform provided startup URLs

In release builds, enforce that the startup URL starts with the
predefined default URL. If a non-compliant URL is provided by the
platform, treat it as a deep link and reset the startup URL to the
default. This ensures that the application always boots into a
consistent, verified state while still supporting deep links.

Bug: 503024637

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enforces that the startup URL points strictly to YouTube TV in release builds, rerouting invalid URLs to a deep link and sanitizing the arguments. The review feedback correctly identifies a critical lifetime issue where 'initial_deep_link' could become a dangling pointer by referencing a temporary local string, and suggests using a reference to 'init_argv.back()' instead. It also recommends adding a defensive check to ensure 'args' is not empty before accessing 'args.back()'.

Comment thread cobalt/app/app_event_runner.cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants