mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-11 16:15:56 -04:00
Merge pull request #8620 from davidhorstmann-arm/fix-selftest-doublefree-2.28
[Backport 2.28] Fix potential double-free in calloc selftest
This commit is contained in:
commit
0dc3ed029a
@ -83,6 +83,7 @@ static int calloc_self_test(int verbose)
|
|||||||
if (verbose) {
|
if (verbose) {
|
||||||
mbedtls_printf(" CALLOC(0,1): passed (same non-null)\n");
|
mbedtls_printf(" CALLOC(0,1): passed (same non-null)\n");
|
||||||
}
|
}
|
||||||
|
empty2 = NULL;
|
||||||
} else {
|
} else {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
mbedtls_printf(" CALLOC(0,1): passed (distinct non-null)\n");
|
mbedtls_printf(" CALLOC(0,1): passed (distinct non-null)\n");
|
||||||
@ -107,6 +108,7 @@ static int calloc_self_test(int verbose)
|
|||||||
if (verbose) {
|
if (verbose) {
|
||||||
mbedtls_printf(" CALLOC(1,0): passed (same non-null)\n");
|
mbedtls_printf(" CALLOC(1,0): passed (same non-null)\n");
|
||||||
}
|
}
|
||||||
|
empty2 = NULL;
|
||||||
} else {
|
} else {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
mbedtls_printf(" CALLOC(1,0): passed (distinct non-null)\n");
|
mbedtls_printf(" CALLOC(1,0): passed (distinct non-null)\n");
|
||||||
@ -123,6 +125,7 @@ static int calloc_self_test(int verbose)
|
|||||||
mbedtls_printf(" CALLOC(1): failed (same buffer twice)\n");
|
mbedtls_printf(" CALLOC(1): failed (same buffer twice)\n");
|
||||||
}
|
}
|
||||||
++failures;
|
++failures;
|
||||||
|
buffer2 = NULL;
|
||||||
} else {
|
} else {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
mbedtls_printf(" CALLOC(1): passed\n");
|
mbedtls_printf(" CALLOC(1): passed\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user