From c36d91bd4ebf767f310f7cea88d61d1c15f53ddf Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Fri, 22 Jul 2016 03:39:13 +0000 Subject: upstream commit move debug("%p", key) to before key is free'd; probable undefined behaviour on strict compilers; reported by Jakub Jelen bz#2581 Upstream-ID: 767f323e1f5819508a0e35e388ec241bac2f953a --- monitor.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index fbe965e7c..cb57bd066 100644 --- a/monitor.c +++ b/monitor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor.c,v 1.160 2016/05/02 10:26:04 djm Exp $ */ +/* $OpenBSD: monitor.c,v 1.161 2016/07/22 03:39:13 djm Exp $ */ /* * Copyright 2002 Niels Provos * Copyright 2002 Markus Friedl @@ -1258,6 +1258,10 @@ mm_answer_keyallowed(int sock, Buffer *m) break; } } + + debug3("%s: key %p is %s", + __func__, key, allowed ? "allowed" : "not allowed"); + if (key != NULL) key_free(key); @@ -1279,9 +1283,6 @@ mm_answer_keyallowed(int sock, Buffer *m) free(chost); } - debug3("%s: key %p is %s", - __func__, key, allowed ? "allowed" : "not allowed"); - buffer_clear(m); buffer_put_int(m, allowed); buffer_put_int(m, forced_command != NULL); -- cgit v1.2.3