8266168: -Wmaybe-uninitialized happens in check_code.c

Reviewed-by: stuefe
This commit is contained in:
Yasumasa Suenaga 2021-05-06 11:54:32 +00:00
parent a86ee9b3f3
commit 0f9852c63b

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -3821,7 +3821,7 @@ signature_to_fieldtype(context_type *context,
assert(finish >= p);
length = (int)(finish - p);
if (length + 1 > (int)sizeof(buffer_space)) {
buffer = malloc(length + 1);
buffer = calloc(length + 1, sizeof(char));
check_and_push(context, buffer, VM_MALLOC_BLK);
}
memcpy(buffer, p, length);