diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-09-07 12:34:39 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-09-07 12:34:39 +0000 |
commit | 491856cbb79b2f643facf291c1918bfb919966bd (patch) | |
tree | 3e30c8b8826413f3c07902d0580cfd356be00238 /pgpkey.c | |
parent | 458307e72af511d2fad7961fdd180f02b9f77256 (diff) |
Fix a strtok NULL pointer problem.
Diffstat (limited to 'pgpkey.c')
-rw-r--r-- | pgpkey.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -718,15 +718,17 @@ BODY *pgp_make_key_attachment (char *tempf) static LIST *pgp_add_string_to_hints (LIST *hints, const char *str) { - char *scratch = safe_strdup (str); + char *scratch; char *t; - - t = strtok (scratch, " ,.:\"()<>\n"); - while (t) + + if ((scratch = safe_strdup (str)) == NULL) + return hints; + + for (t = strtok (scratch, " ,.:\"()<>\n"); t; + t = strtok (NULL, " ,.:\"()<>\n")) { if (strlen (t) > 3) hints = mutt_add_list (hints, t); - t = strtok (NULL, " ,.:\"()<>\n"); } safe_free ((void **) &scratch); |