>>128
何がしたいのかよくわからんが、malloc()、realloc()の返り値くらい
チェックしたらどうだ?
あと、
> char str[409600];
> memset((char *)str,'a',409600);
> str[409600] = '\0';
str[]でアクセスできるのはstr[0]〜str[409600 - 1]だぞ。