check that old data exists when it is necessary
authorEugene Crosser <crosser@average.org>
Fri, 10 Nov 2017 01:27:01 +0000 (02:27 +0100)
committerEugene Crosser <crosser@average.org>
Mon, 20 Apr 2020 18:46:20 +0000 (20:46 +0200)
authobj.c

index deba02868152e70a575194b452ac828d1d1e903f..b4a1f2be26e1f3e3a284a128a5a6ba49c2aac954 100644 (file)
--- a/authobj.c
+++ b/authobj.c
@@ -241,6 +241,10 @@ struct _auth_obj authobj(const char *userid, const char *password,
        struct _auth_obj new_ao = {0};
 
        if (!secret || !secsize || !payload) {
+               if (!ablob || !blobsize) {
+                       new_ao.err = "authobj: previous data not supplied";
+                       return new_ao;
+               }
                old_ao = parse_authobj(userid, password, oldnonce,
                                        secret, secsize,
                                        ablob, blobsize, fetch_key);