jasper-1.900.1-fix-filename-buffer-overflow.patch 841 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. Description: Filename buffer overflow fix
  2. This patch fixes a security hole by a bad buffer size handling.
  3. Author: Roland Stigge <stigge@antcom.de>
  4. Bug-Debian: http://bugs.debian.org/645118
  5. --- a/src/libjasper/include/jasper/jas_stream.h
  6. +++ b/src/libjasper/include/jasper/jas_stream.h
  7. @@ -77,6 +77,7 @@
  8. #include <jasper/jas_config.h>
  9. #include <stdio.h>
  10. +#include <limits.h>
  11. #if defined(JAS_HAVE_FCNTL_H)
  12. #include <fcntl.h>
  13. #endif
  14. @@ -99,6 +100,12 @@ extern "C" {
  15. #define O_BINARY 0
  16. #endif
  17. +#ifdef PATH_MAX
  18. +#define JAS_PATH_MAX PATH_MAX
  19. +#else
  20. +#define JAS_PATH_MAX 4096
  21. +#endif
  22. +
  23. /*
  24. * Stream open flags.
  25. */
  26. @@ -251,7 +258,7 @@ typedef struct {
  27. typedef struct {
  28. int fd;
  29. int flags;
  30. - char pathname[L_tmpnam + 1];
  31. + char pathname[JAS_PATH_MAX + 1];
  32. } jas_stream_fileobj_t;
  33. #define JAS_STREAM_FILEOBJ_DELONCLOSE 0x01