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

[win-pv-devel] [PATCH] Use fixed size buffer for RtlStringCbPrintf


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Fri, 8 Nov 2019 12:56:32 +0000
  • Authentication-results: esa3.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: Fri, 08 Nov 2019 12:57:00 +0000
  • Ironport-sdr: sAG32kB/rGjGID450gz4DJa8qFm5mJBlQnBnayJXiGZpXRk5PPNxOw3Fiqc2HeItkRrfKaH6f0 Zc58EFvmIIY3LDweNXNeNh1AgmH5K+k8hLNEDZkF5T0S5KX5h57ddqYWM0/qn4/vFGi/2T6dCc jYh6tJk7Bv/rpN2SWl/RadDufM3+q9E+DkwC2rsDdNp26osD+JWwx4wvX8r7uXPpch4uYISTEB Uk65cmp+p/uWXTwOK+Gl8dQFRl9X9xzg8SScxi/NFCOIqtAKBOTrVSCQt3nFttnMGAcVKLoh5q mh0=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Using sizeof("mac/XX") can result in a buffer not large enough for the
RtlStringCbPrintf call to succeed, for large numbers of multicast
addresses.

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xenvif/mac.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/xenvif/mac.c b/src/xenvif/mac.c
index 0b17a54..3041d85 100644
--- a/src/xenvif/mac.c
+++ b/src/xenvif/mac.c
@@ -69,6 +69,7 @@ struct _XENVIF_MAC {
 };
 
 #define XENVIF_MAC_TAG  'CAM'
+#define MAX_BUFFER_SIZE 64
 
 static FORCEINLINE PVOID
 __MacAllocate(
@@ -357,7 +358,7 @@ MacDumpAddressTable(
                         "mac");
 
     for (Index = 0; Index < Count; Index++) {
-        CHAR    Node[sizeof ("mac/XX")];
+        CHAR    Node[MAX_BUFFER_SIZE];
 
         status = RtlStringCbPrintfA(Node,
                                     sizeof (Node),
-- 
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®.