Closed Bug 325450 Opened 15 years ago Closed 15 years ago

nsGREGlue check of GRE_HOME needs to add "/libxpcom.so"

Categories

(Core Graveyard :: Embedding: GRE Core, defect, P2)

x86
Linux
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: benjamin, Assigned: benjamin)

Details

(Keywords: fixed1.8.1)

Attachments

(1 file)

nsGREGlue has a check for GRE_HOME (which should by tradition be a directory path), but the function should return a patch with the XPCOM DLL path.
Priority: -- → P2
Status: NEW → ASSIGNED
Status: ASSIGNED → NEW
Attachment #216552 - Flags: review?(darin)
Comment on attachment 216552 [details] [diff] [review]
Fix GRE_HOME, rev. 1

>Index: xpcom/glue/nsGREGlue.cpp

>+    char p[MAXPATHLEN];
>+    snprintf(p, sizeof(p), "%s" XPCOM_FILE_PATH_SEPARATOR XPCOM_DLL, env);
>+    p[sizeof(p)] = '\0';

This is writing a null byte beyond the end of the array.  snprintf promises
to null terminate |p| or upon failure it will leave |p| unmodified.  Perhaps
you should initialize p[0] to '\0' then.

r=darin w/ that fixed
Attachment #216552 - Flags: review?(darin) → review+
Fixed on trunk. I'd like to fix this on the 1.8 branch as well, but not 1.8.0 as it is in a bizarre way an API that should remain stable.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Attachment #216552 - Flags: approval-branch-1.8.1?(darin)
Comment on attachment 216552 [details] [diff] [review]
Fix GRE_HOME, rev. 1

a=darin
Attachment #216552 - Flags: approval-branch-1.8.1?(darin) → approval-branch-1.8.1+
Fixed on 1.8 branch.
Keywords: fixed1.8.1
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.