#156 Patch fixing some memory leaks in libtspi

Bug
closed-fixed
Kent Yoder
7
2012-08-16
2012-07-10
Anonymous
No

Hi,
I found and fixed some memory leaks which are occurring when calling the Tspi_TPM_Quote() and Tspi_TPM_Quote2() functions.
Attached are the patches relative to the trousers-0.3.9 tarball. Looking at the source code I suspect that there are some more leaks of a similar kind around.

Best regards

Andreas

======================================================================
Andreas Steffen andreas.steffen@strongswan.org
strongSwan - the Linux VPN Solution! www.strongswan.org
Institute for Internet Technologies and Applications
University of Applied Sciences Rapperswil
CH-8640 Rapperswil (Switzerland)
===========================================================[ITA-HSR]==

Discussion


  • Anonymous
    2012-07-10

    Patch fixing some memory leaks in libtspi

     
    Last edit: Anonymous 2013-11-26

  • Anonymous
    2012-07-10

    • priority: 5 --> 7
     
  • Kent Yoder
    Kent Yoder
    2012-08-13

    Hi Andreas, thanks for the patch!

    In hunk 3 of this patch, when unloading pcrComp using Trspi_UnloadBlob_PCR_COMPOSITE, if Trspi_UnloadBlob_PCR_SELECTION fails, we'll try to free pcrComp.select.pcrSelect, which hasn't been initialized yet. If you can add a memset to 0 of pcrComp at the top, that would fix this issue.

    Also to include this patch I need a Signed-off-by line at the top from you, which shows you agree to to the trousers DCO: http://trousers.sourceforge.net/dco.text

    Thanks,
    Kent

     
  • Kent Yoder
    Kent Yoder
    2012-08-13

    • assigned_to: phreakz --> kyoder
     

  • Anonymous
    2012-08-16

    Updated and signed-off patch fixing some memory leaks in libtspi

     

  • Anonymous
    2012-08-16

    Hi Kent,

    I added the memset to 0 of pcrComp and signed-off and uploaded the updated patch.

    Regards

    Andreas

     
  • Kent Yoder
    Kent Yoder
    2012-08-16

    Thanks Andreas, applied!

     
  • Kent Yoder
    Kent Yoder
    2012-08-16

    • status: open --> closed-fixed