VirtualBox

Ignore:
Timestamp:
Nov 11, 2010 11:10:10 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
67635
Message:

vfs: the gunzip stream works, except for some double frees somewhere.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/zip/zipgzip.cpp

    r33945 r33973  
    3030*******************************************************************************/
    3131#include "internal/iprt.h"
    32 #include <iprt/vfslowlevel.h>
     32#include <iprt/zip.h>
    3333
    3434#include <iprt/assert.h>
     
    3737#include <iprt/poll.h>
    3838#include <iprt/string.h>
     39#include <iprt/vfslowlevel.h>
     40
    3941#include <zlib.h>
    4042
     
    477479    AssertPtrReturn(phVfsIosOut, VERR_INVALID_POINTER);
    478480
     481    uint32_t cRefs = RTVfsIoStrmRetain(hVfsIosIn);
     482    AssertReturn(cRefs != UINT32_MAX, VERR_INVALID_HANDLE);
     483
    479484    /*
    480485     * Create the decompression I/O stream.
     
    507512             */
    508513            size_t cbRead = 0;
    509             rc = RTVfsIoStrmRead(pThis->hVfsIos, pThis->abBuffer, sizeof(RTZIPGZIPHDR), NULL /*pcbRead*/);
     514            rc = RTVfsIoStrmRead(pThis->hVfsIos, pThis->abBuffer, sizeof(RTZIPGZIPHDR), true /*fBlocking*/, NULL /*pcbRead*/);
    510515            if (RT_SUCCESS(rc))
    511516            {
     
    539544        }
    540545        else
    541             rc = rtZipGzipConvertErrFromZlib(pThis, rc);
     546            rc = rtZipGzipConvertErrFromZlib(pThis, rc); /** @todo cleaning up in this situation is going to go wrong. */
     547        RTVfsIoStrmRelease(hVfsIos);
    542548    }
     549    else
     550        RTVfsIoStrmRelease(hVfsIosIn);
    543551    return rc;
    544552}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette