From 23f0e442659c34010bd40aa59490b4e7933a8b3d Mon Sep 17 00:00:00 2001 From: Justin Stoecker Date: Thu, 9 Feb 2023 10:27:20 -0800 Subject: [PATCH] Fix SAL annotation in private DML EP interface (#14639) In #14461 I added a private interface to MLOperatorAuthorPrivate.h to pipe ORT node names through to the debug name of DML operators/graphs. The wrong SAL annotation was used on the `Get*Name` methods, which confused static analysis tools into thinking there is a potential buffer overrun. --- .../dml/OperatorAuthorHelper/MLOperatorAuthorPrivate.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/providers/dml/OperatorAuthorHelper/MLOperatorAuthorPrivate.h b/onnxruntime/core/providers/dml/OperatorAuthorHelper/MLOperatorAuthorPrivate.h index 6d906c6056137..1df7a7dff583b 100644 --- a/onnxruntime/core/providers/dml/OperatorAuthorHelper/MLOperatorAuthorPrivate.h +++ b/onnxruntime/core/providers/dml/OperatorAuthorHelper/MLOperatorAuthorPrivate.h @@ -67,7 +67,7 @@ IMLOperatorKernelCreationContextNodeWrapperPrivate : public IMLOperatorKernelCre //! Writes the node name and null terminator into a char buffer. STDMETHOD(GetUtf8Name)( uint32_t bufferSizeInBytes, - _Out_writes_(bufferSizeInBytes) char* name + _Out_writes_bytes_(bufferSizeInBytes) char* name ) const noexcept PURE; //! Gets the minimum size of a wchar buffer to store the node name (including null terminator). @@ -77,7 +77,7 @@ IMLOperatorKernelCreationContextNodeWrapperPrivate : public IMLOperatorKernelCre //! Writes the node name and null terminator into a wchar buffer. STDMETHOD(GetWideName)( uint32_t bufferSizeInBytes, - _Out_writes_(bufferSizeInBytes) wchar_t* name + _Out_writes_bytes_(bufferSizeInBytes) wchar_t* name ) const noexcept PURE; };