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

rastertopwg: doesn't check result of cupsRasterReadPixels #4597

Closed
michaelrsweet opened this issue Mar 1, 2015 · 2 comments
Closed

rastertopwg: doesn't check result of cupsRasterReadPixels #4597

michaelrsweet opened this issue Mar 1, 2015 · 2 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 2.0-current
CUPS.org User: pdewacht

The rastertopwg filter doesn't check the result of cupsRasterReadPixels. As a result, if the filter receives truncated input, it will output a junk page.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"str4597.patch":

Index: filter/rastertopwg.c

--- filter/rastertopwg.c (revision 12597)
+++ filter/rastertopwg.c (working copy)
@@ -418,7 +418,14 @@

 for (y = inheader.cupsHeight; y > 0; y --)
 {
  •  cupsRasterReadPixels(inras, line + lineoffset, inheader.cupsBytesPerLine);
    
  •  if (cupsRasterReadPixels(inras, line + lineoffset, inheader.cupsBytesPerLine) != inheader.cupsBytesPerLine)
    
  •  {
    
  • _cupsLangPrintFilter(stderr, "ERROR", _("Error reading raster data."));
  • fprintf(stderr, "DEBUG: Unable to read line %d for page %d.\n",
  •       inheader.cupsHeight - y + page_top + 1, page);
    
  • return (1);
  •  }
    
    • if (!cupsRasterWritePixels(outras, line, outheader.cupsBytesPerLine))
      {
      _cupsLangPrintFilter(stderr, "ERROR", _("Error sending raster data."));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant