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]
3 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]3 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
Launched in 1995, ________ has become the most popular web browser.
kicyunya [14]
It’s Internet explorer
6 0
3 years ago
What tool is provided in Windows to facilitate sharing data objects between applications and computers?
Anton [14]

Answer:

Component services

Explanation:

In Windows, components services are integrated into the Administrative Tools and are used to configure certain COM (Component Object Model) components and applications. They are also used to ;

i. assign roles to users and groups.

ii. facilitate data sharing between applications and computers by processes such as pooling, pausing, resuming and recycling applications.

7 0
3 years ago
helppppp asap!!!!!!!!!! Sara has just started using the Internet. She would like to be a little more efficient. In 3–4 sentences
Artist 52 [7]
Use the web for educational purposes.
Use the web for instructional reasons.
Use the web only when something you find interesting does not make sense to you.
Don’t use the web on a day to day basis.
4 0
3 years ago
Read 2 more answers
If you and another person want to encrypt messages, what should you provide that person with?
qaws [65]

The encrypt key or encrypt passphrase

3 0
3 years ago
Common icons found on the Windows desktop are _____.
Ket [755]

Answers- My computer, My Documents and Recyle bin.

2,3,4 option

5 0
3 years ago
Read 2 more answers
Other questions:
  • 3. If B3=6 and D5=8, what would the following function return? IF(B3&gt;D5, "Closed", D5-B3) *
    10·2 answers
  • An increase in Consumption will ___________ in the Classical Model of Aggregate Demand.
    13·1 answer
  • Special effects are added using the _____.
    16·1 answer
  • How is the cia triad used to evaluate encryption methods?
    6·1 answer
  • Given an integer n and an array a of length n, your task is to apply the following mutation to an: Array a mutates into a new ar
    5·1 answer
  • What tool can you use to discover vulnerabilities or dangerous misconfigurations on your systems and network
    5·1 answer
  • How can you reduce the Impact of Hacking? <br>pls help with this &lt;3​
    9·1 answer
  • Which function category is not in Excel 2016?
    12·2 answers
  • True or False? Security code is almost always open source!<br> True<br> False
    8·2 answers
  • What type of malware is best known for carrying other malware as a payload?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!