From 802a6eae09227622e3de27a9a7754a1f29a835e5 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Mon, 6 Jan 2020 12:10:47 +0100
Subject: [PATCH] xbps_dbg_printf{,_append}: add assertion

---
 lib/log.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/log.c b/lib/log.c
index 82c967bc..7cee498f 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -56,6 +56,8 @@ xbps_dbg_printf_append(struct xbps_handle *xhp, const char *fmt, ...)
 {
 	va_list ap;
 
+	assert(xhp);
+
 	if ((xhp->flags & XBPS_FLAG_DEBUG) == 0)
 		return;
 
@@ -69,6 +71,8 @@ xbps_dbg_printf(struct xbps_handle *xhp, const char *fmt, ...)
 {
 	va_list ap;
 
+	assert(xhp);
+
 	if ((xhp->flags & XBPS_FLAG_DEBUG) == 0)
 		return;