[前][次][番号順一覧][スレッド一覧]

ruby-changes:74047

From: Kazuki <ko1@a...>
Date: Mon, 17 Oct 2022 16:43:35 +0900 (JST)
Subject: [ruby-changes:74047] e4b1627983 (master): [ruby/openssl] ssl: fix "warning: ‘ctx’ may be used uninitialized"

https://git.ruby-lang.org/ruby.git/commit/?id=e4b1627983

From e4b1627983ca27afcae9a2c502915a747a9e1656 Mon Sep 17 00:00:00 2001
From: Kazuki Yamaguchi <k@r...>
Date: Fri, 9 Sep 2022 16:03:42 +0900
Subject: =?UTF-8?q?[ruby/openssl]=20ssl:=20fix=20"warning:=20=E2=80=98ctx?=
 =?UTF-8?q?=E2=80=99=20may=20be=20used=20uninitialized"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The code was introduced by https://github.com/ruby/openssl/commit/65530b887e54 ("ssl: enable generating keying
material from SSL sessions", 2022-08-03).

This is harmless, but we should avoid it.

https://github.com/ruby/openssl/commit/f5b82e814b
---
 ext/openssl/ossl_ssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 593a6aa758..aa4c947028 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -2450,7 +2450,7 @@ ossl_ssl_export_keying_material(int argc, VALUE *argv, VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_ssl.c#L2450
     unsigned char *p;
     size_t len;
     int use_ctx = 0;
-    unsigned char *ctx;
+    unsigned char *ctx = NULL;
     size_t ctx_len = 0;
     int ret;
 
-- 
cgit v1.2.3


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]