> This patch fixes a couple certain NULL ptr dereferences. You might want to
> look it over to make sure the fix really is the correct one for the project.
> There also appears to be some missing "break" statements in a large 
> switch/case
> construct.

  This all looks good, thanks!

Kent

> Signed-off-by: Steve Grubb <sgrubb@redhat,com>
>
>
>
> diff -urp trousers-0.3.9.orig/src/tspi/obj_encdata.c 
> trousers-0.3.9/src/tspi/obj_encdata.c
> --- trousers-0.3.9.orig/src/tspi/obj_encdata.c  2012-05-30 11:10:51.000000000 
> -0400
> +++ trousers-0.3.9/src/tspi/obj_encdata.c       2012-06-22 11:14:50.483664145 
> -0400
> @@ -302,6 +302,11 @@ obj_encdata_get_pcr_selection(TSS_HENCDA
>                         goto done;
>         }
>
> +       if (selection == NULL) {
> +               result = TSPERR(TSS_E_INVALID_OBJ_ACCESS);
> +               goto done;
> +       }
> +
>         *size = sizeof(UINT16) + selection->sizeOfSelect;
>
>         if ((*data = calloc_tspi(obj->tspContext, *size)) == NULL) {
> diff -urp trousers-0.3.9.orig/src/tspi/tsp_caps.c 
> trousers-0.3.9/src/tspi/tsp_caps.c
> --- trousers-0.3.9.orig/src/tspi/tsp_caps.c     2011-05-04 10:33:11.000000000 
> -0400
> +++ trousers-0.3.9/src/tspi/tsp_caps.c  2012-06-22 11:29:08.091685191 -0400
> @@ -139,6 +139,7 @@ internal_GetCap(TSS_HCONTEXT tspContext,
>                 default:
>                         return TSPERR(TSS_E_BAD_PARAMETER);
>                 }
> +               break;
>         case TSS_TSPCAP_MANUFACTURER:
>                 switch (subCap) {
>                 case TSS_TSPCAP_PROP_MANUFACTURER_ID:
> @@ -168,6 +169,7 @@ internal_GetCap(TSS_HCONTEXT tspContext,
>                 default:
>                         return TSPERR(TSS_E_BAD_PARAMETER);
>                 }
> +               break;
>         default:
>                 return TSPERR(TSS_E_BAD_PARAMETER);
>         }
> diff -urp trousers-0.3.9.orig/src/tspi/tspi_dir.c 
> trousers-0.3.9/src/tspi/tspi_dir.c
> --- trousers-0.3.9.orig/src/tspi/tspi_dir.c     2011-05-04 10:33:11.000000000 
> -0400
> +++ trousers-0.3.9/src/tspi/tspi_dir.c  2012-06-22 11:20:42.288672786 -0400
> @@ -36,7 +36,7 @@ Tspi_TPM_DirWrite(TSS_HTPM hTPM,              /* in
>         TCPA_DIRVALUE dirValue = { { 0 } };
>         Trspi_HashCtx hashCtx;
>
> -       if (rgbDirData == NULL && ulDirDataLength != 0)
> +       if (rgbDirData == NULL || ulDirDataLength == 0)
>                 return TSPERR(TSS_E_BAD_PARAMETER);
>
>         if (ulDirDataLength > (UINT32)sizeof(TCPA_DIRVALUE))
> diff -urp trousers-0.3.9.orig/src/tspi/tspi_quote2.c 
> trousers-0.3.9/src/tspi/tspi_quote2.c
> --- trousers-0.3.9.orig/src/tspi/tspi_quote2.c  2011-05-04 10:33:11.000000000 
> -0400
> +++ trousers-0.3.9/src/tspi/tspi_quote2.c       2012-06-22 11:26:54.473681916 
> -0400
> @@ -263,7 +263,7 @@ Tspi_TPM_Quote2(TSS_HTPM        hTPM,
>
>
>         if(*versionInfoSize > 0) {
> -               if(fAddVersion) {
> +               if(fAddVersion && pValidationData) {
>                         /* tag versionInfo so that it can be free'd by the 
> app through Tspi_Context_FreeMemory */
>                         if ((result = __tspi_add_mem_entry(tspContext, 
> *versionInfo))) {
>                                 free_tspi(tspContext, 
> pValidationData->rgbValidationData);
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> TrouSerS-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/trousers-tech



-- 
IBM LTC Security

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
TrouSerS-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-tech

Reply via email to