If you have to find whether there is a NULL.

You could do soemthing like the following..

char buffer[1000000] = {'\0'};
....
bool detected = strlen(buffer) < 1000000;
I think that initialization is not a costly affair.