1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ann [662]
2 years ago
15

Explain in detail what this code does, Whats the flow in it, and whats the risk that its creating and what can i do to fix it? (

c language)
*please explain it like im a 5 year old and write the code because i dont know alot about buffer overflow or pointers lol <3
#include
#include
int main (int argc, char ** argv)
{
char buffer[500];
strcpy(buffer, argv[1]);

return 0;
}
Computers and Technology
1 answer:
kodGreya [7K]2 years ago
5 0

Answer:

The buffer has room for 499 characters (you always have to reserve 1 for the terminating \0 character).

The code copies all characters passed in the commandline (argv[1]) into this buffer without checking. If there are more than 499 characters supplied, these will be copied into a memory location that is not intended for it. This will probably cause your program to crash, but if the extra data is somehow executed by the processor as if it were a program, this could be a way to sneak a virus into your computer.

So, while copying data, it is important to always limit the maximum amount to the allocated space.

You might be interested in
What is technology? *
natta225 [31]

Answer: All of the above is the answer

4 0
2 years ago
Describe how catching exceptions can help with file errors. Write three Python examples that actually generate file errors on yo
vovangra [49]

Answer:

Three python errors are; import error, value error, and key error.

Explanation:

Errors occur in all programming languages and just like every other language, python has error handling techniques like the try and except and also the raise keyword.

A value error occurs when an output of a variable or expression gives an unexpected value. Import error results from importing a module from an unknown source while a key error is from a wrong input keypress.

Catching these errors and raising an error gives more control and continuity of the source code.

8 0
3 years ago
Floppy disks hold more data than a CD-R/RW.<br> true or false?
svp [43]
False the CD-Rw holds more
5 0
3 years ago
Read 2 more answers
Interruption attacks are also called ___ attacks:
Lelu [443]

Answer:

Interruption attack are also referred to as Denial Of Service(DOS) attack.

Explanation:

Interruption attack are also called denial of service.The main aim of  interruption attack or Denial Of Srvice attack is to make resources unavailable.

For example:- wordpress.com had an DOS attack that took down their servers hence the service was unavailable for it's users.

Hence we conclude that the answer to this question is Denail of Service (DOS).

4 0
3 years ago
Which is the correct description of the first act in a classical game story structure?
Reil [10]
The 3-act structure<span> is an old principle widely adhered to in storytelling today. It can be found in plays, poetry, novels, comic books, short stories, video games, and the movies. It was present in the novels of Conan Doyle, the plays of Shakespeare, the fables of Aesop, the poetry of Aristotle, and the films of Hitchcock. It’s older than Greek dramaturgy. Hollywood and Broadway use it well. It’s irrefutable and bullet-proof, so to speak.

so this means its more basic antagonist protagonist set-up even if the protagonist and antagonist are "CUBES"</span>
5 0
3 years ago
Other questions:
  • If you think the user might enter 24.9, you should create a float variable. true or false
    9·1 answer
  • The frequencies licensed by telecommunication firms to provide wireless service is known as _____.
    13·1 answer
  • The___provides access to the internet; may also be internal
    11·1 answer
  • A browser is used for creating Web pages. true or false?
    5·2 answers
  • Which type of computer graphic can be blown up to a much larger size without getting distorted or losing quality?
    5·1 answer
  • VOTE!
    11·1 answer
  • Most 4 year colleges want an applicant's scores for all the following except
    12·1 answer
  • Book information (overriding member methods) Given main() and a base Book class, define a derived class called Encyclopedia. Wit
    12·1 answer
  • Only for study<br><br>Or open Meet and enter this code: bqa-ivfs-ach​
    11·2 answers
  • Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!