Commit 250cf666 authored by niukuo's avatar niukuo

fix wrong length in remote schema

Change-Id: Ia96ddf5746f1c18968e9e086f17fe4a24b8480d7
parent 9bd618f5
...@@ -1473,7 +1473,7 @@ private: ...@@ -1473,7 +1473,7 @@ private:
if (i > 0) { // Remote reference, resolve immediately if (i > 0) { // Remote reference, resolve immediately
if (remoteProvider_) { if (remoteProvider_) {
if (const GenericSchemaDocument* remoteDocument = remoteProvider_->GetRemoteDocument(s, i - 1)) { if (const GenericSchemaDocument* remoteDocument = remoteProvider_->GetRemoteDocument(s, i)) {
PointerType pointer(&s[i], len - i, allocator_); PointerType pointer(&s[i], len - i, allocator_);
if (pointer.IsValid()) { if (pointer.IsValid()) {
if (const SchemaType* sc = remoteDocument->GetSchema(pointer)) { if (const SchemaType* sc = remoteDocument->GetSchema(pointer)) {
......
...@@ -1101,7 +1101,7 @@ public: ...@@ -1101,7 +1101,7 @@ public:
}; };
for (size_t i = 0; i < kCount; i++) for (size_t i = 0; i < kCount; i++)
if (strncmp(uri, uris[i], length) == 0) if (strncmp(uri, uris[i], length) == 0 && strlen(uris[i]) == length)
return sd_[i]; return sd_[i];
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment