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

Memory management bug in cupsRemoveOption #2264

Closed
michaelrsweet opened this Issue Feb 26, 2007 · 2 comments

Comments

Projects
None yet
1 participant
@michaelrsweet
Copy link
Collaborator

michaelrsweet commented Feb 26, 2007

Version: 1.2.8
CUPS.org User: twaugh.redhat

When shifting the remaining options over the top of the removed option, we're not moving enough data. As a result, all sorts of crazy stuff can happen.

Patch attached.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Feb 27, 2007

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Feb 27, 2007

"cups-options.patch":

--- cups-1.2.8/cups/options.c.options 2006-02-22 22:43:17.000000000 +0000
+++ cups-1.2.8/cups/options.c 2007-02-26 18:34:52.000000000 +0000
@@ -622,7 +622,7 @@
free(option->value);

 if (i > 0)
  •  memmove(option, option + 1, i \* sizeof(cups_option_t *));
    
  •  memmove(option, option + 1, i * sizeof(cups_option_t));
    

    }

    /*

@michaelrsweet michaelrsweet added this to the Stable milestone Mar 17, 2016

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