Closed Bug 20558 Opened 25 years ago Closed 25 years ago

pr_Mac_LoadIndexedFragment calls pr_UnlockedFindLibrary() will null fragmentName

Categories

(NSPR :: NSPR, defect, P3)

PowerPC
Mac System 8.5
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sfraser_bugs, Assigned: sdagley)

Details

pr_UnlockedFindLibrary() calls pr_UnlockedFindLibrary() without first getting the
fragment name from the DLL. This results in calls to strchr on 0, which is bad.
Version: 3.13.1 → 3.1.1
Changing this so I get mail.
Patches follow:

Index: macdll.c
===================================================================
RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/mac/macdll.c,v
retrieving revision 3.4
diff -r3.4 macdll.c
345c345
< static OSErr GetNamedFragmentOffsets(const FSSpec *fileSpec, const char*
fragmentName,
---
> OSErr GetNamedFragmentOffsets(const FSSpec *fileSpec, const char* fragmentName,
413c413
< static OSErr GetIndexedFragmentOffsets(const FSSpec *fileSpec, UInt32
fragmentIndex,
---
> OSErr GetIndexedFragmentOffsets(const FSSpec *fileSpec, UInt32 fragmentIndex,

Index: macdll.h
===================================================================
RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/mac/macdll.h,v
retrieving revision 1.1
diff -r1.1 macdll.h
23a24,28
> OSErr GetNamedFragmentOffsets(const FSSpec *fileSpec, const char* fragmentName,
> 							UInt32 *outOffset, UInt32 *outLength);
> OSErr GetIndexedFragmentOffsets(const FSSpec *fileSpec, UInt32 fragmentIndex,
> 							UInt32 *outOffset, UInt32 *outLength, char **outFragmentName);
>

Index: prlink.c
===================================================================
RCS file: /cvsroot/mozilla/nsprpub/pr/src/linking/prlink.c,v
retrieving revision 3.29
diff -r3.29 prlink.c
827c827
<
---
>
887a888
> 	UInt32              fragOffset, fragLength;
897,904d897
< 	result = pr_UnlockedFindLibrary(fragmentName);
< 	if (result != NULL) goto unlock;
<
< 	newLib = PR_NEWZAP(PRLibrary);
< 	if (newLib == NULL) goto unlock;
< 	newLib->staticTable = NULL;
<
<
914a908,918
>     err = GetIndexedFragmentOffsets(&resolvedSpec, fragIndex, &fragOffset, &fragLength, &fragmentName);
>   if (err != noErr) goto unlock;
>
> 	result = pr_UnlockedFindLibrary(fragmentName);
> 	free(fragmentName);
> 	fragmentName = NULL;
> 	if (result != NULL) goto unlock;
>
> 	newLib = PR_NEWZAP(PRLibrary);
> 	if (newLib == NULL) goto unlock;
> 	newLib->staticTable = NULL;
Version: 3.1.1 → 3.5
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
fix checked in
You need to log in before you can comment on or make changes to this bug.