Allow only meshnode glue in controller inventory #9

Merged
cora merged 1 commits from fix-controller-inventory-crash into master 2021-08-26 02:07:02 +02:00
Owner
Description

If a meshnode controller was trying to make sense of metadata from an
item other than meshnode glue, the server would crash. To prevent this,
only meshnode glue is allowed to be in a meshnode controller inventory.

Solution

The code explicitly verifies that the item put in a meshnode controller
has the name meshnode:glue and forbids putting anything else into a
meshnode controller inventory.

Isssue

This PR addresses issue #3 entirely.

Verify Bug
  1. Create a new world with the default game (“Minetest game”)
  2. Check out commit ab6d4df25f of the meshnode mod.
  3. Activate the “meshnode” mod for the new world.
  4. Enter the world in survival mode.
  5. Execute the following commands: Verify that you have a meshnode controller and a stone block in your inventory afterwards.
    • /grantme give
    • /giveme meshnode:controller
    • /giveme default:stone
  6. Place the meshnode controller on the ground.
  7. Rightclick the meshnode controller: Verify that you see the meshnode controller inventory.
  8. Leftclick the meshnode glue, then leftclick the stone block: Verify that the server crashes.
Verify Patch
  1. Check out commit 3dcfa8b324 of the meshnode mod.
  2. Enter the previously created world in survival mode.
  3. Rightclick the meshnode controller: Verify that you see the meshnode controller inventory.
  4. Leftclick the meshnode glue, then leftclick the stone block: Verify that the server does not crash.
  5. Leftclick an empty slot in your inventory: Verify that the meshnode glue is put in your inventory.
  6. Leftclick the stone block, then leftclick the empty slot where the meshnode glue previously had been: Verify that the stone block does not end up in the inventory slot you clicked.
##### Description If a meshnode controller was trying to make sense of metadata from an item other than meshnode glue, the server would crash. To prevent this, only meshnode glue is allowed to be in a meshnode controller inventory. ##### Solution The code explicitly verifies that the item put in a meshnode controller has the name `meshnode:glue` and forbids putting anything else into a meshnode controller inventory. ##### Isssue This PR addresses issue #3 entirely. ##### Verify Bug 1. Create a new world with the default game (“Minetest game”) 2. Check out commit ab6d4df25fe4427ef67a89fb8beebe0dd5bef924 of the meshnode mod. 3. Activate the “meshnode” mod for the new world. 4. Enter the world in survival mode. 5. Execute the following commands: Verify that you have a meshnode controller and a stone block in your inventory afterwards. * /grantme give * /giveme meshnode:controller * /giveme default:stone 6. Place the meshnode controller on the ground. 7. Rightclick the meshnode controller: Verify that you see the meshnode controller inventory. 9. Leftclick the meshnode glue, then leftclick the stone block: Verify that the server crashes. ##### Verify Patch 1. Check out commit 3dcfa8b32498a11d1cc8566a15f404faf3c87365 of the meshnode mod. 2. Enter the previously created world in survival mode. 3. Rightclick the meshnode controller: Verify that you see the meshnode controller inventory. 4. Leftclick the meshnode glue, then leftclick the stone block: Verify that the server does not crash. 5. Leftclick an empty slot in your inventory: Verify that the meshnode glue is put in your inventory. 6. Leftclick the stone block, then leftclick the empty slot where the meshnode glue previously had been: Verify that the stone block does not end up in the inventory slot you clicked.
erlehmann added 1 commit 2021-08-26 01:42:49 +02:00
3dcfa8b324
Allow only meshnode glue in controller inventory
If a meshnode controller was trying to make sense of metadata from an
item other than meshnode glue, the server would crash. To prevent this,
only meshnode glue is allowed to be in a meshnode controller inventory.
erlehmann changed title from WIP: Allow only meshnode glue in controller inventory to Allow only meshnode glue in controller inventory 2021-08-26 01:58:24 +02:00
cora approved these changes 2021-08-26 02:06:53 +02:00
cora left a comment
Member
Verify Bug
  • 1. Create a new world with the default game (“Minetest game”)
  • 2. Check out commit ab6d4df25f of the meshnode mod.
  • 3. Activate the “meshnode” mod for the new world.
  • 4. Enter the world in survival mode.
  • 5. Execute the following commands: Verify that you have a meshnode controller and a stone block in your inventory afterwards.
    • /grantme give
    • /giveme meshnode:controller
    • /giveme default:stone
  • 6. Place the meshnode controller on the ground.
  • 7. Rightclick the meshnode controller: Verify that you see the meshnode controller inventory.
  • 9. Leftclick the meshnode glue, then leftclick the stone block: Verify that the server crashes.
Verify Patch
  • 1. Check out commit 3dcfa8b324 of the meshnode mod.
  • 2. Enter the previously created world in survival mode.
  • 3. Rightclick the meshnode controller: Verify that you see the meshnode controller inventory.
  • 4. Leftclick the meshnode glue, then leftclick the stone block: Verify that the server does not crash.
  • 5. Leftclick an empty slot in your inventory: Verify that the meshnode glue is put in your inventory.
  • 6. Leftclick the stone block, then leftclick the empty slot where the meshnode glue previously had been: Verify that the stone block does not end up in the inventory slot you clicked.
##### Verify Bug - [x] 1. Create a new world with the default game (“Minetest game”) - [x] 2. Check out commit ab6d4df25fe4427ef67a89fb8beebe0dd5bef924 of the meshnode mod. - [x] 3. Activate the “meshnode” mod for the new world. - [x] 4. Enter the world in survival mode. - [x] 5. Execute the following commands: Verify that you have a meshnode controller and a stone block in your inventory afterwards. * /grantme give * /giveme meshnode:controller * /giveme default:stone - [x] 6. Place the meshnode controller on the ground. - [x] 7. Rightclick the meshnode controller: Verify that you see the meshnode controller inventory. - [x] 9. Leftclick the meshnode glue, then leftclick the stone block: Verify that the server crashes. ##### Verify Patch - [x] 1. Check out commit 3dcfa8b32498a11d1cc8566a15f404faf3c87365 of the meshnode mod. - [x] 2. Enter the previously created world in survival mode. - [x] 3. Rightclick the meshnode controller: Verify that you see the meshnode controller inventory. - [x] 4. Leftclick the meshnode glue, then leftclick the stone block: Verify that the server does not crash. - [x] 5. Leftclick an empty slot in your inventory: Verify that the meshnode glue is put in your inventory. - [x] 6. Leftclick the stone block, then leftclick the empty slot where the meshnode glue previously had been: Verify that the stone block does not end up in the inventory slot you clicked.
cora merged commit 256b8331bc into master 2021-08-26 02:07:02 +02:00
cora deleted branch fix-controller-inventory-crash 2021-08-26 02:07:12 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Mineclonia/mcl_meshnode#9
No description provided.