mirror of
				https://github.com/Klipper3d/klipper.git
				synced 2025-10-31 02:15:52 +01:00 
			
		
		
		
	serialqueue: Be sure sq->name is null terminated
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
		| @@ -43,11 +43,11 @@ struct serialqueue { | ||||
|     uint8_t need_sync; | ||||
|     int input_pos; | ||||
|     // Threading | ||||
|     char name[16]; | ||||
|     pthread_t tid; | ||||
|     pthread_mutex_t lock; // protects variables below | ||||
|     pthread_cond_t cond; | ||||
|     int receive_waiting; | ||||
|     char name[16]; | ||||
|     // Baud / clock tracking | ||||
|     int receive_window; | ||||
|     double bittime_adjust, idle_time; | ||||
| @@ -634,6 +634,7 @@ serialqueue_alloc(int serial_fd, char serial_fd_type, int client_id | ||||
|     sq->serial_fd_type = serial_fd_type; | ||||
|     sq->client_id = client_id; | ||||
|     strncpy(sq->name, name, sizeof(sq->name)); | ||||
|     sq->name[sizeof(sq->name)-1] = '\0'; | ||||
|  | ||||
|     int ret = pipe(sq->pipe_fds); | ||||
|     if (ret) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user