mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	server: Test for illegally low interface versions in wl_global_create()
Any version lower than 1 is unreasonable. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
		
							parent
							
								
									16b4cc6902
								
							
						
					
					
						commit
						2b4c053924
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
					@ -908,6 +908,13 @@ wl_global_create(struct wl_display *display,
 | 
				
			||||||
	struct wl_global *global;
 | 
						struct wl_global *global;
 | 
				
			||||||
	struct wl_resource *resource;
 | 
						struct wl_resource *resource;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (version < 1) {
 | 
				
			||||||
 | 
							wl_log("wl_global_create: failing to create interface "
 | 
				
			||||||
 | 
							       "'%s' with version %d because it is less than 1\n",
 | 
				
			||||||
 | 
								interface->name, version);
 | 
				
			||||||
 | 
							return NULL;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (version > interface->version) {
 | 
						if (version > interface->version) {
 | 
				
			||||||
		wl_log("wl_global_create: implemented version for '%s' "
 | 
							wl_log("wl_global_create: implemented version for '%s' "
 | 
				
			||||||
		       "higher than interface version (%d > %d)\n",
 | 
							       "higher than interface version (%d > %d)\n",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue