| Summary: | crypt(3) does not fail for invalid salts | ||
|---|---|---|---|
| Product: | uClibc | Reporter: | Nikos Mavrogiannopoulos <nmav> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | uclibc-cvs |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: | Reproducer | ||
|
Description
Nikos Mavrogiannopoulos
2015-01-19 13:40:45 UTC
So what do you suggest?
if (salt[0] == '$' && salt[2] == '$') {
[handle 1, 5, 6]
else {
__set_errno(EINVAL);
return NULL;
}
}
return __des_crypt(ukey, usalt);
}
?
I think your snippet is correct. Returning NULL when having the '$' would solve that issue. 78b154a95b507c205241dd883396952e0dfbede7 thanks, |