Thanks guys for t input.
Well n1, i was thinking on similar lines. Taking it a step further, since j was allocated 15 bytes, even if i input a buffer of say 20 (basically > 15), the program does not halt.
Now assuming tht k points to some location at/around space allocated for j, why does the above condition not cause an overflow and then cause a SEGV?
Shouldnt SEGV occur when my program accesses
any memory outside its allocated space? (let alone valid/invalid addessses)
Also, i noticed tht prior to an sprintf on 'k', its value was once that of stdout, and once of the string in sprintf. So maybe these are treated as valid addresses and within program bounds?
BTW, i came up with the above scenario accidently when experimenting something. Also, i know for sure what i am doing is illegal, but perplexes me when it works!

