Skip to content

Commit

Permalink
rest_client: Fix string truncation compiler warnings
Browse files Browse the repository at this point in the history
Reported by Dan Pascu

(cherry picked from commit a64d411)
(cherry picked from commit 9fa666c)
  • Loading branch information
liviuchircu committed May 29, 2019
1 parent 7305fae commit c5d44aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions modules/rest_client/rest_methods.c
Expand Up @@ -138,7 +138,6 @@ int trace_rest_request_cb(CURL *handle, curl_infotype type, char *data, size_t s
/* set port to 0 */
tparam->local_port = 0;
#endif
/* coverity[BUFFER_SIZE_WARNING] */
strncpy( tparam->local_ip, ip, INET6_ADDRSTRLEN);

#if ( LIBCURL_VERSION_NUM >= 0x072100 )
Expand All @@ -148,7 +147,6 @@ int trace_rest_request_cb(CURL *handle, curl_infotype type, char *data, size_t s
/* set boggus localhost ip */
ip = "127.0.0.1";
#endif
/* coverity[BUFFER_SIZE_WARNING] */
strncpy( tparam->remote_ip, ip, INET6_ADDRSTRLEN);

#if ( LIBCURL_VERSION_NUM >= 0x071900 )
Expand Down
4 changes: 2 additions & 2 deletions modules/rest_client/rest_methods.h
Expand Up @@ -77,10 +77,10 @@ typedef struct _rest_trace_param {
int rpl_len;

long local_port;
char local_ip[INET6_ADDRSTRLEN];
char local_ip[INET6_ADDRSTRLEN + 1];

long remote_port;
char remote_ip[INET6_ADDRSTRLEN];
char remote_ip[INET6_ADDRSTRLEN + 1];

str correlation;
} rest_trace_param_t;
Expand Down

0 comments on commit c5d44aa

Please sign in to comment.