summaryrefslogtreecommitdiffstats
path: root/src/kadmin/cli
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2011-11-06 04:32:34 +0000
committerGreg Hudson <ghudson@mit.edu>2011-11-06 04:32:34 +0000
commite10f243be294ba9b3ba4b39a1a6bdf4bbbaf0fcf (patch)
tree4f2f2d9a5a772e299aa3352c4c22e7e78254fcb4 /src/kadmin/cli
parent83432c34d4123b600da962e84e021bb154598588 (diff)
downloadkrb5-e10f243be294ba9b3ba4b39a1a6bdf4bbbaf0fcf.tar.gz
krb5-e10f243be294ba9b3ba4b39a1a6bdf4bbbaf0fcf.tar.xz
krb5-e10f243be294ba9b3ba4b39a1a6bdf4bbbaf0fcf.zip
Fix month/year units in getdate
getdate strings like "1 month" or "next year" would fail some of the time, depending on the value of stack garbage, because DSTcorrect() doesn't set *error on success and RelativeMonth() doesn't initialize error. Make DSTcorrect() responsible for setting *error in all cases. ticket: 7003 target_version: 1.10 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25444 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kadmin/cli')
-rw-r--r--src/kadmin/cli/getdate.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/kadmin/cli/getdate.y b/src/kadmin/cli/getdate.y
index 613bc609c2..fc0a403e20 100644
--- a/src/kadmin/cli/getdate.y
+++ b/src/kadmin/cli/getdate.y
@@ -631,6 +631,7 @@ DSTcorrect(time_t Start, time_t Future, int *error)
return -1;
}
FutureDay = (tm->tm_hour + 1) % 24;
+ *error = 0;
return (Future - Start) + (StartDay - FutureDay) * 60L * 60L;
}
@@ -873,7 +874,7 @@ get_date(char *p)
time_t Start;
time_t tod;
time_t delta;
- int error = 0;
+ int error;
yyInput = p;
if (now == NULL) {