summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/common/adfile.c9
-rw-r--r--source/common/adisasm.c15
2 files changed, 19 insertions, 5 deletions
diff --git a/source/common/adfile.c b/source/common/adfile.c
index 43532b7e7..342610722 100644
--- a/source/common/adfile.c
+++ b/source/common/adfile.c
@@ -275,11 +275,16 @@ FlGenerateFilename (
/*
- * Copy the original filename to a new buffer. Leave room for the worst case
- * where we append the suffix, an added dot and the null terminator.
+ * Copy the original filename to a new buffer. Leave room for the worst
+ * case where we append the suffix, an added dot and the null terminator.
*/
NewFilename = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE)
strlen (InputFilename) + strlen (Suffix) + 2);
+ if (!NewFilename)
+ {
+ return (NULL);
+ }
+
strcpy (NewFilename, InputFilename);
/* Try to find the last dot in the filename */
diff --git a/source/common/adisasm.c b/source/common/adisasm.c
index 9288ddb3d..0a69ea274 100644
--- a/source/common/adisasm.c
+++ b/source/common/adisasm.c
@@ -417,7 +417,7 @@ AdAmlDisassemble (
/* Create/Open a disassembly output file */
DisasmFilename = FlGenerateFilename (Prefix, FILE_SUFFIX_DISASSEMBLY);
- if (!OutFilename)
+ if (!DisasmFilename)
{
fprintf (stderr, "Could not generate output filename\n");
Status = AE_ERROR;
@@ -714,8 +714,17 @@ AdCreateTableHeader (
else
{
NewFilename = ACPI_ALLOCATE_ZEROED (9);
- strncat (NewFilename, Table->Signature, 4);
- strcat (NewFilename, ".aml");
+ if (NewFilename)
+ {
+ strncat (NewFilename, Table->Signature, 4);
+ strcat (NewFilename, ".aml");
+ }
+ }
+
+ if (!NewFilename)
+ {
+ AcpiOsPrintf (" **** Could not generate AML output filename\n");
+ return;
}
/* Open the ASL definition block */