aboutsummaryrefslogtreecommitdiffstats
path: root/gpgme/vasprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'gpgme/vasprintf.c')
-rw-r--r--gpgme/vasprintf.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gpgme/vasprintf.c b/gpgme/vasprintf.c
index 9e39966a..30b5e83f 100644
--- a/gpgme/vasprintf.c
+++ b/gpgme/vasprintf.c
@@ -97,7 +97,13 @@ int_vasprintf (result, format, args)
total_width += 307;
break;
case 's':
- total_width += strlen (va_arg (ap, char *));
+ {
+ char *tmp = va_arg (ap, char *);
+ if (tmp)
+ total_width += strlen (tmp);
+ else /* in case the vsprintf does prints a text */
+ total_width += 25; /* e.g. "(null pointer reference)" */
+ }
break;
case 'p':
case 'n':