Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/acpica/dist/dispatcher CID 1292510: Check a...



details:   https://anonhg.NetBSD.org/src/rev/b299e27b648a
branches:  trunk
changeset: 808199:b299e27b648a
user:      christos <christos%NetBSD.org@localhost>
date:      Sat May 09 15:31:36 2015 +0000

description:
CID 1292510: Check allocation

diffstat:

 sys/external/bsd/acpica/dist/dispatcher/dsutils.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (24 lines):

diff -r 11ad4465628d -r b299e27b648a sys/external/bsd/acpica/dist/dispatcher/dsutils.c
--- a/sys/external/bsd/acpica/dist/dispatcher/dsutils.c Sat May 09 15:28:25 2015 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dsutils.c Sat May 09 15:31:36 2015 +0000
@@ -604,10 +604,16 @@
                     /* TBD: May only be temporary */
 
                     ObjDesc = AcpiUtCreateStringObject ((ACPI_SIZE) NameLength);
-
-                    ACPI_STRNCPY (ObjDesc->String.Pointer, NameString, NameLength);
-                    Status = AE_OK;
-                }
+                   if (ObjDesc)
+                   {
+                       ACPI_STRNCPY (ObjDesc->String.Pointer, NameString, NameLength);
+                       Status = AE_OK;
+                   }
+                   else
+                   {
+                       Status = AE_NO_MEMORY;
+                   }
+               }
                 else
                 {
                     /*



Home | Main Index | Thread Index | Old Index