Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPD parser: Calling cupsFileGetChar(...) after EOF #5473

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
PPD parser: Calling cupsFileGetChar(...) after EOF
For some input data the function cupsFileGetChar(...) was incorrectly called
from the function ppd_read(...) after returning EOF in a previous call. This
causes incorrect state of cups_file and results in memory leak.
  • Loading branch information
Piotr Pawliczek committed Jan 8, 2019
commit f8e7cbee972323dca87912e89c6ce523ff5e2541
4 changes: 2 additions & 2 deletions cups/ppd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3038,7 +3038,7 @@ ppd_read(cups_file_t *fp, /* I - File to read from */
}
}

if (endquote)
if (endquote && ch != EOF)
{
/*
* Didn't finish this quoted string...
Expand Down Expand Up @@ -3093,7 +3093,7 @@ ppd_read(cups_file_t *fp, /* I - File to read from */
}
}

if (ch != '\n')
if (ch != '\n' && ch != EOF)
{
/*
* Didn't finish this line...
Expand Down