Github user itsankoff commented on a diff in the pull request:

    
https://github.com/apache/incubator-guacamole-server/pull/120#discussion_r146669866
  
    --- Diff: src/protocols/vnc/user.c ---
    @@ -112,8 +112,10 @@ int guac_vnc_user_leave_handler(guac_user* user) {
     
         guac_vnc_client* vnc_client = (guac_vnc_client*) user->client->data;
     
    -    /* Update shared cursor state */
    -    guac_common_cursor_remove_user(vnc_client->display->cursor, user);
    +    if (vnc_client && vnc_client->display && vnc_client->display->cursor) {
    --- End diff --
    
    Yeah I know exactly which. The problem is that the display pointer is null. 
When I traced it, every time the server crashed the `display` pointer was 
`NULL`. My first modification was to check against `NULL` only for it, but then 
I thought it makes sense to check if we `vnc_client` is not `NULL` pointer 
before check for the `display`. And also I saw that ` 
guac_common_cursor_remove_user(vnc_client->display->cursor, user);` does not 
check when it dereference the cursor pointer.


---

Reply via email to