[Xymon] SCO OS 6 Returns Negative Memory

Jamison Maxwell jamison at newasterisk.com
Fri May 3 16:42:30 CEST 2013


Also, I'm using your remote client, Jeremy.  It's a huge help and I recommend it to everyone.





Jamison Maxwell
p. 770 605 6653
jamison at newasterisk.com<mailto:jamison at newasterisk.com>
________________________________
From: Jeremy Laidman [jlaidman at rebel-it.com.au]
Sent: Thursday, May 02, 2013 11:14 PM
To: Jamison Maxwell
Cc: xymon at xymon.com; Henrik Størner
Subject: Re: [Xymon] SCO OS 6 Returns Negative Memory


On 3 May 2013 04:11, Jamison Maxwell <jamison at newasterisk.com<mailto:jamison at newasterisk.com>> wrote:
4294496256

Yes, this is bigger than what atoi() will return.  This is done in xymond/client/sco_sv.c in the function handle_sco_sv_client() in the following line of code:

                memphystotal = (atoi(memsizestr) / 1048576);

The variable memsizestr is a string pointer to the value in the [memsize] client data section.  The variable memphystotal is defined as a long, so it would make sense that atol() be used instead of atoi().

This is probably a bug in Xymon, but I'm not a C coder so I'm not entirely sure.  However, the [memsize] section is only parsed for (and sent by) SCO/Unixware systems, which isn't exactly the most popular OS around.  As far as I can tell, it's the only client parsing code that uses atoi() for memory numbers, and has probably rarely been used on SCO systems with sufficient memory size to overflow the signed integer type (about 2.1GB).

Henrik, agree that this is a bug?

Cheers
Jeremy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20130503/d99bbeda/attachment.html>


More information about the Xymon mailing list