mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	connection: Fix broken log message when demarshalling short closure
Like the similar wl_log() message further into this function that was
fixed in commit 2fc248dc2c this should
be printing the sender_id saved earlier instead of *p.
Since p is incremented during the loop it would not only print an
incorrect object id, it could read past the end of the array.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
			
			
This commit is contained in:
		
							parent
							
								
									9fa60983b5
								
							
						
					
					
						commit
						68398ec2ce
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -710,7 +710,8 @@ wl_connection_demarshal(struct wl_connection *connection,
 | 
				
			||||||
		if (arg.type != 'h' && p + 1 > end) {
 | 
							if (arg.type != 'h' && p + 1 > end) {
 | 
				
			||||||
			wl_log("message too short, "
 | 
								wl_log("message too short, "
 | 
				
			||||||
			       "object (%d), message %s(%s)\n",
 | 
								       "object (%d), message %s(%s)\n",
 | 
				
			||||||
			       *p, message->name, message->signature);
 | 
								       closure->sender_id, message->name,
 | 
				
			||||||
 | 
								       message->signature);
 | 
				
			||||||
			errno = EINVAL;
 | 
								errno = EINVAL;
 | 
				
			||||||
			goto err;
 | 
								goto err;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue