#597 closed defect (fixed)
psStringNCopy fails to produce null-terminated string when nChar == 0
| Reported by: | Paul Price | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | sys | Version: | 0.8.0 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
When nChar == 0, psStringNCopy will allocate a string of size nChar + 1, but it
is not null-terminated:
Ensure the last byte is NULL character
if (nChar > 0) {
returnValue[nChar] = '\0';
}
Removing the restriction results in the correct result:
Ensure the last byte is NULL character
returnValue[nChar] = '\0';
Note:
See TracTickets
for help on using tickets.

fixed in CVS