From b3758323ed721fee3f3a3d01f717dce9a395b579 Mon Sep 17 00:00:00 2001
From: hniksic <devnull@localhost>
Date: Wed, 1 Nov 2000 15:57:19 -0800
Subject: [PATCH] [svn] Applied contributed fix.

---
 src/ChangeLog | 5 +++++
 src/url.c     | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 18f28cc4..f4f7336f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-02  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+	* url.c (parseurl): Remove possible reading past the end of
+	sup_protos[].  Spotted by Mark A. Mankins <Mankins_Mark@prc.com>.
+
 2000-11-01  Hrvoje Niksic  <hniksic@arsdigita.com>
 
 	* main.c (main): In case of opt.downloaded overflowing, print
diff --git a/src/url.c b/src/url.c
index 5447c104..892e750a 100644
--- a/src/url.c
+++ b/src/url.c
@@ -405,7 +405,7 @@ parseurl (const char *url, struct urlinfo *u, int strict)
     }
   /* If protocol is recognizable, but unsupported, bail out, else
      suppose unknown.  */
-  if (recognizable && !sup_protos[i].name)
+  if (recognizable && i == ARRAY_SIZE (sup_protos))
     return URLUNKNOWN;
   else if (i == ARRAY_SIZE (sup_protos))
     type = URLUNKNOWN;