Ticket #10761: 10761_v2.patch

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

Get real PR_Free address

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

    From 6b35f4350718679358e737fc49bab9751c7bb23f Mon Sep 17 00:00:00 2001
    From: Disgleirio Morgan Wynne <Disgleirio.Wynne@google.com>
    Date: Wed, 25 Mar 2015 07:01:03 +0000
    Subject: [PATCH] ticket 10761
    
    Get real address of PR_Free, not a thunk.
    Look at https://bugzilla.mozilla.org/show_bug.cgi?id=451024 for more details.
    ---
     security/nss/lib/base/error.c | 13 ++++++++++++-
     1 file changed, 12 insertions(+), 1 deletion(-)
    
    diff --git a/security/nss/lib/base/error.c b/security/nss/lib/base/error.c
    index 807bbd4..007bfd6 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  PRLibrary *lib = NULL;
     70  dtor = (PRThreadPrivateDTOR) PR_FindSymbolAndLibrary("PR_Free", &lib);
     71  if (NULL == dtor)
     72    dtor = (PRThreadPrivateDTOR) PR_Free;
     73  if (NULL != lib)
     74    (void)PR_UnloadLibrary(lib);
     75#else
     76  dtor = (PRThreadPrivateDTOR) PR_Free;
     77#endif
     78  return PR_NewThreadPrivateIndex(&error_stack_index, dtor);
    6879}
    6980
    7081/*