11_CVE-2018-13440.patch 1.0 KB

1234567891011121314151617181920212223242526272829
  1. From fde6d79fb8363c4a329a184ef0b107156602b225 Mon Sep 17 00:00:00 2001
  2. From: Wim Taymans <wtaymans@redhat.com>
  3. Date: Thu, 27 Sep 2018 10:48:45 +0200
  4. Subject: [PATCH] ModuleState: handle compress/decompress init failure
  5. When the unit initcompress or initdecompress function fails,
  6. m_fileModule is NULL. Return AF_FAIL in that case instead of
  7. causing NULL pointer dereferences later.
  8. Fixes #49
  9. ---
  10. libaudiofile/modules/ModuleState.cpp | 3 +++
  11. 1 file changed, 3 insertions(+)
  12. diff --git a/libaudiofile/modules/ModuleState.cpp b/libaudiofile/modules/ModuleState.cpp
  13. index 0c29d7a..070fd9b 100644
  14. --- a/libaudiofile/modules/ModuleState.cpp
  15. +++ b/libaudiofile/modules/ModuleState.cpp
  16. @@ -75,6 +75,9 @@ status ModuleState::initFileModule(AFfilehandle file, Track *track)
  17. m_fileModule = unit->initcompress(track, file->m_fh, file->m_seekok,
  18. file->m_fileFormat == AF_FILE_RAWDATA, &chunkFrames);
  19. + if (!m_fileModule)
  20. + return AF_FAIL;
  21. +
  22. if (unit->needsRebuffer)
  23. {
  24. assert(unit->nativeSampleFormat == AF_SAMPFMT_TWOSCOMP);