]
Farah Juma updated SSLNTV-5:
----------------------------
Fix Version/s: 2.1.0.SP01
Ensure that protoVersion is initialized in ssl.c
------------------------------------------------
Key: SSLNTV-5
URL:
https://issues.redhat.com/browse/SSLNTV-5
Project: WildFly OpenSSL Natives
Issue Type: Bug
Reporter: Farah Juma
Assignee: Farah Juma
Priority: Major
Fix For: 2.1.0.SP01
The following error occurs when building on MacOS:
{code}
[INFO] --- exec-maven-plugin:1.6.0:exec (default) @ wildfly-openssl-macosx-x86_64 ---
mkdir -p target/classes/macosx-x86_64
cc -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
-Wpointer-arith -std=c89 -Wdeclaration-after-statement -Wformat -Wformat-security -Wunused
-Wno-unknown-pragmas -c ../libwfssl/src/alpn.c -o target/alpn.o -I../libwfssl/include
-I/Users/darranlofthouse/applications/jdk-11.0.2.jdk/Contents/Home/include
-I/Users/darranlofthouse/applications/jdk-11.0.2.jdk/Contents/Home/include/darwin
cc -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
-Wpointer-arith -std=c89 -Wdeclaration-after-statement -Wformat -Wformat-security -Wunused
-Wno-unknown-pragmas -c ../libwfssl/src/clientcert.c -o target/clientcert.o
-I../libwfssl/include
-I/Users/darranlofthouse/applications/jdk-11.0.2.jdk/Contents/Home/include
-I/Users/darranlofthouse/applications/jdk-11.0.2.jdk/Contents/Home/include/darwin
cc -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
-Wpointer-arith -std=c89 -Wdeclaration-after-statement -Wformat -Wformat-security -Wunused
-Wno-unknown-pragmas -c ../libwfssl/src/options.c -o target/options.o
-I../libwfssl/include
-I/Users/darranlofthouse/applications/jdk-11.0.2.jdk/Contents/Home/include
-I/Users/darranlofthouse/applications/jdk-11.0.2.jdk/Contents/Home/include/darwin
cc -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
-Wpointer-arith -std=c89 -Wdeclaration-after-statement -Wformat -Wformat-security -Wunused
-Wno-unknown-pragmas -c ../libwfssl/src/session.c -o target/session.o
-I../libwfssl/include
-I/Users/darranlofthouse/applications/jdk-11.0.2.jdk/Contents/Home/include
-I/Users/darranlofthouse/applications/jdk-11.0.2.jdk/Contents/Home/include/darwin
cc -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
-Wpointer-arith -std=c89 -Wdeclaration-after-statement -Wformat -Wformat-security -Wunused
-Wno-unknown-pragmas -c ../libwfssl/src/ssl.c -o target/ssl.o -I../libwfssl/include
-I/Users/darranlofthouse/applications/jdk-11.0.2.jdk/Contents/Home/include
-I/Users/darranlofthouse/applications/jdk-11.0.2.jdk/Contents/Home/include/darwin
../libwfssl/src/ssl.c:604:25: error: variable 'protoVersion' is used
uninitialized whenever 'for' loop exits because its condition is false
[-Werror,-Wsometimes-uninitialized]
for (i = 0; i < 6; i++) {
^~~~~
../libwfssl/src/ssl.c:610:81: note: uninitialized use occurs here
ssl_methods.SSL_CTX_ctrl((c->ctx), SSL_CTRL_SET_MIN_PROTO_VERSION,
(protoVersion), NULL);
^~~~~~~~~~~~
../libwfssl/src/ssl.c:604:25: note: remove the condition if it is always true
for (i = 0; i < 6; i++) {
^~~~~
../libwfssl/src/ssl.c:550:21: note: initialize the variable 'protoVersion' to
silence this warning
int protoVersion;
^
= 0
{code}