Skip to content
Snippets Groups Projects
Commit 51f00449 authored by James Golovich's avatar James Golovich
Browse files

Make sure time is valid for uptime (bug 1214)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 044aa4fa
Branches
Tags
No related merge requests found
......@@ -186,6 +186,8 @@ static char *format_uptimestr(time_t timeval)
#define WEEK (DAY*7)
#define YEAR (DAY*365)
if (timeval < 0)
return NULL;
if (timeval > YEAR) {
years = (timeval / YEAR);
timeval -= (years * YEAR);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment