Bug 17929 - Array of length 0 in struct file_handle
Summary: Array of length 0 in struct file_handle
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-05 00:07 UTC by Dwight Guth
Modified: 2015-02-06 09:19 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dwight Guth 2015-02-05 00:07:25 UTC
in sysdeps/unix/sysv/linux/bits/fcntl-linux.h, struct file_handle is defined with an array member f_handle of length 0. This is a constraint violation according to the C11 standard, section 6.7.6.2, paragraph 1, which declares that if an array is declared with an integer constant expression as a size, it shall have a value greater than 0.

I suspect what was actually meant here is for f_handle to have an incomplete array type, which would declare f_handle as a flexible array member of the struct.