libquicktime-1.2.4-CVE-2016-2399.patch 801 B

1234567891011121314151617181920212223242526
  1. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855099
  2. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-2399
  3. diff --git a/src/util.c b/src/util.c
  4. index d8dc3c3..9422fc5 100644
  5. --- a/src/util.c
  6. +++ b/src/util.c
  7. @@ -340,9 +340,14 @@ int64_t quicktime_byte_position(quicktime_t *file)
  8. void quicktime_read_pascal(quicktime_t *file, char *data)
  9. {
  10. - char len = quicktime_read_char(file);
  11. - quicktime_read_data(file, (uint8_t*)data, len);
  12. - data[(int)len] = 0;
  13. + int len = quicktime_read_char(file);
  14. + if ((len > 0) && (len < 256)) {
  15. + /* data[] is expected to be 256 bytes long */
  16. + quicktime_read_data(file, (uint8_t*)data, len);
  17. + data[len] = 0;
  18. + } else {
  19. + data[0] = 0;
  20. + }
  21. }
  22. void quicktime_write_pascal(quicktime_t *file, char *data)