#610 closed defect (fixed)
getToken in psTime.c can walk off the end of the string
| Reported by: | Owned by: | ||
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | astro | Version: | 0.8.0 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
In psTime.c, getToken can walk off the end of the string as it fails to look to see if it's got
to the NUL before incrementing past the token. E.g.
psTime *t = psTimeGetNow(PS_TIME_UTC); psTimeToLMST(t, 75*M_PI/180);
[I hope that's right; translated from python -- but you get the point]. The other two static
definitions of "getToken" don't seem to have this problem.
* psTime.c~ Tue Oct 4 23:51:41 2005
--- psTime.c Tue Nov 29 18:48:45 2005
*
* 144,150
cleanToken = cleanString(*inString, sLen);
Move to end of token
! (*inString) += (sLen+1);
} else if(inString!='\0' && sLen==0) {
*status = PS_PARSE_ERROR_GENERAL;
--- 144,153 ----
cleanToken = cleanString(*inString, sLen);
Move to end of token
! (*inString) += sLen;
! if (inString != '\0') {
! (*inString)++;
! }
} else if(inString!='\0' && sLen==0) {
*status = PS_PARSE_ERROR_GENERAL;
Change History (9)
comment:1 by , 21 years ago
| Status: | new → assigned |
|---|
comment:2 by , 20 years ago
| Owner: | changed from to |
|---|---|
| Status: | assigned → new |
comment:3 by , 20 years ago
| Owner: | changed from to |
|---|
comment:4 by , 20 years ago
| Cc: | added |
|---|
comment:5 by , 20 years ago
comment:6 by , 20 years ago
| blocked: | → 717 |
|---|

* Bug 710 has been marked as a duplicate of this bug. *