>>> + /* explicit length */ >>> + *labelPtr = (char *) malloc(length); >>> + if (*labelPtr) { >>> + memcpy(*labelPtr, label, length); >>> + } >>> + } >>> + else { >>> + /* null-terminated string */ >>> + int len = strlen(label); >>> + if (len >= MAX_LABEL_LENGTH) {
>>The reason MAX_LABEL_LENGTH exists is so that you can have a fixed-size >>array in your structure (so you don't have to malloc a buffer. Either >>make a fixed size buffer, or make MAX_LABEL_LENGTH be the maximum size >>representable in a GLsizei (and eliminate this check). >Ok makes sense. However the check is still valid its in the spec. We shouldn't >just truncate the string I know for sure that the AMD driver does the same >thing. I >have posted extensive tests for the objectlabel code on the piglit >list. Ignore my comment I see now you are talking about the malloc check I thought you meant the MAX_LABEL_LENGTH test in the last line. _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev