lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160622053420.GA9024@amitoj-Inspiron-3542>
Date:	Wed, 22 Jun 2016 11:04:20 +0530
From:	Amitoj Kaur Chawla <amitoj1606@...il.com>
To:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:	julia.lawall@...6.fr, michael.leibowitz@...el.com,
	keescook@...omium.org
Subject: [PATCH] hfs: Change structure initialisation to C99 style

To allow for structure randomisation, replace the in order
struct initialisation style with explicit field style.
Also, remove an unnecessary initialisation since NULL values do not
need to be explicitly initialised.

The Coccinelle semantic patch used to make this change is as follows:

@decl@
identifier i1,fld;
type T;
field list[n] fs;
@@

struct i1 {
 fs
 T fld;
 ...};

@@
identifier decl.i1,i2,decl.fld;
expression e;
position bad.p, bad.fix;
@@

struct i1 i2@p = { ...,
+ .fld = e
- e@fix
 ,...};

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@...il.com>
---
 fs/hfs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index cb1e5fa..29fc0ea 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -380,7 +380,7 @@ static int hfs_read_inode(struct inode *inode, void *data)
  */
 struct inode *hfs_iget(struct super_block *sb, struct hfs_cat_key *key, hfs_cat_rec *rec)
 {
-	struct hfs_iget_data data = { key, rec };
+	struct hfs_iget_data data = { .key = key, .rec = rec };
 	struct inode *inode;
 	u32 cnid;
 
@@ -527,7 +527,7 @@ static struct dentry *hfs_file_lookup(struct inode *dir, struct dentry *dentry,
 	fd.search_key->cat = HFS_I(dir)->cat_key;
 	res = hfs_brec_read(&fd, &rec, sizeof(rec));
 	if (!res) {
-		struct hfs_iget_data idata = { NULL, &rec };
+		struct hfs_iget_data idata = { .rec = &rec };
 		hfs_read_inode(inode, &idata);
 	}
 	hfs_find_exit(&fd);
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ