[LU-12999] gcc8 compile warning on string overflow in name_create_mdt Created: 22/Nov/19  Updated: 29/May/21  Resolved: 16/Dec/19

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.14.0, Lustre 2.12.7

Type: Bug Priority: Minor
Reporter: Shaun Tancheff Assignee: Shaun Tancheff
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

 

/home/shaun/lustre-wc-rel/lustre/mgs/mgs_llog.c:1539:2: note: ‘sprintf’ output between 9 and 10 bytes into a destination of size 9
 sprintf(mdt_index, "-MDT%04x", i);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/shaun/lustre-wc-rel/lustre/mgs/mgs_llog.c:1539:30: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]
 sprintf(mdt_index, "-MDT%04x", i);
 

 



 Comments   
Comment by Gerrit Updater [ 22/Nov/19 ]

Shaun Tancheff (stancheff@cray.com) uploaded a new patch: https://review.whamcloud.com/36817
Subject: LU-12999 mgs: Increase string buffer in name_create_mdt
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: e691efbeafeec6d21ff69b15c7b540ce1d6fc3c9

Comment by Gerrit Updater [ 16/Dec/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36817/
Subject: LU-12999 mgs: Cleanup string handling in name_create_mdt
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 298cdb5c0b6136b91e76c9c515bfbc2df99bae0b

Comment by Peter Jones [ 16/Dec/19 ]

Landed for 2.14

Comment by Gerrit Updater [ 14/Apr/21 ]

Olaf Faaland-LLNL (faaland1@llnl.gov) uploaded a new patch: https://review.whamcloud.com/43321
Subject: LU-12999 mgs: Cleanup string handling in name_create_mdt
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: aeb93ed5868af923096e714c055739ea7a5f646e

Comment by Gerrit Updater [ 29/May/21 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43321/
Subject: LU-12999 mgs: Cleanup string handling in name_create_mdt
Project: fs/lustre-release
Branch: b2_12
Current Patch Set:
Commit: f7a59078e3c37d25b22f90e158f737e26a320b5a

Generated at Sat Feb 10 02:57:30 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.