Skip to content

Harden parsing of messages from pipe #142

@jamill

Description

@jamill

This bug presents itself when you stage a region in VS Code.

Open a GVFS Repository with VS Code
Make some changes to a file
Select a region of the file in the editor, right click and “Stage selected range”

This is the command run:

/.git/hooks/pre-command.exe update-index --cacheinfo 100644 '7e012a87091a0f76de43fcbd83098b3611791643
' Scripts/ReinstallGVFS.bat --git-pid=20360

Notice the newline in the command.

The InMount process does not like this, and crashes with something similar to (this doesn't necessarily correspond to the instance above):

The parsedCommand is an unexpected length, got: 123 from message: '7580|False|False|123|git update-index --cacheinfo 100644 f7ce833c943b1d4e33fce3c842236c9c044561c9'\r\n

If this is a valid format for a git command, then VFS for Git should be able to parse it.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions