Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-09

CGI: cgiapp.pp and ezcgi.pp possible bug

13 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

James Mills

Hi all again,

I'm reposting this question as I would like to find some answers to this problem, or writing this particular kind of CGI App will be impossible. (Forum).

I think there might be a possible bug in both ezcgi.pp and cgiapp.pp

If you try and post a piece of form data:
ie:
<textarea>

>

</textarea>

it will hang in an infinite loop.

I'm not sure where the problem is, debugging cgi apps is hard ;)

cheers
James

- -Zero Defect Software Engineers Group - ZDSEG - -You need only two tools. WD-40 and duct tape. -If it doesn't move and it should, use WD-40. -If it moves and shouldn't, use the tape.
Unknown author
to James Mills
James Mills wrote 15 lines
Hi all again, I'm reposting this question as I would like to find some answers to this problem, or writing this particular kind of CGI App will be impossible. (Forum). I think there might be a possible bug in both ezcgi.pp and cgiapp.pp If you try and post a piece of form data: ie: <textarea> > > </textarea> it will hang in an infinite loop.

Not here. The testapplication also uses a textarea, and it works fine.

Michael.

Alan Mead
to James Mills: I'm reposting this question as I would like to find some answers to this problem, or…

Is this something demonstrable in a small program?

--- James Mills wrote 35 lines
Hi all again, I'm reposting this question as I would like to find some answers to this problem, or writing this particular kind of CGI App will be impossible. (Forum). I think there might be a possible bug in both ezcgi.pp and cgiapp.pp If you try and post a piece of form data: ie: <textarea> > > </textarea> it will hang in an infinite loop. I'm not sure where the problem is, debugging cgi apps is hard ;) cheers James -- - -Zero Defect Software Engineers Group - ZDSEG - -You need only two tools. WD-40 and duct tape. -If it doesn't move and it should, use WD-40. -If it moves and shouldn't, use the tape. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com

James Mills
to Unknown author: Not here. The testapplication also uses a textarea, and it works fine. Michael.
Show quoted text 21 lines
On Sat, 13 Sep 2003, James Mills wrote: > Hi all again, > > I'm reposting this question as I would like to find some answers to this > problem, or writing this particular kind of CGI App will be impossible. > (Forum). > > I think there might be a possible bug in both ezcgi.pp and cgiapp.pp > > If you try and post a piece of form data: > ie: > <textarea> > > > > </textarea> > > it will hang in an infinite loop. Not here. The testapplication also uses a textarea, and it works fine.

No what I mean is if you POST data to the cgi app containing "> >" it will hang.

cheers
James

- -Zero Defect Software Engineers Group - ZDSEG - -You need only two tools. WD-40 and duct tape. -If it doesn't move and it should, use WD-40. -If it moves and shouldn't, use the tape.
James Mills
to Alan Mead: Is this something demonstrable in a small program? __________________________________ Do…
Alan Mead wrote
Is this something demonstrable in a small program?

I could rewrite another version of the cgi app with a simple html to post data containing "> >". I'll try and do that tonight and post it.

cheers
James

- -Zero Defect Software Engineers Group - ZDSEG - -You need only two tools. WD-40 and duct tape. -If it doesn't move and it should, use WD-40. -If it moves and shouldn't, use the tape.
Alan Mead
to James Mills

I don't know anything about the FP cgi routines, but I program CGI a lot and the handling of characters like '>' could be tricky. Does it hang on other strings containing an angle bracket, or just this particular one? And you say when you POST... that means it works if you ... (I'm blanking on name of the other method)?

-Alan

--- James Mills wrote 21 lines
On Fri, Sep 12, 2003 at 11:09:28AM -0700, Alan Mead wrote: > Is this something demonstrable in a small program? I could rewrite another version of the cgi app with a simple html to post data containing "> >". I'll try and do that tonight and post it. cheers James -- - -Zero Defect Software Engineers Group - ZDSEG - -You need only two tools. WD-40 and duct tape. -If it doesn't move and it should, use WD-40. -If it moves and shouldn't, use the tape. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com

Unknown author
to James Mills: No what I mean is if you POST data to the cgi app containing "> >" it will hang. cheers…
James Mills wrote 25 lines
On Fri, Sep 12, 2003 at 06:34:16PM +0200, wrote: > > > On Sat, 13 Sep 2003, James Mills wrote: > > > Hi all again, > > > > I'm reposting this question as I would like to find some answers to this > > problem, or writing this particular kind of CGI App will be impossible. > > (Forum). > > > > I think there might be a possible bug in both ezcgi.pp and cgiapp.pp > > > > If you try and post a piece of form data: > > ie: > > <textarea> > > > > > > </textarea> > > > > it will hang in an infinite loop. > > Not here. The testapplication also uses a textarea, and it works fine. No what I mean is if you POST data to the cgi app containing "> >" it will hang.

I did exactly that, to be sure. It was returned correctly.

Michael.

James Mills
to Alan Mead: I don't know anything about the FP cgi routines, but I program CGI a lot and the handling…
Alan Mead wrote 5 lines
I don't know anything about the FP cgi routines, but I program CGI a lot and the handling of characters like '>' could be tricky. Does it hang on other strings containing an angle bracket, or just this particular one? And you say when you POST... that means it works if you ... (I'm blanking on name of the other method)?

It hands when you POST data with two angled bracked, eg: "> >" I have not tried using GET, I don't think it would be appropiate for a form based page :)

cheers
James

- -Zero Defect Software Engineers Group - ZDSEG - -You need only two tools. WD-40 and duct tape. -If it doesn't move and it should, use WD-40. -If it moves and shouldn't, use the tape.
Alan Mead
to James Mills
--- James Mills wrote 5 lines
It hands when you POST data with two angled bracked, eg: "> >" I have not tried using GET, I don't think it would be appropiate for a form based page :)

Form data can be POST'd or GET'd depending on the way you form the 'form' tag. You're right that POST is generally used but sometimes the form data are brief and it's advantageous to allow the user to bookmark the state of the CGI, in which case you should use GET. Google and Yahoo searches are a good example.

In this case, where you suspect a bug in processing of the data, it might be helpful to know whether it affects both cases. Have you solved the issue or do you have a small example program?

-Alan

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com

James Mills
to Alan Mead
Alan Mead wrote 16 lines
--- James Mills wrote: > > It hands when you POST data with two angled bracked, eg: "> >" > I have not tried using GET, I don't think it would be appropiate > for a > form based page :) Form data can be POST'd or GET'd depending on the way you form the 'form' tag. You're right that POST is generally used but sometimes the form data are brief and it's advantageous to allow the user to bookmark the state of the CGI, in which case you should use GET. Google and Yahoo searches are a good example. In this case, where you suspect a bug in processing of the data, it might be helpful to know whether it affects both cases. Have you solved the issue or do you have a small example program?

This bug is preventing me from completing a clone of my profressors forum :P I will (when I find the time) try and implement an example to show you.

cheers
James

- -Zero Defect Software Engineers Group - ZDSEG - -You need only two tools. WD-40 and duct tape. -If it doesn't move and it should, use WD-40. -If it moves and shouldn't, use the tape.
Unknown author
to James Mills
James Mills wrote 21 lines
On Sun, Sep 14, 2003 at 06:48:36AM -0700, Alan Mead wrote: > --- James Mills wrote: > > > > It hands when you POST data with two angled bracked, eg: "> >" > > I have not tried using GET, I don't think it would be appropiate > > for a > > form based page :) > > Form data can be POST'd or GET'd depending on the way you form the > 'form' tag. You're right that POST is generally used but sometimes > the form data are brief and it's advantageous to allow the user to > bookmark the state of the CGI, in which case you should use GET. > Google and Yahoo searches are a good example. > > In this case, where you suspect a bug in processing of the data, it > might be helpful to know whether it affects both cases. Have you > solved the issue or do you have a small example program? This bug is preventing me from completing a clone of my profressors forum :P I will (when I find the time) try and implement an example to show you.

I changed the form method to POST and retried, but it still works here. Are you sure the bug is not in your code ?

Michael.

James Mills
to Unknown author
Show quoted text 28 lines
On Mon, 15 Sep 2003, James Mills wrote: > On Sun, Sep 14, 2003 at 06:48:36AM -0700, Alan Mead wrote: > > --- James Mills wrote: > > > > > > It hands when you POST data with two angled bracked, eg: "> >" > > > I have not tried using GET, I don't think it would be appropiate > > > for a > > > form based page :) > > > > Form data can be POST'd or GET'd depending on the way you form the > > 'form' tag. You're right that POST is generally used but sometimes > > the form data are brief and it's advantageous to allow the user to > > bookmark the state of the CGI, in which case you should use GET. > > Google and Yahoo searches are a good example. > > > > In this case, where you suspect a bug in processing of the data, it > > might be helpful to know whether it affects both cases. Have you > > solved the issue or do you have a small example program? > > This bug is preventing me from completing a clone of my profressors > forum :P I will (when I find the time) try and implement an example to > show you. I changed the form method to POST and retried, but it still works here. Are you sure the bug is not in your code ?

Positive :) It's based on an example in the FCL.
Would you like to take a look at it ? I'll gladly mail you the source, it uses sqlite for it's embedded database.

cheers
James

- -Zero Defect Software Engineers Group - ZDSEG - -You need only two tools. WD-40 and duct tape. -If it doesn't move and it should, use WD-40. -If it moves and shouldn't, use the tape.
Unknown author
to James Mills
James Mills wrote 32 lines
On Sun, Sep 14, 2003 at 05:36:25PM +0200, wrote: > > > On Mon, 15 Sep 2003, James Mills wrote: > > > On Sun, Sep 14, 2003 at 06:48:36AM -0700, Alan Mead wrote: > > > --- James Mills wrote: > > > > > > > > It hands when you POST data with two angled bracked, eg: "> >" > > > > I have not tried using GET, I don't think it would be appropiate > > > > for a > > > > form based page :) > > > > > > Form data can be POST'd or GET'd depending on the way you form the > > > 'form' tag. You're right that POST is generally used but sometimes > > > the form data are brief and it's advantageous to allow the user to > > > bookmark the state of the CGI, in which case you should use GET. > > > Google and Yahoo searches are a good example. > > > > > > In this case, where you suspect a bug in processing of the data, it > > > might be helpful to know whether it affects both cases. Have you > > > solved the issue or do you have a small example program? > > > > This bug is preventing me from completing a clone of my profressors > > forum :P I will (when I find the time) try and implement an example to > > show you. > > I changed the form method to POST and retried, but it still works here. > Are you sure the bug is not in your code ? Positive :) It's based on an example in the FCL. Would you like to take a look at it ? I'll gladly mail you the source, it uses sqlite for it's embedded database.

You can.

Michael.