shithub: mq

Download patch

ref: 867e7df735bf5f1556e7894dfedeffc6bb880c55
parent: 2febe85dcc87dfe6356cc851c5f0825bdfcefb91
author: kvik <[email protected]>
date: Fri Sep 11 14:20:28 EDT 2020

mq-cat: null-terminate correct buffer

--- a/src/mq-cat.c
+++ b/src/mq-cat.c
@@ -98,7 +98,7 @@
 	for(;;){
 		if((n = read(orderfd, name, sizeof(name)-1)) == 0)
 			break;
-		buf[n] = 0;
+		name[n] = 0;
 		for(i = 0, s = streams; i < nstreams; i++, s++){
 			if(strcmp(s->name, name) != 0 || s->fd == -1)
 				continue;