mirror of
https://github.com/curl/curl.git
synced 2026-08-25 10:03:37 +03:00
curlx: curlx_strcopy() instead of strcpy()
This function REQUIRES the size of the target buffer as well as the length of the source string. Meant to make it harder to do a bad strcpy(). Removes 23 calls to strcpy(). Closes #20067
This commit is contained in:
parent
f099c2ca55
commit
a535be4ea0
30 changed files with 195 additions and 97 deletions
|
|
@ -73,7 +73,7 @@
|
|||
#include "url.h"
|
||||
#include "bufref.h"
|
||||
#include "curl_sasl.h"
|
||||
|
||||
#include "curlx/strcopy.h"
|
||||
|
||||
/* meta key for storing protocol meta at easy handle */
|
||||
#define CURL_META_IMAP_EASY "meta:proto:imap:easy"
|
||||
|
|
@ -1679,7 +1679,7 @@ static CURLcode imap_connect(struct Curl_easy *data, bool *done)
|
|||
imap_state(data, imapc, IMAP_SERVERGREET);
|
||||
|
||||
/* Start off with an response id of '*' */
|
||||
strcpy(imapc->resptag, "*");
|
||||
curlx_strcopy(imapc->resptag, sizeof(imapc->resptag), "*", 1);
|
||||
|
||||
result = imap_multi_statemach(data, done);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue