mike-jumper commented on a change in pull request #219: GUACAMOLE-422: Add 
timezone to client handshake
URL: https://github.com/apache/guacamole-server/pull/219#discussion_r268487249
 
 

 ##########
 File path: src/protocols/rdp/rdp_settings.c
 ##########
 @@ -854,6 +854,10 @@ guac_rdp_settings* guac_rdp_parse_args(guac_user* user,
     settings->timezone =
         guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv,
                 IDX_TIMEZONE, NULL);
+    
+    /* If no timezone explicitly set, try to pull from tunnel */
+    if (settings->timezone == NULL)
+        settings->timezone = user->info.timezone;
 
 Review comment:
   Later code expects that `settings->timezone` is dynamically allocated. If 
assigned directly from `user->info.timezone`, this will not be the case and 
you'll end up with the same memory being freed twice.
   
   Rather than implementing this logic manually, you can instead rely on 
`guac_user_parse_args_string()`, which allows for default values and will 
always dynamically allocate its return value when not `NULL`:
   
   
https://guacamole.apache.org/doc/libguac/user_8h.html#a7530b31b5a621a4f68fdce4bee2bdc5f

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to