Nmap Development mailing list archives

Possible fix for overflow in uptime


From: "Toby Simmons" <toby () simmonsconsulting com>
Date: Wed, 9 Sep 2009 14:30:33 -0500

RE my last bug (only on Windows) a possible fix would be to change the
format to "lli" instead of "li" to fix the overflow issue:

 

Change line 1714 of output.cc from

    log_write(LOG_XML, "<uptime seconds=\"%li\" lastboot=\"%s\" />\n",
tv.tv_sec - currenths->seq.lastboot, tmbuf);

 

To

    log_write(LOG_XML, "<uptime seconds=\"%lli\" lastboot=\"%s\" />\n",
(tv.tv_sec - currenths->seq.lastboot), tmbuf);

 

Thanks &

Cheers,

 

Toby

___________________________________
Toby Simmons

Simmons Consulting Web Design & Marketing
501-399-3603/Office | 501-231-2045/Cell | 501-244-4416/Fax

 <mailto:toby () simmonsconsulting com> toby () simmonsconsulting com |
<http://www.simmonsconsulting.com/> http://www.simmonsconsulting.com

 


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: