fix-get-args-segment-violation.patch 726 B

12345678910111213141516171819202122232425
  1. Description: Fix segmentation faults due to non correct checking for args
  2. Author: David Suárez <david.sephirot@gmail.com>
  3. Origin: vendor
  4. Bug: https://sourceforge.net/p/giflib/bugs/153/
  5. Bug-Debian: https://bugs.debian.org/715963
  6. Bug-Debian: https://bugs.debian.org/715964
  7. Bug-Debian: https://bugs.debian.org/715967
  8. Last-Update: 2020-12-20
  9. --- a/getarg.c
  10. +++ b/getarg.c
  11. @@ -305,6 +305,12 @@
  12. int i = 0, ScanRes;
  13. while (!(ISSPACE(CtrlStrCopy[i]))) {
  14. +
  15. + if ((*argv) == argv_end) {
  16. + GAErrorToken = Option;
  17. + return CMD_ERR_NumRead;
  18. + }
  19. +
  20. switch (CtrlStrCopy[i + 1]) {
  21. case 'd': /* Get signed integers. */
  22. ScanRes = sscanf(*((*argv)++), "%d",