[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] lagersegmentfejl coredumped ??



On Tue, 19 Mar 2002, Jan Arentoft wrote:

> Her har jeg sat næsten hele programmet ind som melder coredumped, det
> mærkelige er jo at når jeg ligger det som et cgi-script og kalder det via
> hjemmesiden så kommer fejlen coredumped ikke ??

> printf("Content-type: text/plain");

 printf("Content-type: text/plain\n\n");

I følge en tidligerer mail her omkring skal der to \n efter headeren.

>
> jann = getenv("QUERY_STRING");
>
>
> for (i=0 ; i<1000 ; i++)

Du checker ikke på længden af jann, så der burde stå noget ala

for (i=0 ; i< strlen(jann) ; i++)

hvis det er en pænt 0 termineret streng, hvis ikke må du få de oplysninger
et andet sted fra. Grunden til det core dumper er at du prøvet at tilgå
noget hukommelse som ikke tilhører dig, også må det gå galt

>  if (jann[i]=='.')
>   if (jann[i+1]=='.')
>    if (jann[i+2]=='.')
>     i=1000;


 if (jann[i]=='.' && jann[i+1]=='.' && jann[i+2]=='.')
    i=1000;



-k



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *