Infinite loop in spfquery.c:unimplemented()

Magnus Holmgren <[email protected]>
Newsgroups gmane.mail.spam.spf.devel
Organization Lysator ACS
Message-ID <[email protected]>
There is a silly bug in unimplemented() that causes spfquery to enter an
infinite loop if an unimplemented option is used. Nothing critical, but
silly. This patch fixes it:

diff -urNad libspf2-1.2.5.dfsg~/src/spfquery/spfquery.c libspf2-1.2.5.dfsg/src/spfquery/spfquery.c
--- libspf2-1.2.5.dfsg~/src/spfquery/spfquery.c	2005-02-22 03:36:55.000000000 +0100
+++ libspf2-1.2.5.dfsg/src/spfquery/spfquery.c	2007-03-24 22:28:15.000000000 +0100
@@ -174,9 +174,7 @@
 	struct option	*opt;
 	int				 i;
 
-	i = 0;
-	opt = &long_options[i];
-	while (opt->name) {
+	for (i = 0; (opt = &long_options[i])->name; i++) {
 		if (flag == opt->val) {
 			fprintf(stderr, "Unimplemented option: -%s or -%c\n",
 							opt->name, flag);

-- 
Magnus Holmgren        [email protected]
                       (No Cc of list mail needed, thanks)

  "Exim is better at being younger, whereas sendmail is better for 
   Scrabble (50 point bonus for clearing your rack)" -- Dave Evans

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?list_id=1007
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBGBcW+k7mRNn1h4+YRApoAAKCiaSaAwBUd5fhAUt4XlIKmkwpzzQCgh7aO
wbPh00m5/jr71VCJhf68t60=
=NTy4
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.