[seahorse] Stop parsing SSH private keys if all data was consumed.



commit ad9638ace3f799161b26a325c1be505ba5e43d8c
Author: Stef Walter <stefw collabora co uk>
Date:   Thu Mar 10 17:49:46 2011 +0100

    Stop parsing SSH private keys if all data was consumed.
    
    This fixes a crash.

 ssh/seahorse-ssh-key-data.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/ssh/seahorse-ssh-key-data.c b/ssh/seahorse-ssh-key-data.c
index b140394..dfb562c 100644
--- a/ssh/seahorse-ssh-key-data.c
+++ b/ssh/seahorse-ssh-key-data.c
@@ -261,6 +261,10 @@ seahorse_ssh_key_data_parse (const gchar *data, SeahorseSSHPublicKeyParsed publi
                 if (!(secret_cb) (secdata, arg))
                     break;
             }
+
+            if (!*l)
+                break;
+            line = *l;
         }
         
         /* Comments and empty lines, not a parse error, but no data */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]