Skip to content

fix: connectParams struct is not zero-initialized - #15

Open
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:codequality/fmpm-connectparams-struct-is-not-zero
Open

fix: connectParams struct is not zero-initialized#15
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:codequality/fmpm-connectparams-struct-is-not-zero

Conversation

@andrewwhitecdw

Copy link
Copy Markdown

This PR addresses the following issue in fmpm.cpp: connectParams struct is not zero-initialized.

Changes

  • fmpm.cpp: connectParams struct is not zero-initialized.

Details

--- a/fmpm.cpp
+++ b/fmpm.cpp
@@ -1,4 +1,5 @@
-    /* Connect to Fabric Manager instance */
-    fmConnectParams_t connectParams;
-    connectParams.timeoutMs = 1000; // in milliseconds
-    connectParams.version = fmConnectParams_version;
+    /* Connect to Fabric Manager instance */
+    fmConnectParams_t connectParams;
+    memset(&connectParams, 0, sizeof(connectParams));
+    connectParams.timeoutMs = 1000; // in milliseconds
+    connectParams.version = fmConnectParams_version;

Tests

Let me know if you want tests added for this fix or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant