775 views
1 votes
1 votes
Suppose a source code has buffer overflow  vulnerabilities. Which of the following can cause buffer overflow  vulnerabilities

a. Scanf("%s",...)

b.  Strcpy(destination, source)

c. Send command use for network  connection

Options

1. Only a

2. b and c

3. a and b

4.all of the above

1 Answer

0 votes
0 votes

The correct answer is: A and B

Both scanf("%s", ...) and strcpy(destination, source) can cause buffer overflow vulnerabilities if not used carefully and securely. scanf can cause buffer overflow when used with %s without specifying a maximum width, and strcpy can cause buffer overflow when copying a source string that is longer than the destination buffer.

The "send command used for network connection" mentioned in option C can also potentially lead to buffer overflow vulnerabilities in network-related code if incoming data is not handled properly, but it is not always guaranteed to cause buffer overflows in every network communication scenario. Therefore, while C could potentially be a source of buffer overflow vulnerabilities, it's not as directly related as A and B.

Related questions

1 votes
1 votes
1 answer
1
0 votes
0 votes
1 answer
2
Suman Acharya asked Sep 14, 2017
621 views
In a mandatory access control, information from top secret object will not flow to secret and vice versaTrueFalse
0 votes
0 votes
1 answer
3
Suman Acharya asked Sep 14, 2017
275 views
Match the following a. Secrecy. 1. Limit the resource usage. b Integrity 2. Unauthorized modification c availbility. 3. Unau...
0 votes
0 votes
1 answer
4
Suman Acharya asked Sep 14, 2017
639 views
ASLR randomizesa. The size of all arrays, thereby by making it difficult to perform buffer overflowsb. All instructions in the programc. Positions of the stack, heap and...