Description of problem: When calling SSL_new() with NULL argument in some application (e.g. it could happen with actual elinks devel branch, compiled, when its binary executed as `SSL_DIR=<some file, not nss database dir> ./elinks https://<somepage>` with SSL certification enabled), application will segfault. Version-Release number of selected component (if applicable): nss_compat_ossl-0.9.4-3 How reproducible: always Steps to Reproduce: 1. compile elinks binary, devel branch (linked with nss_compat_ossl) 2. run it's binary with invalid SSL_DIR envvar Actual results: It will segfault Expected results: It will return some error Additional info: Something like that patch fixes my problem, it could be of course handled/prevented on elinks side, but it would be better to prevent such things directly in library. diff -urNp nss_compat_ossl-0.9.4-orig/src/ssl.c nss_compat_ossl-0.9.4/src/ssl.c --- nss_compat_ossl-0.9.4-orig/src/ssl.c 2009-04-15 16:55:03.000000000 +0200 +++ nss_compat_ossl-0.9.4/src/ssl.c 2009-04-15 16:56:25.000000000 +0200 @@ -1968,6 +1968,9 @@ SSL *SSL_new(SSL_CTX *templ_s) ossl_ctx_t *ossl; ossl_ctx_t *ossl_templ; + if (templ_s == NULL) + return NULL; + /* This layer contains the TCP/IP functions we need */ s = PR_NewTCPSocket(); if (s == NULL)
Your patch looks good, thanks. I'll get this committed upstream and create a set of Fedora updates.
Created attachment 340360 [details] Ensure we have an SSL_CTX before doing work
Committed revision 70.
nss_compat_ossl-0.9.5-2.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/nss_compat_ossl-0.9.5-2.fc10
nss_compat_ossl-0.9.5-1.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/nss_compat_ossl-0.9.5-1.fc11
nss_compat_ossl-0.9.5-1.fc9 has been submitted as an update for Fedora 9. http://admin.fedoraproject.org/updates/nss_compat_ossl-0.9.5-1.fc9
nss_compat_ossl-0.9.5-2.fc10 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update nss_compat_ossl'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-3767
nss_compat_ossl-0.9.5-1.fc9 has been pushed to the Fedora 9 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing-newkey update nss_compat_ossl'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2009-3796
nss_compat_ossl-0.9.5-3.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/nss_compat_ossl-0.9.5-3.fc10
nss_compat_ossl-0.9.5-2.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/nss_compat_ossl-0.9.5-2.fc11
nss_compat_ossl-0.9.5-2.fc9 has been submitted as an update for Fedora 9. http://admin.fedoraproject.org/updates/nss_compat_ossl-0.9.5-2.fc9
nss_compat_ossl-0.9.5-2.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report.
nss_compat_ossl-0.9.5-3.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.
nss_compat_ossl-0.9.5-2.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.