}
*res = OPENSSL_malloc(sizeof(uint64_t));
+ if (*res == NULL) {
+ r = 0;
+ goto end;
+ }
**res = (uint64_t)**buf;
*buf += sizeof(uint64_t);
}
*res = OPENSSL_malloc(sizeof(int64_t));
+ if (*res == NULL) {
+ r = 0;
+ goto end;
+ }
**res = (int64_t)**buf;
*buf += sizeof(int64_t);
}
*res = OPENSSL_malloc(sizeof(double));
+ if (*res == NULL) {
+ r = 0;
+ goto end;
+ }
**res = (double)**buf;
*buf += sizeof(double);
p_num++;
fuzzed_parameters = OPENSSL_calloc(p_num + 1, sizeof(OSSL_PARAM));
+ if (fuzzed_parameters == NULL)
+ return NULL;
p = fuzzed_parameters;
for (; param != NULL && param->key != NULL; param++) {
if (!read_int(buf, len, &use_param)) {
use_param = OPENSSL_malloc(sizeof(uint64_t));
+ if (use_param == NULL) {
+ OPENSSL_free(fuzzed_parameters);
+ return NULL;
+ }
*use_param = 0;
}
case OSSL_PARAM_INTEGER:
if (strcmp(param->key, OSSL_KDF_PARAM_ITER) == 0) {
p_value_int = OPENSSL_malloc(sizeof(ITERS));
+ if (p_value_int == NULL) {
+ OPENSSL_free(fuzzed_parameters);
+ OPENSSL_free(use_param);
+ return NULL;
+ }
*p_value_int = ITERS;
} else if (strcmp(param->key, OSSL_KDF_PARAM_SCRYPT_N) == 0) {
p_value_int = OPENSSL_malloc(sizeof(ITERS));
+ if (p_value_int == NULL) {
+ OPENSSL_free(fuzzed_parameters);
+ OPENSSL_free(use_param);
+ return NULL;
+ }
*p_value_int = ITERS;
} else if (strcmp(param->key, OSSL_KDF_PARAM_SCRYPT_R) == 0) {
p_value_int = OPENSSL_malloc(sizeof(BLOCKSIZE));
+ if (p_value_int == NULL) {
+ OPENSSL_free(fuzzed_parameters);
+ OPENSSL_free(use_param);
+ return NULL;
+ }
*p_value_int = BLOCKSIZE;
} else if (strcmp(param->key, OSSL_KDF_PARAM_SCRYPT_P) == 0) {
p_value_int = OPENSSL_malloc(sizeof(BLOCKSIZE));
+ if (p_value_int == NULL) {
+ OPENSSL_free(fuzzed_parameters);
+ OPENSSL_free(use_param);
+ return NULL;
+ }
*p_value_int = BLOCKSIZE;
} else if (!*use_param || !read_int(buf, len, &p_value_int)) {
p_value_int = OPENSSL_malloc(sizeof(int64_t));
+ if (p_value_int == NULL) {
+ OPENSSL_free(fuzzed_parameters);
+ OPENSSL_free(use_param);
+ return NULL;
+ }
*p_value_int = 0;
}
case OSSL_PARAM_UNSIGNED_INTEGER:
if (strcmp(param->key, OSSL_KDF_PARAM_ITER) == 0) {
p_value_uint = OPENSSL_malloc(sizeof(UITERS));
+ if (p_value_uint == NULL) {
+ OPENSSL_free(fuzzed_parameters);
+ OPENSSL_free(use_param);
+ return NULL;
+ }
*p_value_uint = UITERS;
} else if (strcmp(param->key, OSSL_KDF_PARAM_SCRYPT_N) == 0) {
p_value_uint = OPENSSL_malloc(sizeof(UITERS));
+ if (p_value_uint == NULL) {
+ OPENSSL_free(fuzzed_parameters);
+ OPENSSL_free(use_param);
+ return NULL;
+ }
*p_value_uint = UITERS;
} else if (strcmp(param->key, OSSL_KDF_PARAM_SCRYPT_R) == 0) {
p_value_uint = OPENSSL_malloc(sizeof(UBLOCKSIZE));
+ if (p_value_uint == NULL) {
+ OPENSSL_free(fuzzed_parameters);
+ OPENSSL_free(use_param);
+ return NULL;
+ }
*p_value_uint = UBLOCKSIZE;
} else if (strcmp(param->key, OSSL_KDF_PARAM_SCRYPT_P) == 0) {
p_value_uint = OPENSSL_malloc(sizeof(UBLOCKSIZE));
+ if (p_value_uint == NULL) {
+ OPENSSL_free(fuzzed_parameters);
+ OPENSSL_free(use_param);
+ return NULL;
+ }
*p_value_uint = UBLOCKSIZE;
} else if (!*use_param || !read_uint(buf, len, &p_value_uint)) {
p_value_uint = OPENSSL_malloc(sizeof(uint64_t));
+ if (p_value_uint == NULL) {
+ OPENSSL_free(fuzzed_parameters);
+ OPENSSL_free(use_param);
+ return NULL;
+ }
*p_value_uint = 0;
}
case OSSL_PARAM_REAL:
if (!*use_param || !read_double(buf, len, &p_value_double)) {
p_value_double = OPENSSL_malloc(sizeof(double));
+ if (p_value_double == NULL) {
+ OPENSSL_free(fuzzed_parameters);
+ OPENSSL_free(use_param);
+ return NULL;
+ }
*p_value_double = 0;
}