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

Fixes 1654: Fixed win32print.DeviceCapabilities() returning strings with junk in them. #1660

Merged
merged 1 commit into from Feb 1, 2021

Commits on Feb 1, 2021

  1. Fixed win32print.DeviceCapabilities() returning strings with junk in …

    …them.
    
    Previously this code would ZeroMemory() the output buffer before passing it to DeviceCapabilities(),
    and then assume that only characters in each string would be changed, i.e. the characters following
    the null-terminator would remain null.
    So it would only check if the last character in each string was null, to check if the string was null-terminated.
    
    This assumption is wrong - sometimes DeviceCapabilities() sets the characters after null to junk.
    
    Now every character in the returned buffer is checked for being null before falling back to the case where the
    string takes up all available space.
    
    mhammond#1654
    LincolnPuzey committed Feb 1, 2021
    Configuration menu
    Copy the full SHA
    e858c8a View commit details
    Browse the repository at this point in the history