This is the defination of glColorPointer from opengl.org :
void glColorPointer(GLint size,GLenum type, GLsizei stride, const GLvoid * pointer); Parameters
size Specifies the number of components per color. Must be 3 or 4. The initial value is 4.
type Specifies the data type of each color component in the array. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, and GL_DOUBLE are accepted. The initial value is GL_FLOAT.
stride Specifies the byte offset between consecutive colors. If stride is 0, the colors are understood to be tightly packed in the array. The initial value is 0.
pointer Specifies a pointer to the first component of the first color element in the array. The initial value is 0.
In simple words, we can say that size and type parameters specify number of bytes of one color unit, and stride specifies the byte offset between consecutive color units.
But, how does this function know the total number of units ? As we all know, if an array is passed as a pointer to a function, it is impossible to get the size of array by using sizeof() inside the function. So how does glColorPointer know the size of the array, when the pointer parameter is only a GLvoid* pointer ?
glBufferData
is the maximum allowable size (yet again, it's perfectly possible to draw indices outside that range, likely crashing your app). – Damon