c - Disadvantages of scanf - Stack Overflow
Yes, you are right. There is a major security flaw in scanf family(scanf,sscanf, fscanf..etc) esp when reading a string, because they don't take the length of the buffer (into which they are reading) into account. Example: char buf[3]; sscanf("abcdef","%s...