I was in an interview a few days ago and i got the following demand:
write a library function to find the MIN element of an array. MAKE IT AS SECURE AS POSSIBLE. alright, so it was obvious that the accent there was on the security. The language is C, the company is in the embedded field. I later asked the interviewer if they can at least explain to me what is the case here because I was truly curious to learn, but he wasn't very talkative... So, I turned google upside down, but I did not find specifically a solution to this request. I am fairly new to C. What are the security flaws that can occur here? What are the red flags? I know that we should watch for array boundaries because overflowing it will cause memory issues and we could easily write/read from random memory. But aside of that, what should i look for? Any feedback would be extremely useful! Thanks a bunch!