mirror of
https://github.com/curl/curl.git
synced 2026-07-06 12:47:17 +03:00
smb: use memcpy() instead of strncpy()
... as it never copies the trailing zero anyway and always just the four bytes so let's not mislead anyone into thinking it is actually treated as a string. Coverity CID: 1260214
This commit is contained in:
parent
f9cf3de70b
commit
2c5f346d3a
1 changed files with 1 additions and 1 deletions
|
|
@ -345,7 +345,7 @@ static void smb_format_message(struct connectdata *conn, struct smb_header *h,
|
|||
memset(h, 0, sizeof(*h));
|
||||
h->nbt_length = htons((unsigned short) (sizeof(*h) - sizeof(unsigned int) +
|
||||
len));
|
||||
strncpy((char *)h->magic, "\xffSMB", 4);
|
||||
memcpy((char *)h->magic, "\xffSMB", 4);
|
||||
h->command = cmd;
|
||||
h->flags = SMB_FLAGS_CANONICAL_PATHNAMES | SMB_FLAGS_CASELESS_PATHNAMES;
|
||||
h->flags2 = smb_swap16(SMB_FLAGS2_IS_LONG_NAME | SMB_FLAGS2_KNOWS_LONG_NAME);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue