From c78ca77f70dfd60f3b580826cf45b8a4de4496ca Mon Sep 17 00:00:00 2001 From: dlg Date: Tue, 7 Jan 2014 00:11:11 +0000 Subject: [PATCH] the return from asprintf does NOT include the space used by the terminating \0 character. if i want to use it as a c string i have to take that into account. found by simon kuhnle who supplied a good bug report. prodded by deraadt@ --- usr.sbin/identd/identd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/identd/identd.c b/usr.sbin/identd/identd.c index 0cfef24baa6..6e628e8df34 100644 --- a/usr.sbin/identd/identd.c +++ b/usr.sbin/identd/identd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: identd.c,v 1.23 2013/11/21 03:09:07 dlg Exp $ */ +/* $OpenBSD: identd.c,v 1.24 2014/01/07 00:11:11 dlg Exp $ */ /* * Copyright (c) 2013 David Gwynne @@ -395,7 +395,7 @@ parent_rd(int fd, short events, void *arg) goto done; } - r->buflen = n; + r->buflen = n + 1; done: SIMPLEQ_INSERT_TAIL(&sc.parent.replies, r, entry); -- 2.20.1