Removing a trade path in router will cause serious data corruption
The RouterInfo represents a single UniV3-compatible router which supports a list of token paths. It uses the following data structures:\\n```\\n         mapping(address => mapping(address => listInfo)) private allowedPairsMap;\\n                  pair[] private allowedPairsList;\\n```\\n\\n```\\n          struct listInfo {\\n               bool allowed;\\n                uint256 listPosition;\\n         }\\n         struct pair {\\n            address token0;\\n               address token1;\\n                  uint256 numPathsAllowed;\\n          }\\n```\\n\\nWhen an admin specifies a new path from token0 to token1, `_increasePairPaths()` is called.\\n```\\n               function _increasePairPaths(address token0, address token1) private {\\n                     listInfo storage LI = allowedPairsMap[token0][token1];\\n                  if (!LI.allowed){\\n                  LI.allowed = true;\\n                  LI.listPosition = allowedPairsList.length;\\n                      allowedPairsList.push(pair(token0, token1, 0));\\n                   }\\n                      allowedPairsList[LI.listPosition].numPathsAllowed++;\\n                   }\\n```\\n\\nWhen a path is removed, the complementary function is called.\\n```\\n      function _decreasePairPaths(address token0, address token1) private {\\n             listInfo storage LI = allowedPairsMap[token0][token1];\\n                require(LI.allowed, "RouterInfo: pair not allowed");\\n                   allowedPairsList[LI.listPosition].numPathsAllowed--;\\n            if (allowedPairsList[LI.listPosition].numPathsAllowed == 0){\\n         allowedPairsList[LI.listPosition] = \\n      allowedPairsList[allowedPairsList.length - 1];\\n         allowedPairsList.pop();\\n         LI.allowed = false;\\n      }\\n      }\\n```\\n\\nWhen the last path is removed, the contract reuses the index of the removed pair, to store the last pair in the list. It then removes the last pair, having already copied it. The issue is that the corresponding listInfo structure is not updated, to keep track of index in the pairs list. Future usage of the last pair will use a wrong index, which at this moment, is over the array bounds. When a new pair will be created, it will share the index with the corrupted pair. This can cause a variety of serious issues. For example, it will not be possible to remove paths from the corrupted pair until a new pair is created, at which point the new pair will have a wrong numPathsAllowed as it is shared.
Update the listPosition member of the last pair in the list, before repositioning it.
```\\n         mapping(address => mapping(address => listInfo)) private allowedPairsMap;\\n                  pair[] private allowedPairsList;\\n```\\n