summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOut.c
diff options
context:
space:
mode:
authorVineel Kovvuri[MSFT] <vineelko@microsoft.com>2024-10-25 16:37:01 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-01-15 11:18:04 +0000
commitaae044a130599427e3562fe5736d7b2d42777272 (patch)
tree798ed1db391a70720d5006749bab80d02a469ac0 /EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOut.c
parentd6f828b3849e5adcf9a04d3c16e79388db9b3614 (diff)
downloadedk2-aae044a130599427e3562fe5736d7b2d42777272.tar.gz
EmbeddedPkg: CodeQL Fixes.
Makes changes to comply with alerts raised by CodeQL. Most of the issues here fall into the following two categories: 1. Potential use of uninitialized pointer. 2. Inconsistent integer width in comparison. Co-authored-by: Taylor Beebe <taylor.d.beebe@gmail.com> Co-authored-by: Ken Lautner <kenlautner3@gmail.com> Co-authored-by: Bret Barkelew <bret@corthon.com> Signed-off-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Diffstat (limited to 'EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOut.c')
-rw-r--r--EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOut.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOut.c b/EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOut.c
index 32944a8d9d..2a15f23771 100644
--- a/EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOut.c
+++ b/EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOut.c
@@ -504,6 +504,9 @@ OutputString (
Size = StrLen (String) + 1;
OutputString = AllocatePool (Size);
+ if (OutputString == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
// If there is any non-ascii characters in String buffer then replace it with '?'
// Eventually, UnicodeStrToAsciiStr API should be fixed.