CVE-2014-0027_unsafe_temporary_file.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Description: Only write audio data to a file in debug builds
  2. This isn't useful in regular builds and is actually a security
  3. concern.
  4. From: Rui Matos <tiagomatos@gmail.com>
  5. Date: Mon, 6 Jan 2014 13:45:00 +0000
  6. Bug-Debian: http://bugs.debian.org/734746
  7. Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=1048678
  8. Source: https://bugzilla.redhat.com/attachment.cgi?id=846118
  9. ---
  10. src/audio/auserver.c | 6 ++++++
  11. 1 file changed, 6 insertions(+)
  12. --- a/src/audio/auserver.c
  13. +++ b/src/audio/auserver.c
  14. @@ -62,9 +62,11 @@
  15. int q,i,n,r;
  16. unsigned char bytes[CST_AUDIOBUFFSIZE];
  17. short shorts[CST_AUDIOBUFFSIZE];
  18. +#ifdef DEBUG
  19. cst_file fff;
  20. fff = cst_fopen("/tmp/awb.wav",CST_OPEN_WRITE|CST_OPEN_BINARY);
  21. +#endif
  22. if ((audio_device = audio_open(header->sample_rate,1,
  23. (header->encoding == CST_SND_SHORT) ?
  24. @@ -111,7 +113,9 @@
  25. for (q=r; q > 0; q-=n)
  26. {
  27. n = audio_write(audio_device,shorts,q);
  28. +#ifdef DEBUG
  29. cst_fwrite(fff,shorts,2,q);
  30. +#endif
  31. if (n <= 0)
  32. {
  33. audio_close(audio_device);
  34. @@ -120,7 +124,9 @@
  35. }
  36. }
  37. audio_close(audio_device);
  38. +#ifdef DEBUG
  39. cst_fclose(fff);
  40. +#endif
  41. return CST_OK_FORMAT;