[Dovecot] [PATCH 2/5] replace some string literals with non-const static buffers

Max Kellermann max at duempel.org
Thu Mar 15 16:35:02 EET 2007


---

 src/login-common/master.c            |    3 ++-
 src/login-common/ssl-proxy-openssl.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/login-common/master.c b/src/login-common/master.c
index 59677a3..26a3d4b 100644
--- a/src/login-common/master.c
+++ b/src/login-common/master.c
@@ -133,7 +133,8 @@ void master_close(void)
 
 static void master_exec(int fd)
 {
-	char *argv[] = { "dovecot", NULL };
+	static char dovecot[] = "dovecot";
+	char *argv[] = { dovecot, NULL };
 
 	switch (fork()) {
 	case -1:
diff --git a/src/login-common/ssl-proxy-openssl.c b/src/login-common/ssl-proxy-openssl.c
index 5c0f9f6..1d0dda5 100644
--- a/src/login-common/ssl-proxy-openssl.c
+++ b/src/login-common/ssl-proxy-openssl.c
@@ -665,6 +665,7 @@ unsigned int ssl_proxy_get_count(void)
 
 void ssl_proxy_init(void)
 {
+	static char dovecot[] = "dovecot";
 	const char *cafile, *certfile, *keyfile, *cipher_list;
 	char *password;
 	unsigned char buf;
@@ -685,7 +686,7 @@ void ssl_proxy_init(void)
 	SSL_library_init();
 	SSL_load_error_strings();
 
-	extdata_index = SSL_get_ex_new_index(0, "dovecot", NULL, NULL, NULL);
+	extdata_index = SSL_get_ex_new_index(0, dovecot, NULL, NULL, NULL);
 
 	if ((ssl_ctx = SSL_CTX_new(SSLv23_server_method())) == NULL)
 		i_fatal("SSL_CTX_new() failed");



More information about the dovecot mailing list