If system has function foo below (in some lib) , what will be a problem under QNX when some program calls this function, I am getting stack overflow error..what is issue in this code..

Int foo(int a1, int a2)

{

int buf[9768];

int error = 0;

//

buf[365]  = a1;

buf[7194] = a2;

//
...doing something….
//

return error;

}
Please help me to understand in QNX context . Thanks in advance.