Just a small warning: If anyone writes something like
int len = min(user_request_len, sizeof(buffer));
if (user_request_len > len)
goto fail;
memcpy(dst, user_src, len);
they can get into trouble even with your min() macro.
Ok, maybe this is crazy code that noone in their right
mind would ever write.
This is not intended as a criticism -- your approach may be
sufficient for existing code -- but it is something to watch
out for.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/