[En-Nut-Discussion] Bug #1799374: NutRegisterCgi() Parameter 1

Ole Reinhardt ole.reinhardt at embedded-it.de
Tue Apr 1 23:20:22 CEST 2008


Hi Harald,

> Can someone please confirm whether this is correct or not?
> http://sourceforge.net/tracker/?group_id=34079

indeed this might result in a bug if you pass a string that is freed a
little later. i.E. if you have something like 

void function(void)
{
    char test[] = "abcd";
    NutRegisterCgi(abcd);
}

This could IMHO fail. Even if this string is allocated in the data
segment as well, there is a little chance to missuse the function when
passing a local copy or a dynamicaly created string to NutRegisterCgi().

I implemented a short fix that makes a copy of the passed string before
saving it in the cgiFunctionList.

Provided ther is no reason contrary, I could check in my fix to CVS.

I also added a function to register a cgi-bin path other than cgi-bin/.
I could add this function as well.

Regards,

Ole Reinhardt


-- 
 _____________________________________________________________
|                                                             |
| Embedded-IT          Hard- und Softwarelösungen             |
|                                                             |
| Ole Reinhardt        Tel. / Fax:        +49 (0)271  7420433 |
| Luisenstraße 29      Mobil:             +49 (0)177  7420433 |
| 57076 Siegen         eMail:    ole.reinhardt at embedded-it.de |
| Germany              Web:         http://www.embedded-it.de |
|                      UstID / VAT:       DE198944716         |
|_____________________________________________________________|




More information about the En-Nut-Discussion mailing list