Skip to content
Snippets Groups Projects
Commit 73c41f20 authored by Elana Hashman's avatar Elana Hashman
Browse files

Fix #45: max (renewable) ticket life is negative

Since the negative flag in the helper function pykadmin_timestamp_as_deltastr
was never initialized to zero, using it in a comparison reads random values off
the stack, which are more likely to be non-zero than zero. Hence, checking
whether the delta was negative would return true even in cases where the delta
was not negative.
parent cc1fd897
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,8 @@ char *pykadmin_timestamp_as_isodate(time_t timestamp, const char *zero) {
char *pykadmin_timestamp_as_deltastr(int seconds, const char *zero) {
char *deltastr = NULL;
int negative, days, hours, minutes;
int days, hours, minutes;
int negative = 0;
if (seconds != 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment