You cause undefined behavior when accessing the index outside the limits -
for(i = 0; i < 10; i++)
array[i] = i;
You will not receive any warnings or errors about this, but it is confirmed in the standards that it is UB .
And in this case, the conclusion can be any.
And for this line -
int * array = malloc((sizeof(int)) * 0);
C Standard says -
, : , , , .
NULL pointer. , .