format string 0¶
In serve_patrick()
, the options are: {"Breakf@st_Burger", "Gr%114d_Cheese", "Bac0n_D3luxe"}
int count = printf(choice1);
if (count > 2 * BUFSIZE)
serve_bob();
We have to get count > 64; the option "Gr%114d_Cheese" works as %114d represents 114-digit integer
In serve_bob()
, the options are: {"Pe%to_Portobello", "$outhwest_Burger", "Cla%sic_Che%s%steak"}
We need to get a SIGSEGV (seg fault); the option "Cla%sic_Che%s%steak" works as %s expects a string which is not provided