mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-16 22:39:29 +00:00
Enable FORTIFY and FORMAT SECURITY compile flags
1. Enable below 2 defenses in Makefile "-O2 -D_FORTIFY_SOURCE=2" "-Wformat -Wformat-security" 2. Update related source code impacted by above 2 flags Change-Id: Ib42214848f030b4cf508cd7c52a7e3cc809435d9 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
@@ -148,16 +148,20 @@ ttyread(struct ttyfd *tf)
|
||||
{
|
||||
unsigned char rb;
|
||||
|
||||
if (read(tf->fd, &rb, 1) == 1)
|
||||
if (read(tf->fd, &rb, 1) > 0)
|
||||
return rb;
|
||||
else
|
||||
return -1;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
ttywrite(struct ttyfd *tf, unsigned char wb)
|
||||
{
|
||||
(void)write(tf->fd, &wb, 1);
|
||||
|
||||
if (write(tf->fd, &wb, 1) > 0)
|
||||
return 1;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user