mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	scanner: Only strdup interface_name after making sure it's not NULL
This commit is contained in:
		
							parent
							
								
									cf04b0a18f
								
							
						
					
					
						commit
						44186b522f
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
					@ -231,10 +231,8 @@ start_element(void *data, const char *element_name, const char **atts)
 | 
				
			||||||
			arg->type = FD;
 | 
								arg->type = FD;
 | 
				
			||||||
		else if (strcmp(type, "new_id") == 0) {
 | 
							else if (strcmp(type, "new_id") == 0) {
 | 
				
			||||||
			arg->type = NEW_ID;
 | 
								arg->type = NEW_ID;
 | 
				
			||||||
			arg->interface_name = strdup(interface_name);
 | 
					 | 
				
			||||||
		} else if (strcmp(type, "object") == 0) {
 | 
							} else if (strcmp(type, "object") == 0) {
 | 
				
			||||||
			arg->type = OBJECT;
 | 
								arg->type = OBJECT;
 | 
				
			||||||
			arg->interface_name = strdup(interface_name);
 | 
					 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			fail(ctx, "unknown type");
 | 
								fail(ctx, "unknown type");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -244,6 +242,7 @@ start_element(void *data, const char *element_name, const char **atts)
 | 
				
			||||||
		case OBJECT:
 | 
							case OBJECT:
 | 
				
			||||||
			if (interface_name == NULL)
 | 
								if (interface_name == NULL)
 | 
				
			||||||
				fail(ctx, "no interface name given");
 | 
									fail(ctx, "no interface name given");
 | 
				
			||||||
 | 
								arg->interface_name = strdup(interface_name);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		default:
 | 
							default:
 | 
				
			||||||
			if (interface_name != NULL)
 | 
								if (interface_name != NULL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue