فهرست منبع

Don't go out of bounds when slicing (fixes #241)

Manish Goregaokar 9 سال پیش
والد
کامیت
c5dbeb53c9
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/lib.rs

+ 1 - 1
src/lib.rs

@@ -498,7 +498,7 @@ impl Url {
     /// as is typically the case of `data:` and `mailto:` URLs.
     #[inline]
     pub fn cannot_be_a_base(&self) -> bool {
-        self.byte_at(self.path_start) != b'/'
+        !self.slice(self.path_start..).starts_with('/')
     }
 
     /// Return the username for this URL (typically the empty string)