Skip to content

RDP/settings: avoid divide-by-zero when optimal client resolution is unavailable#681

Open
chrilep wants to merge 1 commit into
apache:mainfrom
chrilep:fix/rdp-optimal-resolution-sigfpe
Open

RDP/settings: avoid divide-by-zero when optimal client resolution is unavailable#681
chrilep wants to merge 1 commit into
apache:mainfrom
chrilep:fix/rdp-optimal-resolution-sigfpe

Conversation

@chrilep

@chrilep chrilep commented Jun 18, 2026

Copy link
Copy Markdown

Summary

This PR prevents a divide-by-zero in guac_rdp_parse_args() when client handshake data does not provide a valid optimal_resolution.

Problem

settings->width and settings->height were derived using:

  • ... / user->info.optimal_resolution

If optimal_resolution is 0, this can trigger SIGFPE.

Change

  • Guard width/height derivation with if (user->info.optimal_resolution > 0)
  • Fall back to defaults (RDP_DEFAULT_WIDTH, RDP_DEFAULT_HEIGHT) otherwise

Behavior

  • Existing behavior remains unchanged for valid optimal_resolution
  • Invalid/absent resolution metadata now degrades safely to defaults instead of crashing

Scope

Focused bugfix only; no protocol or feature changes.

AI Assistance Disclosure

Parts of this contribution (analysis and code drafting) were created with assistance from GitHub Copilot (GPT-5.3-Codex) and then reviewed/refined before submission.

@necouchman

Copy link
Copy Markdown
Contributor

@chrilep As with #680, you will need a Jira issue and to update PR title and commit messages with that Jira issue.

@clhedrick

Copy link
Copy Markdown

I understand why the project wants things like a contributor agreement, but the other patch is critical our use of Guacamole.I haven't seen this one yet.

Are you just going to ignore these issues?

We're considering recreating the patches and going through the submission process, but that raises questions about possible copyright violations of the originals.

@necouchman

necouchman commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@clhedrick We do not require contributor agreements in order to accept pull requests. All that's required is:

  • Sign up for a Jira account.
  • Create a Jira issue.
  • Tag the pull request and commit messages with the Jira ticket number.
  • Go through the review process to address concerns from the project committers prior to merging the changes.

As far as "ignoring these issues" - I wouldn't say we're ignoring them, but we do require that those who submit the pull requests be willing to work through the above process in order to accept the changes. Occasionally we will take an in-progress pull request, pull in the commits from the request, and finish out the changes. However, that's less common than trying to get people who are interested in the changes to participate in and contribute to the project.

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.

3 participants