summarylogtreecommitdiffstats
path: root/fix-base-snprintf-sizeof-pointer.patch
blob: 867d60b6737829d8eb61d4e0300afaf02857e4f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
--- a/sw/nic/gpuagent/api/include/base.hpp
+++ b/sw/nic/gpuagent/api/include/base.hpp
@@ -116,7 +116,7 @@ struct aga_obj_key_s {
         buf[23] = '-';
         for (uint32_t i = 0; i < 6; i++) {
             uint32_t off = 24 + (i << 1);
-            snprintf(&buf[off], sizeof(buf) - off,"%02x", id[10 + i] & 0xFF);
+            snprintf(&buf[off], OBJ_MAX_KEY_STR_LEN + 1 - off, "%02x", id[10 + i] & 0xFF);
         }
         buf[OBJ_MAX_KEY_STR_LEN] = '\0';
         return buf;