]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Escape local_name
authorAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 20 Oct 2016 13:30:49 +0000 (16:30 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 20 Oct 2016 20:04:41 +0000 (23:04 +0300)
src/auth/auth-request.c
src/lib-auth/auth-client-request.c

index 64fa69167860b006e3d5a8b18983c8a0eb107584..539f1f74d15b49b6ed18add59f59bada945007f8 100644 (file)
@@ -319,8 +319,10 @@ void auth_request_export(struct auth_request *request, string_t *dest)
                str_printfa(dest, "\treal_lport=%u", request->real_local_port);
        if (request->real_remote_port != 0)
                str_printfa(dest, "\treal_rport=%u", request->real_remote_port);
-       if (request->local_name != 0)
-               str_printfa(dest, "\tlocal_name=%s", request->local_name);
+       if (request->local_name != 0) {
+               str_append(dest, "\tlocal_name=");
+               str_append_tabescaped(dest, request->local_name);
+       }
        if (request->session_id != NULL)
                str_printfa(dest, "\tsession=%s", request->session_id);
        if (request->debug)
index 968dc98e8f58e5ec018551ef7276282b3389ece6..c25a1d760b891babc9051dadab935ac722ab7171 100644 (file)
@@ -81,8 +81,10 @@ static void auth_server_send_new_request(struct auth_server_connection *conn,
            info->real_remote_port != info->remote_port)
                str_printfa(str, "\treal_rport=%u", info->real_remote_port);
        if (info->local_name != NULL &&
-           *info->local_name != '\0')
-               str_printfa(str, "\tlocal_name=%s", info->local_name);
+           *info->local_name != '\0') {
+               str_append(str, "\tlocal_name=");
+               str_append_tabescaped(str, info->local_name);
+       }
        if (info->initial_resp_base64 != NULL) {
                str_append(str, "\tresp=");
                str_append_tabescaped(str, info->initial_resp_base64);