mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-05-05 14:09:41 +00:00
Fix a -Warray-bounds gcc warning in OPENSSL_DIR_read
'__builtin_strncpy' offset [275, 4095] from the object at 'direntry' is out of the bounds of referenced subobject 'd_name' with type 'char[256]' at offset 19 Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10343)
This commit is contained in:
parent
d1c1fb2d41
commit
db5cf86535
@ -131,9 +131,8 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy((*ctx)->entry_name, direntry->d_name,
|
OPENSSL_strlcpy((*ctx)->entry_name, direntry->d_name,
|
||||||
sizeof((*ctx)->entry_name) - 1);
|
sizeof((*ctx)->entry_name));
|
||||||
(*ctx)->entry_name[sizeof((*ctx)->entry_name) - 1] = '\0';
|
|
||||||
#ifdef __VMS
|
#ifdef __VMS
|
||||||
if ((*ctx)->expect_file_generations) {
|
if ((*ctx)->expect_file_generations) {
|
||||||
char *p = (*ctx)->entry_name + strlen((*ctx)->entry_name);
|
char *p = (*ctx)->entry_name + strlen((*ctx)->entry_name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user