Description
AddressSanitizer: heap-buffer-overflow on: math/prime_factoriziation.c:132
int_fact() {
int *range = (int *)malloc(sizeof(int) * len);
assert(range);
Range pstr = (Range)malloc(sizeof(range)); // sizeof(range) "type range" is same with variable "int *range"
assert(pstr);
}
Expected behavior
works normally, No error.
Actual behavior
ABORTING
Possible fix
Range pstr = (Range)malloc(sizeof(struct data)); // This modification works normally
or
Range pstr = (Range)malloc(sizeof(*pstr)); // This modification works normally too
Steps to reproduce
None
Context
None
Additional information
No response
Description
AddressSanitizer: heap-buffer-overflow on: math/prime_factoriziation.c:132
Expected behavior
works normally, No error.
Actual behavior
ABORTING
Possible fix
or
Steps to reproduce
None
Context
None
Additional information
No response