Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compilation error: stray ‘\302’ in program, etc

I have a problem compiling the following exploit code:

http://downloads.securityfocus.com/vulnerabilities/exploits/59846-1.c

I am using "gcc file.c" and "gcc -O2 file.c", but both of them results in the following errors:

sorbolinux-exec.c: In function ‘sc’: sorbolinux-exec.c:76: error: stray ‘\302’ in program sorbolinux-exec.c:76: error: stray ‘\244’ in program sorbolinux-exec.c:76: error: ‘t’ undeclared (first use in this function) sorbolinux-exec.c:76: error: (Each undeclared identifier is reported only  once sorbolinux-exec.c:76: error: for each function it appears in.) 

I tried compiling them on both Kali Linux and Ubuntu 10.04 (Lucid Lynx) and got the same result.

like image 824
Ahmed Taher Avatar asked Oct 05 '13 13:10

Ahmed Taher


People also ask

How do I fix my stray 302 program?

One cause of the /(302) error is copy and paste code from a word processor. You have ASCII codes copied that add spaces, etc to your code. Go through each identified line and remove any extra spaces at the beginning and end of any identified line.

What is stray 302 in program Arduino?

It means you have a weird character (302 is its representation) in your code. Search for Shift+space for example which is a spacenolinebreak character you might have gotten in your program by copying and pasting from the webpage or fat finger when you typed in your code.

How do I get rid of stray errors?

Open the source code with an editor which is able to show special chars. Like 'vim'. Go to the line which is reported and you see the straying special char. That happens if you had opend or edited you sourcecode with an editor that enters “non breakable spaces” instead of the common whitespace.

What does stray in program mean?

If the error message referred to a stray \342 in the code it is most likely to have been caused by copying the code from a Web page which has Unicode characters in it.


1 Answers

You have an invalid character on that line. This is what I saw:

enter image description here

like image 141
Yu Hao Avatar answered Sep 22 '22 15:09

Yu Hao