View Issue Details

IDProjectCategoryView StatusLast Update
0005083unrealircdpublic2018-04-22 09:38
ReporterSky-DancerAssigned Tosyzop 
PrioritynoneSeveritytweakReproducibilityN/A
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version4.0.18 
Summary0005083: ctx init on reload
Descriptionin ssl.c;
441 tmp = init_ctx(iConf.ssl_options, 1);
...
449 SSL_CTX_free(tmp);
450 SSL_CTX_free(ctx_server);
451 ctx_server = init_ctx(iConf.ssl_options, 1);
AND
453 tmp = init_ctx(iConf.ssl_options, 0);
...
461 SSL_CTX_free(tmp);
462 SSL_CTX_free(ctx_client);
463 ctx_client = init_ctx(iConf.ssl_options, 0);
you can simply equilaze tmp pointer to ctx_server and ctx_client i think.
    SSL_CTX_free(ctx_server);
    ctx_server = tmp; // simply use this tmp named pointer's address.
AND
    SSL_CTX_free(ctx_client);
    ctx_client = tmp;
why did you create/check ctx pointer twice? (because you already checked them in first init_ctx calls)
did i miss something here :S ?
TagsNo tags attached.
3rd party modules

Activities

syzop

2018-03-27 08:10

administrator   ~0020076

Yes, that's true and a good idea.
Perhaps it was for historic reasons when init_ctx() had some global side-effects. I don't recall... Whatever the reason, good or bad, I ended up copying that for each case and it's not necessary.
I'll see if I can change it to what you suggested at the various places. The code changed 1-2 days ago which is a good opportunity to simplify the code :)

syzop

2018-04-22 09:38

administrator   ~0020102

Fixed, thanks for the report.

https://github.com/unrealircd/unrealircd/commit/a235b3563368065ea31c409bd69e3e166a04b80c

commit a235b3563368065ea31c409bd69e3e166a04b80c
Author: Bram Matthys <syzop@vulnscan.org>
Date: Sun Apr 22 09:35:05 2018 +0200

    This code can be a lot simpler, duh. Reported by Sky-Dancer (0005078).

Issue History

Date Modified Username Field Change
2018-03-27 03:47 Sky-Dancer New Issue
2018-03-27 08:10 syzop Note Added: 0020076
2018-03-27 08:10 syzop Status new => acknowledged
2018-04-22 09:38 syzop Assigned To => syzop
2018-04-22 09:38 syzop Status acknowledged => resolved
2018-04-22 09:38 syzop Resolution open => fixed
2018-04-22 09:38 syzop Fixed in Version => 4.0.18
2018-04-22 09:38 syzop Note Added: 0020102