Skip to content

Commit

Permalink
Fix Compile Error On SSL Function Use For Some Compilers (#922)
Browse files Browse the repository at this point in the history
Some compilers complain that we're passing an uninitialized value to
openssl functions. These parameters are outparams, so it doesn't
actually matter, but initialize them to zero to make the compiler happy.
  • Loading branch information
pamaddox authored Feb 29, 2024
1 parent 6f6e237 commit 0a4dd65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## 2.7

* Fix compilation errors on calling openssl functions that occur on some compilers

### 2.7.0

* Added new function, `mtev_dyn_buffer_maybe_add_vprintf`, that will not try to
Expand Down
3 changes: 2 additions & 1 deletion src/mtev_net_heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ mtev_net_headerbeat_sendall(mtev_net_heartbeat_ctx *ctx, void *payload, int payl

static int
mtev_net_heartbeat_serialize_and_send(mtev_net_heartbeat_ctx *ctx) {
int i, len, blocksize, ivecsize, outlen1, outlen2, text_len;
int i, len, blocksize, ivecsize, text_len;
EVP_CIPHER_CTX *evp_ctx = NULL;
unsigned char cipher_buf_static[16000];
unsigned char *ivec, *cipher_buf = cipher_buf_static, *text;
Expand Down Expand Up @@ -342,6 +342,7 @@ mtev_net_heartbeat_serialize_and_send(mtev_net_heartbeat_ctx *ctx) {
memcpy(cipher_buf, payload, HDRLEN);
text = (unsigned char *)payload + HDR_LENSIZE + HDR_IVSIZE;
text_len = len - (HDR_LENSIZE + HDR_IVSIZE);
int outlen1 = 0, outlen2 = 0;
if ((!EVP_EncryptUpdate(evp_ctx,cipher_buf+HDR_LENSIZE+HDR_IVSIZE,&outlen1,
text,text_len)) ||
(!EVP_EncryptFinal(evp_ctx,cipher_buf+HDR_LENSIZE+HDR_IVSIZE+outlen1,
Expand Down

0 comments on commit 0a4dd65

Please sign in to comment.