88c41d
Index: acpica-unix2-20180209/source/compiler/aslanalyze.c
88c41d
===================================================================
88c41d
--- acpica-unix2-20180209.orig/source/compiler/aslanalyze.c
88c41d
+++ acpica-unix2-20180209/source/compiler/aslanalyze.c
88c41d
@@ -355,11 +355,16 @@ AnCheckMethodReturnValue (
88c41d
          */
88c41d
         if (ThisNodeBtype != 0)
88c41d
         {
88c41d
-            sprintf (MsgBuffer,
88c41d
+	     int cnt;
88c41d
+	     char *strp;
88c41d
+
88c41d
+            cnt = asprintf (&strp,
88c41d
                 "Method returns [%s], %s operator requires [%s]",
88c41d
                 StringBuffer, OpInfo->Name, StringBuffer2);
88c41d
 
88c41d
-            AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, MsgBuffer);
88c41d
+            AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, strp);
88c41d
+	     if (cnt > 0)
88c41d
+	         free(strp);
88c41d
         }
88c41d
     }
88c41d
 }
88c41d
Index: acpica-unix2-20180209/source/compiler/aslpredef.c
88c41d
===================================================================
88c41d
--- acpica-unix2-20180209.orig/source/compiler/aslpredef.c
88c41d
+++ acpica-unix2-20180209/source/compiler/aslpredef.c
88c41d
@@ -159,14 +159,19 @@ ApCheckForPredefinedMethod (
88c41d
         if (MethodInfo->NumReturnNoValue &&
88c41d
             ThisName->Info.ExpectedBtypes)
88c41d
         {
88c41d
+	     int cnt;
88c41d
+	     char *strp;
88c41d
+
88c41d
             AcpiUtGetExpectedReturnTypes (StringBuffer,
88c41d
                 ThisName->Info.ExpectedBtypes);
88c41d
 
88c41d
-            sprintf (MsgBuffer, "%s required for %4.4s",
88c41d
-                StringBuffer, ThisName->Info.Name);
88c41d
+            cnt = asprintf (&strp, "%s required for %4.4s",
88c41d
+	        StringBuffer, ThisName->Info.Name);
88c41d
 
88c41d
             AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op,
88c41d
-                MsgBuffer);
88c41d
+                strp);
88c41d
+	     if (cnt > 0)
88c41d
+	        free(strp);
88c41d
         }
88c41d
         break;
88c41d
     }
88c41d
@@ -698,18 +703,26 @@ TypeErrorExit:
88c41d
 
88c41d
     AcpiUtGetExpectedReturnTypes (StringBuffer, ExpectedBtypes);
88c41d
 
88c41d
-    if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
88c41d
-    {
88c41d
-        sprintf (MsgBuffer, "%4.4s: found %s, %s required",
88c41d
-            PredefinedName, TypeName, StringBuffer);
88c41d
-    }
88c41d
-    else
88c41d
     {
88c41d
-        sprintf (MsgBuffer, "%4.4s: found %s at index %u, %s required",
88c41d
-            PredefinedName, TypeName, PackageIndex, StringBuffer);
88c41d
+        int cnt;
88c41d
+	char *strp;
88c41d
+
88c41d
+        if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
88c41d
+        {
88c41d
+            cnt = asprintf (&strp, "%4.4s: found %s, %s required",
88c41d
+                PredefinedName, TypeName, StringBuffer);
88c41d
+        }
88c41d
+        else
88c41d
+        {
88c41d
+            cnt = asprintf (&strp, "%4.4s: found %s at index %u, %s required",
88c41d
+                PredefinedName, TypeName, PackageIndex, StringBuffer);
88c41d
+        }
88c41d
+
88c41d
+        AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, strp);
88c41d
+	if (cnt > 0)
88c41d
+	    free(strp);
88c41d
     }
88c41d
 
88c41d
-    AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, MsgBuffer);
88c41d
     return (AE_TYPE);
88c41d
 }
88c41d
 
88c41d
Index: acpica-unix2-20180209/source/compiler/aslwalks.c
88c41d
===================================================================
88c41d
--- acpica-unix2-20180209.orig/source/compiler/aslwalks.c
88c41d
+++ acpica-unix2-20180209/source/compiler/aslwalks.c
88c41d
@@ -507,15 +507,19 @@ AnOperandTypecheckWalkEnd (
88c41d
             else if (!CommonBtypes)
88c41d
             {
88c41d
                 /* No match -- this is a type mismatch error */
88c41d
+		int cnt;
88c41d
+		char *strp;
88c41d
 
88c41d
                 AnFormatBtype (StringBuffer, ThisNodeBtype);
88c41d
                 AnFormatBtype (StringBuffer2, RequiredBtypes);
88c41d
 
88c41d
-                sprintf (MsgBuffer, "[%s] found, %s operator requires [%s]",
88c41d
+                cnt = asprintf (&strp, "[%s] found, %s operator requires [%s]",
88c41d
                     StringBuffer, OpInfo->Name, StringBuffer2);
88c41d
 
88c41d
                 AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE,
88c41d
-                    ArgOp, MsgBuffer);
88c41d
+                    ArgOp, strp);
88c41d
+		if (cnt > 0)
88c41d
+		    free(strp);
88c41d
             }
88c41d
 
88c41d
         NextArgument: