From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Tue, 18 Apr 2023 15:08:05 +0200
Subject: fix: preventing potential oob in ada NO_SCHEME parsing

https://github.com/ada-url/ada/pull/286

diff --git a/deps/ada/ada.cpp b/deps/ada/ada.cpp
index 7d2f75fe559c1878e129aa681c86d6780d2e8233..7bf541834d22511eefcc58517cc75117f53eb475 100644
--- a/deps/ada/ada.cpp
+++ b/deps/ada/ada.cpp
@@ -2243,7 +2243,8 @@ namespace ada::parser {
           ada_log("NO_SCHEME ", helpers::substring(url_data, input_position));
           // If base is null, or base has an opaque path and c is not U+0023 (#), validation error, return failure.
           // SCHEME state updates the state to NO_SCHEME and validates url_data is not empty.
-          if (base_url == nullptr || (base_url->has_opaque_path && url_data[input_position] != '#')) {
+          if (base_url == nullptr ||
+              (base_url->has_opaque_path && !fragment.has_value())) {
             ada_log("NO_SCHEME validation error");
             url.is_valid = false;
             return url;
