Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon4.gif   Elogd crashes with: *** stack smashing detected ***, posted by Niklas on Fri Nov 21 10:53:09 2008 
    icon2.gif   Re: Elogd crashes with: *** stack smashing detected ***, posted by Niklas on Fri Nov 21 16:02:10 2008 
       icon2.gif   Re: Elogd crashes with: *** stack smashing detected ***, posted by Stefan Ritt on Mon Nov 24 18:15:01 2008 
          icon2.gif   Re: Elogd crashes with: *** stack smashing detected ***, posted by Niklas on Thu Nov 27 10:29:19 2008 
          icon2.gif   Re: Elogd crashes with: *** stack smashing detected ***, posted by Niklas on Fri Jan 9 10:41:20 2009 
             icon2.gif   Re: Elogd crashes with: *** stack smashing detected ***, posted by Niklas on Tue Jan 13 14:30:37 2009 
                icon2.gif   Re: Elogd crashes with: *** stack smashing detected ***, posted by Stefan Ritt on Wed Jan 21 08:45:25 2009 
                   icon2.gif   Re: Elogd crashes with: *** stack smashing detected ***, posted by Niklas on Wed Mar 4 16:32:56 2009 
                      icon2.gif   Re: Elogd crashes with: *** stack smashing detected ***, posted by Stefan Ritt on Wed Mar 4 16:41:27 2009 
Message ID: 66149     Entry time: Tue Jan 13 14:30:37 2009     In reply to: 66137     Reply to this: 66163
Icon: Reply  Author: Niklas  Author Email: niklas@hoglund.pp.se 
Category: Bug report  OS: Linux  ELOG Version: 2.7.5 2142 
Subject: Re: Elogd crashes with: *** stack smashing detected *** 

 

Stefan,

To solve the problem I suggest following change to elogd.c (2.7.5 2159).

Create a list of elog cookies, and store only these as parameters. Example diff:

---
$ diff elog/src/elogd.c elogd_niho.c
26557a26558
>    const char *cookie_list[] = { "upwd", "unm", "elmode", "urem", "wpwd", "apwd", "uname", NULL };
26603c26604,26610
<          setparam(str, cookie);
---
>          for(i=0; cookie_list[i]; i++) {
>             if(strcmp(cookie_list[i], str) == 0) {
>                setparam(str, cookie);
>                break;
>             }
>          }
>
---

In a more readable fashion:
int process_http_request(const char *request, int i_conn)
{
...
const char *cookie_list[] = { "upwd", "unm", "elmode", "urem", "wpwd", "apwd", "uname", NULL };
...
...
...
         /* store cookie as parameter */
         for(i=0; cookie_list[i]; i++) {
            if(strcmp(cookie_list[i], str) == 0) {
               setparam(str, cookie);
               break;
            }
         }

...

 

Not sure if I got all the cookies used by elog.

 

BR, niklas

ELOG V3.1.5-fe60aaf