Skip to content

Conversation

@JacobBarthelmeh
Copy link
Contributor

ZD20993

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds input validation for the Windows terminal resize operation to prevent buffer overflow issues. The changes include increasing the buffer size and adding a sanity check on the snprintf return value before writing to the pseudo console.

  • Increased buffer size from 20 to 26 bytes to accommodate the VT control sequence
  • Added validation to check snprintf return value before calling WriteFile
  • Restructured error handling to prevent writing potentially truncated data

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

char cmd[20];
int cmdSz = 20;
char cmd[30]; /* 2 int values (11 chars max) plus \x1b[8 ; t */
int cmdSz = 30;
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

Inconsistent spacing: there are two spaces after the equals sign in "int cmdSz = 30;" while line 1099 uses a single space. Consider using consistent spacing for better code readability.

Suggested change
int cmdSz = 30;
int cmdSz = 30;

Copilot uses AI. Check for mistakes.
char cmd[20];
int cmdSz = 20;
char cmd[30]; /* 2 int values (11 chars max) plus \x1b[8 ; t */
int cmdSz = 30;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd only suggest changing this to int cmdSz = (int)sizeof(cmd); Matches with the check later.

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