smb: client, common: fix fortify warnings
[platform/kernel/linux-starfive.git] / fs / smb / client / cifssmb.c
index bad91ba..9ee348e 100644 (file)
@@ -1244,8 +1244,10 @@ openRetry:
                *oplock |= CIFS_CREATE_ACTION;
 
        if (buf) {
-               /* copy from CreationTime to Attributes */
-               memcpy((char *)buf, (char *)&rsp->CreationTime, 36);
+               /* copy commonly used attributes */
+               memcpy(&buf->common_attributes,
+                      &rsp->common_attributes,
+                      sizeof(buf->common_attributes));
                /* the file_info buf is endian converted by caller */
                buf->AllocationSize = rsp->AllocationSize;
                buf->EndOfFile = rsp->EndOfFile;