_crypt_extended_init_r();
crypt_res = _crypt_extended_r(password, salt, &buffer);
- if (!crypt_res) {
+ if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
- return FAILURE;
+ return NULL;
} else {
- *result = estrdup(crypt_res);
- return SUCCESS;
+ result = zend_string_init(crypt_res, strlen(crypt_res), 0);
+ return result;
}
}
}
# error Data struct used by crypt_r() is unknown. Please report.
# endif
crypt_res = crypt_r(password, salt, &buffer);
- if (!crypt_res) {
- return FAILURE;
+ if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
- return FAILURE;
++ return NULL;
} else {
- *result = estrdup(crypt_res);
- return SUCCESS;
+ result = zend_string_init(crypt_res, strlen(crypt_res), 0);
+ return result;
}
}
# endif