#1 2023-03-06 14:12:41

stuart
Member
Registered: 2022-03-08
Posts: 6

Access Violation in TRestRouter.Lookup when receiving PATCH request

If I build and run the MVCServer example project in ex\mvc-blog and send a PATCH request to http://localhost:8092/blog/mvc-info, I get an access violation in TRestRouter.Lookup in mormot.rest.server:

  // find the matching node in the URI Radix Tree
  result := nil;
  if (self = nil) or
     (Ctxt = nil) or
     (Ctxt.Call^.Url = '') or
     (Ctxt.Method < low(fTree)) or
     (Ctxt.Method > high(fTree)) then
    exit;
  p := pointer(Ctxt.Call^.Url);
  if p^ = '/' then
    inc(p);
  result := pointer((fTree[Ctxt.Method].Root as TRestTreeNode).Lookup(p, Ctxt)); //<-- AV here.

Target: Win32
Configuration: Debug
OS: Windows 10.

Last edited by stuart (2023-03-06 14:15:49)

Offline

#2 2023-03-06 15:25:08

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Access Violation in TRestRouter.Lookup when receiving PATCH request

Offline

#3 2023-03-06 16:27:06

stuart
Member
Registered: 2022-03-08
Posts: 6

Re: Access Violation in TRestRouter.Lookup when receiving PATCH request

Excellent, that's fixed it, thanks!

Offline

Board footer

Powered by FluxBB