Consider the following C code:
int a[4] = {1, 2, 3, 4};
int *b[4] = {NULL, NULL, NULL, NULL};
int **pp1 = &b[1];
pp1[0] = &a[1];
int *pp2 = b[1];
*pp1[0] = 2;
After the above statements, which of the following are likely to access out of bounds memory? Select all that apply.
Consider the following Makefile:
all: a b c d
a: e f g
buildA
b: e d
buildB
c: e g
buildC
d: a c
buildD
(assume there are tab characters before the buildX lines).
Which of the following are true? Select all that apply.
Consider the following files and their chmod-style permissions:
a.out: u=rwx,g=rx,o=
a.h: u=rw,g=r,o=r
a.c: u=rw,g=,o=
The owner of these files wants to allow somebody in their group to view and modify a.c and a.h and not give others any access. Which, if any, of the following command(s) should they run? Do not include commands which will have no effect or which will allow for more access than they want. Select all that apply.
Suppose the owner of a.out wants to make it runnable by any user and make it run
with its effective user ID set to the owner's user ID. Which command(s), if any, would achieve this? Select all that apply.
Consider a program that counts the number of lines of text the files in the current directory have. The program works by:
Based on the operations above, if this program were run on a directory with 1 file, we would expect system calls to be made for which (if any) of the steps above? Select all that apply.