Ticket #10761: 10761.patch

File 10761.patch, 1.1 KB (added by disgleirio, 5 years ago)

Get real PR_Free address

  • security/nss/lib/base/error.c

    From aa82d2dfb07052dc7cbd9237a844f7b732dc0fbb Mon Sep 17 00:00:00 2001
    From: Disgleirio Morgan Wynne <Disgleirio.Wynne@google.com>
    Date: Tue, 24 Mar 2015 17:04:22 +0000
    Subject: [PATCH] Update error.c
    
    Get real PR_Free address if we built using MinGW (GCC) to prevent bug 10761
    ---
     security/nss/lib/base/error.c | 12 +++++++++++-
     1 file changed, 11 insertions(+), 1 deletion(-)
    
    diff --git a/security/nss/lib/base/error.c b/security/nss/lib/base/error.c
    index 807bbd4..83ea0f8 100644
    a b static PRCallOnceType error_call_once; 
    6464static PRStatus
    6565error_once_function ( void)
    6666{
    67   return PR_NewThreadPrivateIndex(&error_stack_index, PR_Free);
     67  PRThreadPrivateDTOR dtor;
     68#ifdef __MINGW32__
     69  dtor = (PRThreadPrivateDTOR)
     70         GetProcAddress(GetModuleHandle(TEXT("nspr4.dll")),
     71                        "PR_Free");
     72  if (!dtor)
     73    dtor = (PRThreadPrivateDTOR) PR_Free;
     74#else
     75  dtor = (PRThreadPrivateDTOR) PR_Free;
     76#endif
     77  return PR_NewThreadPrivateIndex(&error_stack_index, dtor);
    6878}
    6979
    7080/*