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
Given the following MIPS Code Fragment:
galben [10]

Answer:

There are 3 Data Hazard

Explanation:

Find attached the solution

6 0
3 years ago
PLZ HELP WILL MARK BRANLIEST Jargon is:
77julia77 [94]

Answer:C language that include terms that only a select

Explanation:

It’s the right one

7 0
3 years ago
List 5 ways that computers could be used in a school or university
larisa [96]

Answer:

Explanation:

✓ computer can be used Interactive Learning apps, whereby students can share knowledge

✓Access to Information on the go: computer can be searched when educational information is needed

✓Virtual Classrooms : Incase of online classroom computer can be of help where both teacher student can meet online

✓Data processing and presentation ; computer can be used by both teacher and student in processing of data's.

✓Computer Literacy Education : for Literacy Education, computer can be used in training students to become computer literate.

4 0
3 years ago
MARKING BRAINLIEST
BabaBlast [244]

Answer: Well, first of all, you might want to change websites. I suggest khan academy.

anyways if your a begnner *Like me* The you might wanna try Java Script! in other words i do not know how to work Python

8 0
3 years ago
Which of the following need to be assessed during unit testing?
diamong [38]
E) both C and D Erro handling and execution paths
8 0
3 years ago
Other questions:
  • The spreadsheet below shows the names years in office, and number of terms for five US presidents
    7·2 answers
  • Nick is a food blogger. He first writes his draft on an electronic document, checks and corrects mistakes, and pastes the conten
    9·2 answers
  • All languages from the second generation on must be translated into machine language for the computer to be able process the inp
    8·1 answer
  • Which of the following terms means that the system changes based on
    14·1 answer
  • What are issues to consider when deciding to build software in-house or purchase commercial off-the-shelf software (cots)?
    14·1 answer
  • Any fact or set of facts, such as the words in a letter to a friend or the notes in a song, can become computer ____.
    7·1 answer
  • Which of the following is a real job title on The interactive media career pathway?
    6·2 answers
  • Question No. 5:
    7·1 answer
  • 6. A rental car agency classifies the vehicles it rents into four categories: compact, midsize, full-size, and sport utility. Th
    11·1 answer
  • What operating system are you using? On most computers, you can answer this question by right-clicking on the "My Computer" icon
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!