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

[win-pv-devel] [PATCH 4/4] Make sure input buffers are always null-terminated


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Thu, 7 Nov 2019 15:53:18 +0000
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=owen.smith@xxxxxxxxxx; spf=Pass smtp.mailfrom=owen.smith@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Thu, 07 Nov 2019 15:53:54 +0000
  • Ironport-sdr: cw7PuUBcx3hJEsC4T3LHxmGSUn3EadghliB8V/V/a4DLuehDHe13jgWg7eYjnSIBQWCM8j+S63 xQnJf/NdLFWeEC+hz9Ga7p66VPyCN25zUJExWXY2PprkE8Is/YN2WM8Nr8OIJcEMVu57GAMJpn GOPEAGmuPkUgG9TX04Coy1yF1yTN33OMiUIoidO4tzvLkdA6Cn81nIxgi+nd0n0VR/2wxroYIg xgSXfC+TU8cHSGJ1mnprb5Rx28tkiE84+fhKhiKEX7Yj25EKIFUxv/r5ZAW/6sUWqNyC4JHKKc H00=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/tty/tty.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/tty/tty.c b/src/tty/tty.c
index c3dfcf9..cb1378d 100644
--- a/src/tty/tty.c
+++ b/src/tty/tty.c
@@ -317,6 +317,8 @@ GetCredentials(
                       sizeof (Context->UserName),
                       &Size,
                       FALSE);
+    Context->UserName[MAXIMUM_BUFFER_SIZE - 1] = TEXT('\0');
+
     if (!Success)
         return FALSE;
 
@@ -338,6 +340,8 @@ GetCredentials(
                       PasswordSize,
                       &Size,
                       TRUE);
+    Password[(PasswordSize / sizeof(TCHAR)) - 1] = TEXT('\0');
+
     if (!Success)
         return FALSE;
 
@@ -384,6 +388,8 @@ RequestElevation(
                       sizeof (Buffer),
                       &Size,
                       FALSE);
+    Buffer[MAXIMUM_BUFFER_SIZE - 1] = TEXT('\0');
+
     if (!Success)
         return FALSE;
 
-- 
2.16.2.windows.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/win-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.