]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1229] autokey segfaults in cert_install()
authorHarlan Stenn <stenn@ntp.org>
Thu, 18 Jun 2009 07:54:37 +0000 (03:54 -0400)
committerHarlan Stenn <stenn@ntp.org>
Thu, 18 Jun 2009 07:54:37 +0000 (03:54 -0400)
bk: 4a39f2bdOkqBaJuNOBq5q6TLc1Z9sw

ChangeLog
ntpd/ntp_crypto.c

index e8a4ade80c93acb37257c925ad90f0203a46ce0e..92ca4c40e95e025dc3b906b668e3ede90b9d4718 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* [Bug 1229] autokey segfaults in cert_install().
 (4.2.5p181) 2009/06/06 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 1206] Required compiler changes for Windows
 * [Bug 1084] PPSAPI for ntpd on Windows with DLL backends
index 819eca85ea70e432d68ccbba845d48d91f2cf2d6..fd33b7f14a0abcf7f41d7b2c00df31051de470d0 100644 (file)
@@ -3060,7 +3060,7 @@ cert_install(
        struct peer *peer       /* peer structure */
        )
 {
-       struct cert_info *cp, *xp, *yp, **zp;
+       struct cert_info *cp, *xp, **zp;
 
        /*
         * Parse and validate the signed certificate. If valid,
@@ -3092,15 +3092,14 @@ cert_install(
                            ntohl(xp->cert.fstamp)) {
                                cert_free(cp);
                                cp = xp;
-                               break;
+                       } else {
+                               *zp = xp->link;
+                               cert_free(xp);
+                               xp = NULL;
                        }
-                       yp = xp;
-                       xp = xp->link;
-                       *zp = xp;
-                       cert_free(yp);
-               } else {
-                       zp = &xp->link;
+                       break;
                }
+               zp = &xp->link;
        }
        if (xp == NULL) {
                cp->link = cinfo;