On Thu, Jul 13, 2017 at 08:43:42AM +0200, Theo Buehler wrote:
> Found this in my /var/log/messages:
>
> pidgin: vfprintf %s NULL in "DC%d '%.*s' update: %.*s:%d "
>
> Turns out that bl_do_dc_option() in tgl/binlog.c:61 passes its 'name'
> parameter via some wrappers to vfprintf, so it shouldn't be NULL.
>
> Most callers pass the empty string, except for two.
> These are fixed in the patch below.
>
> ok?
Same code as before. I added comments briefly explaining the patches.
Index: Makefile
===================================================================
RCS file: /var/cvs/ports/net/telegram-purple/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile 24 Jun 2017 00:20:17 -0000 1.1.1.1
+++ Makefile 13 Jul 2017 06:29:02 -0000
@@ -1,6 +1,7 @@
# $OpenBSD: Makefile,v 1.1.1.1 2017/06/24 00:20:17 czarkoff Exp $
V = 1.3.1
+REVISION = 0
COMMENT = Telegram support for Pidgin
DISTNAME = telegram-purple_$V.orig
PKGNAME = telegram-purple-$V
Index: patches/patch-tgl_queries_c
===================================================================
RCS file: patches/patch-tgl_queries_c
diff -N patches/patch-tgl_queries_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tgl_queries_c 13 Jul 2017 06:49:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Avoid vfprintf %s NULL
+
+Index: tgl/queries.c
+--- tgl/queries.c.orig
++++ tgl/queries.c
+@@ -818,7 +818,7 @@ static char *process_html_text (struct tgl_state *TLS,
+ /* {{{ Get config */
+
+ static void fetch_dc_option (struct tgl_state *TLS, struct tl_ds_dc_option
*DS_DO) {
+- bl_do_dc_option (TLS, DS_LVAL (DS_DO->flags), DS_LVAL (DS_DO->id), NULL, 0,
DS_STR (DS_DO->ip_address), DS_LVAL (DS_DO->port));
++ bl_do_dc_option (TLS, DS_LVAL (DS_DO->flags), DS_LVAL (DS_DO->id), "", 0,
DS_STR (DS_DO->ip_address), DS_LVAL (DS_DO->port));
+ }
+
+ static int help_get_config_on_answer (struct tgl_state *TLS, struct query *q,
void *DS) {
Index: patches/patch-tgl_updates_c
===================================================================
RCS file: patches/patch-tgl_updates_c
diff -N patches/patch-tgl_updates_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tgl_updates_c 13 Jul 2017 06:55:31 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Avoid vfprintf %s NULL
+
+Index: tgl/updates.c
+--- tgl/updates.c.orig
++++ tgl/updates.c
+@@ -37,7 +37,7 @@ void tgl_do_get_channel_difference (struct tgl_state *
+ static void fetch_dc_option (struct tgl_state *TLS, struct tl_ds_dc_option
*DS_DO) {
+ vlogprintf (E_DEBUG, "id = %d, %.*s:%d\n", DS_LVAL (DS_DO->id), DS_RSTR
(DS_DO->ip_address), DS_LVAL (DS_DO->port));
+
+- bl_do_dc_option (TLS, DS_LVAL (DS_DO->flags), DS_LVAL (DS_DO->id), NULL, 0,
DS_STR (DS_DO->ip_address), DS_LVAL (DS_DO->port));
++ bl_do_dc_option (TLS, DS_LVAL (DS_DO->flags), DS_LVAL (DS_DO->id), "", 0,
DS_STR (DS_DO->ip_address), DS_LVAL (DS_DO->port));
+ }
+
+ int tgl_check_pts_diff (struct tgl_state *TLS, int pts, int pts_count) {