From 6b2caf63d5321ac2220b09b0b7edc746793b574a Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Mon, 19 Feb 2018 14:01:56 -0500 Subject: [PATCH] venus: fix format overflow warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Recent versions of gcc generate a format overflow warning on the dfstring buffer in fs.c. Increase the size of the buffer to avoid a possible buffer overflow. fs.c: In function ‘AclToString’: fs.c:770:30: error: ‘%s’ directive writing up to 1024 bytes into a region of size between 13 and 23 [-Werror=format-overflow=] sprintf(dfsstring, " dfs:%d %s", acl->dfs, acl->cell); ^~ fs.c:770:2: note: ‘sprintf’ output between 8 and 1042 bytes into a destination of size 30 sprintf(dfsstring, " dfs:%d %s", acl->dfs, acl->cell); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reviewed-on: https://gerrit.openafs.org/12917 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit c84f36a9b8c6b6adb9c77bab1c814ccd3aaf6a5b) Reviewed-on: https://gerrit.openafs.org/13099 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit e1b71e88452b2a5ff7473514661cb85dfac1b3c1) Change-Id: I332d283c787f35b0d5d72e1c9e8de1145e177719 Reviewed-on: https://gerrit.openafs.org/13499 Reviewed-by: Cheyenne Wills Reviewed-by: Stephan Wiesand Tested-by: Stephan Wiesand --- src/venus/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/venus/fs.c b/src/venus/fs.c index 9bdd1fba15..bbd819a85b 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -747,7 +747,7 @@ AclToString(struct Acl *acl) { static char mydata[AFS_PIOCTL_MAXSIZE]; char tstring[AFS_PIOCTL_MAXSIZE]; - char dfsstring[30]; + char dfsstring[AFS_PIOCTL_MAXSIZE]; struct AclEntry *tp; if (acl->dfs)