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

RESOLVED FIXED

Status

Core Graveyard
Embedding: GRE Core
P2
normal
RESOLVED FIXED
12 years ago
a year ago

People

(Reporter: Benjamin Smedberg, Assigned: Benjamin Smedberg)

Tracking

({fixed1.8.1})

Trunk
x86
Linux
fixed1.8.1

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

12 years ago
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.
(Assignee)

Updated

12 years ago
Priority: -- → P2

Updated

12 years ago
Status: NEW → ASSIGNED

Updated

12 years ago
Status: ASSIGNED → NEW
(Assignee)

Comment 1

12 years ago
Created attachment 216552 [details] [diff] [review]
Fix GRE_HOME, rev. 1
Attachment #216552 - Flags: review?(darin)

Comment 2

12 years ago
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+
(Assignee)

Comment 3

12 years ago
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
Last Resolved: 12 years ago
Resolution: --- → FIXED
(Assignee)

Updated

12 years ago
Attachment #216552 - Flags: approval-branch-1.8.1?(darin)

Comment 4

12 years ago
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+
(Assignee)

Comment 5

12 years ago
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.