mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-16 06:19:24 +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:
@@ -248,11 +248,24 @@ pirq_dsdt(void)
|
||||
for (irq = 0; irq < nitems(irq_counts); irq++) {
|
||||
if (!IRQ_PERMITTED(irq))
|
||||
continue;
|
||||
if (irq_prs == NULL)
|
||||
asprintf(&irq_prs, "%d", irq);
|
||||
else {
|
||||
if (irq_prs == NULL) {
|
||||
if (asprintf(&irq_prs, "%d", irq) < 0) {
|
||||
/*error*/
|
||||
if (irq_prs != NULL)
|
||||
free(irq_prs);
|
||||
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
old = irq_prs;
|
||||
asprintf(&irq_prs, "%s,%d", old, irq);
|
||||
if (asprintf(&irq_prs, "%s,%d", old, irq) < 0) {
|
||||
/*error*/
|
||||
if (irq_prs != NULL)
|
||||
free(irq_prs);
|
||||
|
||||
free(old);
|
||||
return;
|
||||
}
|
||||
free(old);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user