Open Bug 130020 Opened 23 years ago Updated 2 years ago

Prototypes for many PL_str*() functions return |char *|-pointers for data passed as |const char *|

Categories

(NSPR :: NSPR, defect)

defect

Tracking

(Not tracked)

People

(Reporter: roland.mainz, Unassigned)

Details

I found a issue in most of the NSPR functions which can lead to hard-to-find accidental data corruption and other evil issues: Many of the string functions in NSPR return a |char *| pointer to data which were passed as |const char *| - which may lead to hidden problems when code will modify the returned (maybe a string which MUST be treated as |const|). Example: PL_strstr() is defined as -- snip -- PR_EXTERN(char *) PL_strstr(const char *big, const char *little); -- snip -- I think it may be better to define it as -- snip -- PR_EXTERN(const char *) PL_strstr(const char *big, const char *little); -- snip --
This is a disturbing bug. Fixing this is sure to require changes to code using NSPR.
Status: NEW → ASSIGNED
QA Contact: wtchang → nspr

The bug assignee didn't login in Bugzilla in the last 7 months.
:KaiE, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: wtc → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(kaie)

Is this worth fixing?

Flags: needinfo?(kaie)

Would be great to get some help on this, probably a nontrivial amount of work triggered by API changes (as predicted by WTC).

Flags: needinfo?(sledru)

if it has been around for 20 years, probably not...

Flags: needinfo?(sledru)

In the process of migrating remaining bugs to the new severity system, the severity for this bug cannot be automatically determined. Please retriage this bug using the new severity system.

Severity: major → --

The severity field is not set for this bug.
:KaiE, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(kaie)
Severity: -- → S2
Flags: needinfo?(kaie)
You need to log in before you can comment on or make changes to this bug.