There is a check for the "no uniforms" case right above?

Yes right, there is indeed a check for the "no uniform" case, so it should work okay on a non-buggy driver.
 

Are you saying the Intel drivers claims that there are more than 0
uniforms, but that none of them have a name? That's gotta be against
the spec.
Yes.

IOW, the maxlen check is never reached if the shader has no uniforms.
Right.