diff --git a/sys/external/bsd/acpica/dist/compiler/aslanalyze.c b/sys/external/bsd/acpica/dist/compiler/aslanalyze.c index a80c90dafb99..d248f8eec28e 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslanalyze.c +++ b/sys/external/bsd/acpica/dist/compiler/aslanalyze.c @@ -341,7 +341,7 @@ AnCheckMethodReturnValue ( */ if (ThisNodeBtype != 0) { - sprintf (MsgBuffer, + snprintf (MsgBuffer, sizeof(MsgBuffer), "Method returns [%s], %s operator requires [%s]", StringBuffer, OpInfo->Name, StringBuffer2); diff --git a/sys/external/bsd/acpica/dist/compiler/aslcompiler.l b/sys/external/bsd/acpica/dist/compiler/aslcompiler.l index 3d5488d39e62..d3fe4c00487a 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslcompiler.l +++ b/sys/external/bsd/acpica/dist/compiler/aslcompiler.l @@ -633,7 +633,7 @@ NamePathTail [.]{NameSeg} AslCompilererror ("Parse error, expecting ASL keyword or name");} . { count (1); - sprintf (MsgBuffer, + snprintf (MsgBuffer, sizeof(MsgBuffer), "Invalid character (0x%2.2X), expecting ASL keyword or name", *AslCompilertext); AslCompilererror (MsgBuffer);} diff --git a/sys/external/bsd/acpica/dist/compiler/aslerror.c b/sys/external/bsd/acpica/dist/compiler/aslerror.c index 87651ecc6c8e..b48a96047d60 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslerror.c +++ b/sys/external/bsd/acpica/dist/compiler/aslerror.c @@ -862,7 +862,7 @@ AslCoreSubsystemError ( BOOLEAN Abort) { - sprintf (MsgBuffer, "%s %s", AcpiFormatException (Status), ExtraMessage); + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s %s", AcpiFormatException (Status), ExtraMessage); if (Op) { diff --git a/sys/external/bsd/acpica/dist/compiler/aslfileio.c b/sys/external/bsd/acpica/dist/compiler/aslfileio.c index a480dfdfb846..29c170a1da93 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslfileio.c +++ b/sys/external/bsd/acpica/dist/compiler/aslfileio.c @@ -97,7 +97,7 @@ FlFileError ( UINT8 ErrorId) { - sprintf (MsgBuffer, "\"%s\" (%s)", Gbl_Files[FileId].Filename, + snprintf (MsgBuffer, sizeof(MsgBuffer), "\"%s\" (%s)", Gbl_Files[FileId].Filename, strerror (errno)); AslCommonError (ASL_ERROR, ErrorId, 0, 0, 0, 0, NULL, MsgBuffer); } diff --git a/sys/external/bsd/acpica/dist/compiler/aslfiles.c b/sys/external/bsd/acpica/dist/compiler/aslfiles.c index 43136e9147de..b71fbead6a38 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslfiles.c +++ b/sys/external/bsd/acpica/dist/compiler/aslfiles.c @@ -416,7 +416,7 @@ FlOpenIncludeFile ( /* We could not open the include file after trying very hard */ ErrorExit: - sprintf (MsgBuffer, "%s, %s", Op->Asl.Value.String, strerror (errno)); + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s, %s", Op->Asl.Value.String, strerror (errno)); AslError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, Op, MsgBuffer); } diff --git a/sys/external/bsd/acpica/dist/compiler/aslload.c b/sys/external/bsd/acpica/dist/compiler/aslload.c index 9a768d81619f..ebc022ce2087 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslload.c +++ b/sys/external/bsd/acpica/dist/compiler/aslload.c @@ -536,7 +536,7 @@ LdNamespace1Begin ( * Which is used to workaround the fact that the MS interpreter * does not allow Scope() forward references. */ - sprintf (MsgBuffer, "%s [%s], changing type to [Scope]", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s [%s], changing type to [Scope]", Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type)); AslError (ASL_REMARK, ASL_MSG_SCOPE_TYPE, Op, MsgBuffer); @@ -555,7 +555,7 @@ LdNamespace1Begin ( /* All other types are an error */ - sprintf (MsgBuffer, "%s [%s]", Op->Asl.ExternalName, + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s [%s]", Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type)); AslError (ASL_ERROR, ASL_MSG_SCOPE_TYPE, Op, MsgBuffer); diff --git a/sys/external/bsd/acpica/dist/compiler/asllookup.c b/sys/external/bsd/acpica/dist/compiler/asllookup.c index 0f226647b250..2a2b71a9dfbc 100644 --- a/sys/external/bsd/acpica/dist/compiler/asllookup.c +++ b/sys/external/bsd/acpica/dist/compiler/asllookup.c @@ -163,7 +163,7 @@ LkIsObjectUsed ( * Issue a remark even if it is a reserved name (starts * with an underscore). */ - sprintf (MsgBuffer, "Name is within method [%4.4s]", + snprintf (MsgBuffer, sizeof(MsgBuffer), "Name is within method [%4.4s]", Next->Name.Ascii); AslError (ASL_REMARK, ASL_MSG_NOT_REFERENCED, LkGetNameOp (Node->Op), MsgBuffer); diff --git a/sys/external/bsd/acpica/dist/compiler/aslpredef.c b/sys/external/bsd/acpica/dist/compiler/aslpredef.c index 60b5269587b4..b622d488b3ff 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslpredef.c +++ b/sys/external/bsd/acpica/dist/compiler/aslpredef.c @@ -114,7 +114,7 @@ ApCheckForPredefinedMethod ( if (MethodInfo->NumArguments != 0) { - sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0); + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s requires %u", Op->Asl.ExternalName, 0); AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, MsgBuffer); @@ -136,7 +136,7 @@ ApCheckForPredefinedMethod ( if (MethodInfo->NumArguments != RequiredArgCount) { - sprintf (MsgBuffer, "%4.4s requires %u", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%4.4s requires %u", ThisName->Info.Name, RequiredArgCount); if (MethodInfo->NumArguments < RequiredArgCount) @@ -162,7 +162,7 @@ ApCheckForPredefinedMethod ( AcpiUtGetExpectedReturnTypes (StringBuffer, ThisName->Info.ExpectedBtypes); - sprintf (MsgBuffer, "%s required for %4.4s", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s required for %4.4s", StringBuffer, ThisName->Info.Name); AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op, @@ -693,12 +693,12 @@ TypeErrorExit: if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT) { - sprintf (MsgBuffer, "%4.4s: found %s, %s required", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%4.4s: found %s, %s required", PredefinedName, TypeName, StringBuffer); } else { - sprintf (MsgBuffer, "%4.4s: found %s at index %u, %s required", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%4.4s: found %s at index %u, %s required", PredefinedName, TypeName, PackageIndex, StringBuffer); } diff --git a/sys/external/bsd/acpica/dist/compiler/aslprepkg.c b/sys/external/bsd/acpica/dist/compiler/aslprepkg.c index d32b1f24bd07..79e9479f1bf6 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslprepkg.c +++ b/sys/external/bsd/acpica/dist/compiler/aslprepkg.c @@ -617,7 +617,7 @@ ApPackageTooSmall ( UINT32 ExpectedCount) { - sprintf (MsgBuffer, "%s: length %u, required minimum is %u", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s: length %u, required minimum is %u", PredefinedName, Count, ExpectedCount); AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, MsgBuffer); @@ -646,7 +646,7 @@ ApZeroLengthPackage ( ACPI_PARSE_OBJECT *Op) { - sprintf (MsgBuffer, "%s: length is zero", PredefinedName); + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s: length is zero", PredefinedName); AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, MsgBuffer); } @@ -675,7 +675,7 @@ ApPackageTooLarge ( UINT32 ExpectedCount) { - sprintf (MsgBuffer, "%s: length is %u, only %u required", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s: length is %u, only %u required", PredefinedName, Count, ExpectedCount); AslError (ASL_REMARK, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, MsgBuffer); diff --git a/sys/external/bsd/acpica/dist/compiler/aslsupport.l b/sys/external/bsd/acpica/dist/compiler/aslsupport.l index e7d2b1fac893..409b1ec5d64a 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslsupport.l +++ b/sys/external/bsd/acpica/dist/compiler/aslsupport.l @@ -349,7 +349,7 @@ AslInsertLineBuffer ( * Warning if we have split a long source line. * */ - sprintf (MsgBuffer, "Max %u", Gbl_LineBufferSize); + snprintf (MsgBuffer, sizeof(MsgBuffer), "Max %u", Gbl_LineBufferSize); AslCommonError (ASL_WARNING, ASL_MSG_LONG_LINE, Gbl_CurrentLineNumber, Gbl_LogicalLineNumber, Gbl_CurrentLineOffset, Gbl_CurrentColumn, diff --git a/sys/external/bsd/acpica/dist/compiler/aslutils.c b/sys/external/bsd/acpica/dist/compiler/aslutils.c index e9dcfacc3be3..189e0a80c635 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslutils.c +++ b/sys/external/bsd/acpica/dist/compiler/aslutils.c @@ -572,7 +572,7 @@ UtCheckIntegerRange ( if ((Op->Asl.Value.Integer < LowValue) || (Op->Asl.Value.Integer > HighValue)) { - sprintf (MsgBuffer, "0x%X, allowable: 0x%X-0x%X", + snprintf (MsgBuffer, sizeof(MsgBuffer), "0x%X, allowable: 0x%X-0x%X", (UINT32) Op->Asl.Value.Integer, LowValue, HighValue); AslError (ASL_ERROR, ASL_MSG_RANGE, Op, MsgBuffer); @@ -909,7 +909,7 @@ UtDoConstant ( Status = UtStrtoul64 (String, 0, &Converted); if (ACPI_FAILURE (Status)) { - sprintf (ErrBuf, "%s %s\n", "Conversion error:", + snprintf (ErrBuf, sizeof(ErrBuf), "%s %s\n", "Conversion error:", AcpiFormatException (Status)); AslCompilererror (ErrBuf); } diff --git a/sys/external/bsd/acpica/dist/compiler/aslwalks.c b/sys/external/bsd/acpica/dist/compiler/aslwalks.c index 5abda235f4fa..047293e72a35 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslwalks.c +++ b/sys/external/bsd/acpica/dist/compiler/aslwalks.c @@ -427,7 +427,7 @@ AnOperandTypecheckWalkEnd ( AnFormatBtype (StringBuffer, ThisNodeBtype); AnFormatBtype (StringBuffer2, RequiredBtypes); - sprintf (MsgBuffer, "[%s] found, %s operator requires [%s]", + snprintf (MsgBuffer, sizeof(MsgBuffer), "[%s] found, %s operator requires [%s]", StringBuffer, OpInfo->Name, StringBuffer2); AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, MsgBuffer); diff --git a/sys/external/bsd/acpica/dist/compiler/aslxref.c b/sys/external/bsd/acpica/dist/compiler/aslxref.c index 363bb9cf2850..349c8f92b634 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslxref.c +++ b/sys/external/bsd/acpica/dist/compiler/aslxref.c @@ -580,7 +580,7 @@ XfNamespaceLocateBegin ( if (Message) { - sprintf (MsgBuffer, "Size mismatch, Tag: %u bit%s, Field: %u bit%s", + snprintf (MsgBuffer, sizeof(MsgBuffer), "Size mismatch, Tag: %u bit%s, Field: %u bit%s", TagBitLength, (TagBitLength > 1) ? "s" : "", FieldBitLength, (FieldBitLength > 1) ? "s" : ""); @@ -646,7 +646,7 @@ XfNamespaceLocateBegin ( */ if (Node->Type != ACPI_TYPE_METHOD) { - sprintf (MsgBuffer, "%s is a %s", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s is a %s", Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type)); AslError (ASL_ERROR, ASL_MSG_NOT_METHOD, Op, MsgBuffer); @@ -686,7 +686,7 @@ XfNamespaceLocateBegin ( */ if (PassedArgs != Node->Value) { - sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName, + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s requires %u", Op->Asl.ExternalName, Node->Value); if (PassedArgs < Node->Value) diff --git a/sys/external/bsd/acpica/dist/compiler/dtcompile.c b/sys/external/bsd/acpica/dist/compiler/dtcompile.c index 41e0fc4ad042..33cfa5f308ad 100644 --- a/sys/external/bsd/acpica/dist/compiler/dtcompile.c +++ b/sys/external/bsd/acpica/dist/compiler/dtcompile.c @@ -211,7 +211,8 @@ DtInitialize ( Gbl_RootTable = NULL; Gbl_SubtableStack = NULL; - sprintf (VersionString, "%X", (UINT32) ACPI_CA_VERSION); + snprintf (VersionString, sizeof(VersionBuffer), "%X", + (UINT32) ACPI_CA_VERSION); return (AE_OK); } @@ -292,7 +293,7 @@ DtCompileDataTable ( Signature = DtGetFieldValue (*FieldList); if (!Signature) { - sprintf (MsgBuffer, "Expected \"%s\"", "Signature"); + snprintf (MsgBuffer, sizeof(MsgBuffer), "Expected \"%s\"", "Signature"); DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME, *FieldList, MsgBuffer); return (AE_ERROR); @@ -485,7 +486,7 @@ DtCompileTable ( if (!LocalField) { - sprintf (MsgBuffer, "Found NULL field - Field name \"%s\" needed", + snprintf (MsgBuffer, sizeof(MsgBuffer), "Found NULL field - Field name \"%s\" needed", Info->Name); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer); Status = AE_BAD_DATA; diff --git a/sys/external/bsd/acpica/dist/compiler/dtfield.c b/sys/external/bsd/acpica/dist/compiler/dtfield.c index f9524dd77e6a..7fd779f41a43 100644 --- a/sys/external/bsd/acpica/dist/compiler/dtfield.c +++ b/sys/external/bsd/acpica/dist/compiler/dtfield.c @@ -174,7 +174,7 @@ DtCompileString ( if (Length > ByteLength) { - sprintf (MsgBuffer, "Maximum %u characters", ByteLength); + snprintf (MsgBuffer, sizeof(MsgBuffer), "Maximum %u characters", ByteLength); DtError (ASL_ERROR, ASL_MSG_STRING_LENGTH, Field, MsgBuffer); Length = ByteLength; } @@ -254,7 +254,7 @@ DtCompileUuid ( Status = AuValidateUuid (InString); if (ACPI_FAILURE (Status)) { - sprintf (MsgBuffer, "%s", Field->Value); + snprintf (MsgBuffer, sizeof(MsgBuffer), "%s", Field->Value); DtNameError (ASL_ERROR, ASL_MSG_INVALID_UUID, Field, MsgBuffer); } else @@ -340,7 +340,7 @@ DtCompileInteger ( if (Value > MaxValue) { - sprintf (MsgBuffer, "%8.8X%8.8X - max %u bytes", + snprintf (MsgBuffer, sizeof(MsgBuffer), "%8.8X%8.8X - max %u bytes", ACPI_FORMAT_UINT64 (Value), ByteLength); DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer); } @@ -563,7 +563,7 @@ DtCompileFlag ( if (Value >= ((UINT64) 1 << BitLength)) { - sprintf (MsgBuffer, "Maximum %u bit", BitLength); + snprintf (MsgBuffer, sizeof(MsgBuffer), "Maximum %u bit", BitLength); DtError (ASL_ERROR, ASL_MSG_FLAG_VALUE, Field, MsgBuffer); Value = 0; } diff --git a/sys/external/bsd/acpica/dist/compiler/dtsubtable.c b/sys/external/bsd/acpica/dist/compiler/dtsubtable.c index 275d67aa2ecc..b8b87203708b 100644 --- a/sys/external/bsd/acpica/dist/compiler/dtsubtable.c +++ b/sys/external/bsd/acpica/dist/compiler/dtsubtable.c @@ -343,7 +343,7 @@ DtGetSubtableLength ( Error: if (!Field) { - sprintf (MsgBuffer, "Found NULL field - Field name \"%s\" needed", + snprintf (MsgBuffer, sizeof(MsgBuffer), "Found NULL field - Field name \"%s\" needed", Info->Name); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer); } diff --git a/sys/external/bsd/acpica/dist/compiler/dttable.c b/sys/external/bsd/acpica/dist/compiler/dttable.c index 7ff5921946c5..331e5763458b 100644 --- a/sys/external/bsd/acpica/dist/compiler/dttable.c +++ b/sys/external/bsd/acpica/dist/compiler/dttable.c @@ -2437,7 +2437,7 @@ DtCompileGeneric ( Info = DtGetGenericTableInfo ((*PFieldList)->Name); if (!Info) { - sprintf (MsgBuffer, "Generic data type \"%s\" not found", + snprintf (MsgBuffer, sizeof(MsgBuffer), "Generic data type \"%s\" not found", (*PFieldList)->Name); DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME, (*PFieldList), MsgBuffer); @@ -2458,7 +2458,7 @@ DtCompileGeneric ( if (Status == AE_NOT_FOUND) { - sprintf (MsgBuffer, "Generic data type \"%s\" not found", + snprintf (MsgBuffer, sizeof(MsgBuffer), "Generic data type \"%s\" not found", (*PFieldList)->Name); DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME, (*PFieldList), MsgBuffer); diff --git a/sys/external/bsd/acpica/dist/compiler/dtutils.c b/sys/external/bsd/acpica/dist/compiler/dtutils.c index d61620de40cf..aefe2a088968 100644 --- a/sys/external/bsd/acpica/dist/compiler/dtutils.c +++ b/sys/external/bsd/acpica/dist/compiler/dtutils.c @@ -600,7 +600,7 @@ DtGetFieldLength ( else { /* At this point, this is a fatal error */ - sprintf (MsgBuffer, "Expected \"%s\"", Info->Name); + snprintf (MsgBuffer, sizeof(MsgBuffer), "Expected \"%s\"", Info->Name); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer); return (0); } @@ -626,7 +626,7 @@ DtGetFieldLength ( else { /* At this point, this is a fatal error */ - sprintf (MsgBuffer, "Expected \"%s\"", Info->Name); + snprintf (MsgBuffer, sizeof(MsgBuffer), "Expected \"%s\"", Info->Name); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer); return (0); } diff --git a/sys/external/bsd/acpica/dist/compiler/prutils.c b/sys/external/bsd/acpica/dist/compiler/prutils.c index e98626ff0daf..19f30760cffe 100644 --- a/sys/external/bsd/acpica/dist/compiler/prutils.c +++ b/sys/external/bsd/acpica/dist/compiler/prutils.c @@ -298,7 +298,8 @@ PrOpenIncludeFile ( /* We could not open the include file after trying very hard */ ErrorExit: - sprintf (Gbl_MainTokenBuffer, "%s, %s", Filename, strerror (errno)); + snprintf (Gbl_MainTokenBuffer, ASL_LINE_BUFFER_SIZE, "%s, %s", + Filename, strerror (errno)); PrError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, 0); } diff --git a/sys/external/bsd/acpica/dist/os_specific/service_layers/oslinuxtbl.c b/sys/external/bsd/acpica/dist/os_specific/service_layers/oslinuxtbl.c index 1d27b0cc7fc8..8f6bd83590c5 100644 --- a/sys/external/bsd/acpica/dist/os_specific/service_layers/oslinuxtbl.c +++ b/sys/external/bsd/acpica/dist/os_specific/service_layers/oslinuxtbl.c @@ -1420,11 +1420,13 @@ OslGetCustomizedTable ( if (Instance != 0) { - sprintf (TableFilename, "%s/%4.4s%d", Pathname, TempName, Instance); + snprintf (TableFilename, sizeof(TableFilename), "%s/%4.4s%d", + Pathname, TempName, Instance); } else { - sprintf (TableFilename, "%s/%4.4s", Pathname, TempName); + snprintf (TableFilename, sizeof(TableFilename), "%s/%4.4s", + Pathname, TempName); } break; } diff --git a/sys/external/bsd/acpica/dist/tools/acpidump/apfiles.c b/sys/external/bsd/acpica/dist/tools/acpidump/apfiles.c index 5c4b0dce4dc5..fddbf192a8e0 100644 --- a/sys/external/bsd/acpica/dist/tools/acpidump/apfiles.c +++ b/sys/external/bsd/acpica/dist/tools/acpidump/apfiles.c @@ -145,7 +145,7 @@ ApWriteToBinaryFile ( if (Instance > 0) { - sprintf (InstanceStr, "%u", Instance); + snprintf (InstanceStr, sizeof(InstanceStr), "%u", Instance); strcat (Filename, InstanceStr); } diff --git a/sys/external/bsd/acpica/dist/tools/acpixtract/acpixtract.c b/sys/external/bsd/acpica/dist/tools/acpixtract/acpixtract.c index c06e3757dea3..1cb66bb95d4b 100644 --- a/sys/external/bsd/acpica/dist/tools/acpixtract/acpixtract.c +++ b/sys/external/bsd/acpica/dist/tools/acpixtract/acpixtract.c @@ -587,11 +587,11 @@ AxExtractTables ( if (ThisInstance > 0) { - sprintf (Filename, "%4.4s%u.dat", ThisSignature, ThisInstance); + snprintf (Filename, sizeof(Filename), "%4.4s%u.dat", ThisSignature, ThisInstance); } else { - sprintf (Filename, "%4.4s.dat", ThisSignature); + snprintf (Filename, sizeof(Filename), "%4.4s.dat", ThisSignature); } AxStrlwr (Filename);