summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorKinga Stefaniuk <kinga.stefaniuk@intel.com>2024-07-04 14:53:35 +0200
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-07-30 15:59:24 +0200
commit0af8c9ebf50b68ad5f80efad7e94688235544a3d (patch)
treee0adf1da970ca29b8bbd6bb310a8e38b9a31f8fb /mdadm.h
parentdrive_encryption: Fix ata passthrough12 verify (diff)
downloadmdadm-0af8c9ebf50b68ad5f80efad7e94688235544a3d.tar.xz
mdadm-0af8c9ebf50b68ad5f80efad7e94688235544a3d.zip
super0: use define for char array in examine_super0
Using nb with 11 length may cause format-truncation errors, because it was possible to use snprintf with 12 length input and write it to 11 length output. Added new define and use it to avoid this error. Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/mdadm.h b/mdadm.h
index 27009154..22d5e8f4 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -2021,6 +2021,9 @@ enum r0layout {
#define PATH_MAX 4096
#endif
+/* The max string length necessary for decimal conversion, cannot be longer than count of bits */
+#define INT_2_DEC_STR_MAX (sizeof(int) * 8)
+
#define RESYNC_NONE -1
#define RESYNC_DELAYED -2
#define RESYNC_PENDING -3