Messages in this thread | | | From | (David Wagner) | Subject | Re: [PATCH 3/4] security/selinux: decrement sizeof size in strncmp | Date | Thu, 12 Nov 2009 18:28:03 +0000 (UTC) |
| |
Casey Schaufler wrote: > I strongly suggest that this is not what is wanted. > strcmp(x,y) > and > strncmp(x,y,sizeof(y)) > > are functionally equivalent and strcmp has a bad reputation in > the security community because it is associated with potential > buffer overrun issues.
It does? Hmm, I don't recall hearing of this bad reputation for strcmp(). Is there a justification for why such a reputation would be deserved? We're not talking strcpy() here. strcmp() is fine as long as its arguments are properly '\0'-terminated; given that, it doesn't introduce any new buffer overrun risks.
| |