What did you expect to happen here?
If you setup the pointer relative to the terrain, then it is going to draw the terrain. glBindBuffer(GL_ARRAY_BUFFER, g_cubeVBO);
does nothing in this code.
However, assuming this is your only drawing code, then if you remove glBindBuffer(GL_ARRAY_BUFFER, g_terrainVBO);
, the next time you draw it is going to use g_cubeVBO
(since the pointer uses whatever is bound to GL_ARRAY_BUFFER
at the time it is called).
Rendering the terrain using the indices from the cube does not make much sense either.
Add this after you bind your cube VBO to restore some sanity to the world:
glVertexAttribPointer (0, 3, GL_FLOAT, GL_FALSE, 0, 0);