Page 1 of 1

Re: [Nagios-devel] objects.cache : CGI fails if line longer than

Posted: Mon May 23, 2005 6:16 am
by Guest
François Laupretre wrote:
> Hi all,
>

[ some cruft cut ]

>
> After some traces in the code, I found that every CGI programs are failing
> in xodtemplate_register_servicegroup in the test for a non null
> svc_description.
>
> If I tell him to printf 'this_servicegroup->members', I get a SIGSEGV ! Hmm
> ! So, I had it printf every 'host_name' returned by strtok, and I saw that
> the last one before the errror was truncated. And after this field, strtok
> returns NULL (for svc_description). There, we know that we have a problem
> when reading the cache file because the string is not null-terminated. And,
> looking in the cache file, I found the line to be perfect. So, the problem
> is in the read part. Another thing : if I look at the character offset where
> it is stopping, it is character number 65538 in the line. If I substract the
> 'members' prefix of 12 chars, I get an offset of 65526.
>
> This is where I am for now. I am going to look at the function reading the
> cache file.
>

That would be mmap_fgets. I've got a feeling you're about to discover
that 65536 is the magic roof of the length of member-lists in
service-descriptions. Perhaps there is an unsigned short somewhere in
there which causes this weird limit.

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Lead Developer





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]