mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
shadow global value error with cross-compiler
This commit is contained in:
committed by
Jacob Barthelmeh
parent
a6e6cc781d
commit
3af8975a66
@@ -16430,11 +16430,11 @@ void PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo,
|
||||
* type type of packet being sent
|
||||
* data data bing sent with packet
|
||||
* sz size of data buffer
|
||||
* write 1 if this packet is being written to wire, 0 if being read
|
||||
* written 1 if this packet is being written to wire, 0 if being read
|
||||
* heap custom heap to use for mallocs/frees
|
||||
*/
|
||||
void AddPacketInfo(WOLFSSL* ssl, const char* name, int type,
|
||||
const byte* data, int sz, int write, void* heap)
|
||||
const byte* data, int sz, int written, void* heap)
|
||||
{
|
||||
#ifdef WOLFSSL_CALLBACKS
|
||||
TimeoutInfo* info = &ssl->timeoutInfo;
|
||||
@@ -16478,13 +16478,13 @@ void PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo,
|
||||
(ssl->version.major & 0X0F) * 256 +
|
||||
(ssl->version.major & 0xF0) * 4096;
|
||||
|
||||
ssl->protoMsgCb(write, version, type,
|
||||
ssl->protoMsgCb(written, version, type,
|
||||
(const void *)(data + RECORD_HEADER_SZ),
|
||||
(size_t)(sz - RECORD_HEADER_SZ),
|
||||
ssl, ssl->protoMsgCtx);
|
||||
}
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
(void)write;
|
||||
(void)written;
|
||||
(void)name;
|
||||
(void)heap;
|
||||
(void)type;
|
||||
|
17
src/ssl.c
17
src/ssl.c
@@ -27837,16 +27837,15 @@ void* wolfSSL_GetDhAgreeCtx(WOLFSSL* ssl)
|
||||
|
||||
#if defined(WOLFSSL_CERT_GEN) && !defined(NO_RSA)
|
||||
/* needed SetName function from asn.c is wrapped by NO_RSA */
|
||||
|
||||
/* helper function for CopyX509NameToCertName()
|
||||
*
|
||||
* returns WOLFSSL_SUCCESS on success
|
||||
*/
|
||||
static int CopyX509NameEntry(char* out, int max, char* in, int inLen)
|
||||
static int CopyX509NameEntry(char* out, int mx, char* in, int inLen)
|
||||
{
|
||||
if (inLen > max) {
|
||||
if (inLen > mx) {
|
||||
WOLFSSL_MSG("Name too long");
|
||||
XMEMCPY(out, in, max);
|
||||
XMEMCPY(out, in, mx);
|
||||
}
|
||||
else {
|
||||
XMEMCPY(out, in, inLen);
|
||||
@@ -27854,7 +27853,7 @@ void* wolfSSL_GetDhAgreeCtx(WOLFSSL* ssl)
|
||||
}
|
||||
|
||||
/* make sure is null terminated */
|
||||
out[max-1] = '\0';
|
||||
out[mx-1] = '\0';
|
||||
|
||||
return WOLFSSL_SUCCESS;
|
||||
}
|
||||
@@ -29555,7 +29554,7 @@ WOLFSSL_BUF_MEM* wolfSSL_BUF_MEM_new(void)
|
||||
int wolfSSL_BUF_MEM_grow(WOLFSSL_BUF_MEM* buf, size_t len)
|
||||
{
|
||||
int len_int = (int)len;
|
||||
int max;
|
||||
int mx;
|
||||
|
||||
/* verify provided arguments */
|
||||
if (buf == NULL || len_int < 0) {
|
||||
@@ -29578,15 +29577,15 @@ int wolfSSL_BUF_MEM_grow(WOLFSSL_BUF_MEM* buf, size_t len)
|
||||
}
|
||||
|
||||
/* expand size, to handle growth */
|
||||
max = (len_int + 3) / 3 * 4;
|
||||
mx = (len_int + 3) / 3 * 4;
|
||||
|
||||
/* use realloc */
|
||||
buf->data = (char*)XREALLOC(buf->data, max, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
buf->data = (char*)XREALLOC(buf->data, mx, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if (buf->data == NULL) {
|
||||
return 0; /* ERR_R_MALLOC_FAILURE; */
|
||||
}
|
||||
|
||||
buf->max = max;
|
||||
buf->max = mx;
|
||||
XMEMSET(&buf->data[buf->length], 0, len - buf->length);
|
||||
buf->length = len;
|
||||
|
||||
|
Reference in New Issue
Block a user