2004-12-05 Moritz Schulte <moritz@g10code.com>
authorMoritz Schulte <mo@g10code.com>
Sun, 5 Dec 2004 15:36:49 +0000 (15:36 +0000)
committerMoritz Schulte <mo@g10code.com>
Sun, 5 Dec 2004 15:36:49 +0000 (15:36 +0000)
* query.c (start_pinentry): Allow CTRL be NULL.

agent/ChangeLog
agent/query.c

index 756711f..e0bf52b 100644 (file)
@@ -1,3 +1,7 @@
+2004-12-05  Moritz Schulte  <moritz@g10code.com>
+
+       * query.c (start_pinentry): Allow CTRL be NULL.
+
 2004-10-22  Werner Koch  <wk@g10code.com>
 
        * gpg-agent.c (parse_rereadable_options): Return "not handled"
index b514f6f..cdf6ff2 100644 (file)
@@ -152,7 +152,7 @@ start_pinentry (CTRL ctrl)
     pgmname++;
 
   argv[0] = pgmname;
-  if (ctrl->display && !opt.keep_display)
+  if (ctrl && ctrl->display && !opt.keep_display)
     {
       argv[1] = "--display";
       argv[2] = ctrl->display;
@@ -189,7 +189,7 @@ start_pinentry (CTRL ctrl)
                         NULL, NULL, NULL, NULL, NULL, NULL);
   if (rc)
     return unlock_pinentry (map_assuan_err (rc));
-  if (ctrl->ttyname)
+  if (ctrl && ctrl->ttyname)
     {
       char *optstr;
       if (asprintf (&optstr, "OPTION ttyname=%s", ctrl->ttyname) < 0 )
@@ -200,7 +200,7 @@ start_pinentry (CTRL ctrl)
       if (rc)
        return unlock_pinentry (map_assuan_err (rc));
     }
-  if (ctrl->ttytype)
+  if (ctrl && ctrl->ttytype)
     {
       char *optstr;
       if (asprintf (&optstr, "OPTION ttytype=%s", ctrl->ttytype) < 0 )
@@ -210,7 +210,7 @@ start_pinentry (CTRL ctrl)
       if (rc)
        return unlock_pinentry (map_assuan_err (rc));
     }
-  if (ctrl->lc_ctype)
+  if (ctrl && ctrl->lc_ctype)
     {
       char *optstr;
       if (asprintf (&optstr, "OPTION lc-ctype=%s", ctrl->lc_ctype) < 0 )
@@ -220,7 +220,7 @@ start_pinentry (CTRL ctrl)
       if (rc)
        return unlock_pinentry (map_assuan_err (rc));
     }
-  if (ctrl->lc_messages)
+  if (ctrl && ctrl->lc_messages)
     {
       char *optstr;
       if (asprintf (&optstr, "OPTION lc-messages=%s", ctrl->lc_messages) < 0 )