Cleanup: limit length of strings scanned by scanf.
[silc.git] / apps / silc / clientutil.c
index 95a37422e75a815a0bc0a4d900899f28c3fef5b9..6a41a7c93970025b48b825e2f2d29f656db80f79 100644 (file)
@@ -113,7 +113,7 @@ int silc_get_number_of_emails()
   if (!tl) {
     fprintf(stderr, "Couldn't open mail file (%s).\n", filename);
   } else {
-    while((fscanf(tl, "%s", data)) != EOF) { 
+    while((fscanf(tl, "%1023s", data)) != EOF) {
       if(!strcmp(data, "From:"))
        num++;
     }
@@ -333,7 +333,7 @@ int silc_client_create_key_pair(char *pkcs_name, int bits,
   SilcPrivateKey prv_key;
   SilcRng rng;
   unsigned char *key;
-  uint32 key_len;
+  SilcUInt32 key_len;
   char line[256];
   char *pkfile = NULL, *prvfile = NULL;
 
@@ -357,7 +357,7 @@ New pair of keys will be created.  Please, answer to following questions.\n\
   }
 
   if (!silc_pkcs_is_supported(pkcs_name)) {
-    fprintf(stderr, "Unsupported PKCS `%s'", pkcs_name);
+    fprintf(stderr, "Unknown PKCS `%s'", pkcs_name);
     return FALSE;
   }
 
@@ -720,7 +720,7 @@ int silc_client_show_key(char *keyfile)
   SilcPublicKeyIdentifier ident;
   char *fingerprint;
   unsigned char *pk;
-  uint32 pk_len;
+  SilcUInt32 pk_len;
   SilcPKCS pkcs;
   int key_len = 0;