Package version numbers not validated correctly
Closed / Fixed218888ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:07:14
OriginalBugID: 2539 Bug
Version: 8.2b2
SubmitDate: '1999-08-12'
LastModified: '1999-09-20'
Severity: MED
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: Solaris
Machine: Other
FixedDate: '1999-09-20'
FixedInVersion: 8.3b1
ClosedDate: '2000-10-25'
Name:
Hemang Lavana
CustomShell:
Modified the function CheckVersion to flag an error whenever two consecutive dots appear in a version number.
Comments:
This problem is also present in 8.0.5.
ReproducibleScript:
The command "package provide test 1.0..1" runs successfully without any
errors, even though the version number has two consecutive dots in it.
DesiredBehavior:
An error should be reported, when a package version number is specified
with consecutive dots in it (ex: 1.0..1).
Patch:
*** tclPkg.c-org Thu Aug 12 09:06:27 1999
--- tclPkg.c Thu Aug 12 09:51:07 1999
***************
*** 871,884 ****
* by dots. */
{
char *p = string;
if (!isdigit(UCHAR(*p))) { /* INTL: digit */
goto error;
}
for (p++; *p != 0; p++) {
! if (!isdigit(UCHAR(*p)) && (*p != '.')) { /* INTL: digit */
goto error;
}
}
if (p[-1] != '.') {
return TCL_OK;
--- 871,888 ----
* by dots. */
{
char *p = string;
+ char prevChar;
if (!isdigit(UCHAR(*p))) { /* INTL: digit */
goto error;
}
+ prevChar = *p;
for (p++; *p != 0; p++) {
! if (!isdigit(UCHAR(*p)) &&
! ((*p != '.') || (prevChar == '.'))) { /* INTL: digit */
goto error;
}
+ prevChar = *p;
}
if (p[-1] != '.') {
return TCL_OK;
PatchFiles:
tclPkg.c
Added to 8.3b1 with tests.
-- 09/20/1999 hobbs
welch Closed ticket [218888ffff].
[History diff]2000-10-26 08:31:14
dgp Ticket [218888ffff]: 3 changes
[History diff]2001-04-19 00:35:55
Log in (anonymous is fine) to add a comment.