[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [win-pv-devel] [PATCH] Use fixed size buffer for RtlStringCbPrintf
On Fri, 8 Nov 2019 at 12:57, Owen Smith <owen.smith@xxxxxxxxxx> wrote: > > Using sizeof("mac/XX") can result in a buffer not large enough for the > RtlStringCbPrintf call to succeed, for large numbers of multicast > addresses. How many are observed? Even if it is >=100, is really likely to ever be >=1000 without something being quite wrong? Paul > > 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 _______________________________________________ win-pv-devel mailing list win-pv-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/win-pv-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |