This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Reg seg. violations
- From: "Vivek Katakam" <vivek1717 at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 17 Jul 2006 00:27:44 +0530
- Subject: Reg seg. violations
Hi all
I am mainly getting segmentation violation at this code in strlen and strcpy:
printf("Content-type: text/html\n\n");
line_buffer = (char *) malloc(strlen(getenv("QUERY_STRING")) + 1);
strcpy(line_buffer, getenv("QUERY_STRING"));
at strlen and strcpy when QUERY_STRING is not set .
Is there a way to handle this? there are a lot of such occurrences.
Regards,
Vivek