GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix wrong data length written in `UnsafeBlitFormatter` by lynzrand · Pull Request #1551 · MessagePack-CSharp/MessagePack-CSharp

Conversation

@lynzrand

@lynzrand lynzrand commented Jan 20, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Closes #1550.

In this PR, I added a public API so that I can get the encoded length of an integer, and then fixed the issue using the first method I mentioned in #1550.

static MessagePack.MessagePackWriter.IntegerEncodedLength(long value) -> int
static MessagePack.MessagePackWriter.IntegerEncodedLength(ulong value) -> int

I have yet to look into the test folder and add tests at the time of writing. Just added tests.

This is my first PR to this project, so please tell me if I did anything wrong.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
lynzrand added 4 commits January 20, 2023 11:28
@lynzrand
Add integer encoded length as public API.
b12be77
This API is added for usage in `UnsafeBlitFormatter`.
@lynzrand
Fix wrong data length written in UnsafeBlitFormatter
8b190f9
This should fix MessagePack-CSharp#1550
@lynzrand
Fix formatting: no consecutive blank lines
756ee0b
@lynzrand
Add tests to ensure compatibility
a12cf47
@lynzrand
lynzrand marked this pull request as ready for review January 20, 2023 09:56
@lynzrand

lynzrand commented Jan 20, 2023

Copy link
Copy Markdown
Contributor Author

Just added tests. As expected, the tests failed in master branch and passed in this PR.

AArnott reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lynzrand added 2 commits January 20, 2023 18:07
@lynzrand
Add tests for IntegerEncodedLength for every integer
eb9852b
@lynzrand
Fix failed test in IntegerEncodedLength
53d6c16
AArnott
AArnott reviewed Jan 20, 2023
View reviewed changes

@AArnott AArnott left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. It merits some discussion before merging.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lynzrand reacted with laugh emoji
All reactions
  • 😄 1 reaction
Comment thread src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackWriter.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Unity/Extension/UnsafeBlitFormatter.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@lynzrand

lynzrand commented Jan 30, 2023

Copy link
Copy Markdown
Contributor Author

By the way, although I highly doubt that it would ever run on a big-endian device, I don't think the byte order reversing code is correct.

https://github.com/neuecc/MessagePack-CSharp/blob/53d6c1617789488d15e391e7f86aa0eba7ed64b2/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Unity/Extension/UnsafeBlitFormatter.cs#L65-L74

It seems to be reversing the whole data structure instead of reversing each float value.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AArnott added 3 commits March 12, 2023 15:58
@AArnott
Rename IntegerEncodedLength to GetEncodedLength
eb8c898
Also move the API from Shipped to Unshipped, because it has not in fact shipped yet.
@AArnott
Merge branch 'mergeMasterToDevelop' into fix-1550
2c6d923
@AArnott
Use switch expressions for more concise syntax
2a4ca21
@AArnott
AArnott changed the base branch from master to develop March 12, 2023 22:25
@AArnott AArnott added this to the v2.5 milestone Mar 12, 2023
@AArnott
AArnott merged commit 58c4d3c into MessagePack-CSharp:develop Mar 12, 2023
@dependabot dependabot Bot mentioned this pull request Sep 21, 2025
Bump MessagePack from 2.1.115 to 2.5.187 starchen/Brighter#4
Closed
This was referenced Oct 26, 2025
Bump MessagePack from 2.3.75 to 2.5.187 managedcode/umap#1
Closed
Bump MessagePack to 2.5.187 Senparc/Senparc.CO2NET#334
Merged
This was referenced Dec 2, 2025
Bump MessagePack from 2.3.85 to 3.1.4 dbolin/Apex.Serialization#262
Closed
Bump MessagePack and MessagePack.ImmutableCollection dbolin/Apex.Serialization#263
Open
@dependabot dependabot Bot mentioned this pull request Dec 10, 2025
Bump MessagePack from 1.9.11 to 2.5.187 dotnet/performance#5069
Open
@dependabot dependabot Bot mentioned this pull request Dec 26, 2025
Bump the nuget group with 2 updates niklasfp/nats.net#1
Closed
This was referenced Jan 22, 2026
Bump MessagePack from 2.4.59 to 2.5.187 collana-solutions/Csag.Extensions.Caching#3
Merged
Bump the nuget group with 1 update GlacierEQ/MemoryPack#1
Merged
@dependabot dependabot Bot mentioned this pull request Feb 20, 2026
Bump MessagePack from 2.3.85 to 3.1.4 Arkatufus/Akka.Persistence.Redis#82
Open
@dependabot dependabot Bot mentioned this pull request Mar 14, 2026
Bump the nuget group with 2 updates K1ko/osu#48
Open
This was referenced Jun 11, 2026
Bump MessagePack from 2.3.85 to 2.5.187 curiosity-ai/wiktionary#1
Closed
Bump MessagePack from 1.7.3.4 to 2.5.301 CodeKeySolutions/CryptoDaytrader#2
Open
Bump MessagePack from 2.1.90 to 2.5.301 NickStrupat/NichoblockStruchain#6
Open
This was referenced Jun 11, 2026
Bump MessagePack from 3.1.6 to 3.1.7 geekswagg/EFCoreSecondLevelCacheInterceptor#1
Closed
Bump MessagePack from 1.7.3.7 to 2.5.301 KikeE36/MasterMemory#1
Open
Bump the nuget group with 2 updates korgano/CustomAmmoCategories#1
Open
Bump the nuget group with 1 update IntelIntent/BinaryPack#1
Open
Bump MessagePack from 2.2.85 to 2.5.301 shahabganji/EasyCompressor#1
Open
Bump MessagePack from 1.9.11 to 2.5.301 shahabganji/SmartEnum#1
Open
Bump MessagePack from 2.3.85 to 2.5.301 gengle/MessagePipe#3
Closed
Bump the nuget group with 1 update pa-0/ahk.ucrio#1
Open
Bump MessagePack from 2.1.90 to 2.5.301 sniten/psi#2
Open
Bump the nuget group with 1 update abri-herdmaster/HerdMASTER.Dotmim.Sync#5
Open
Bump MessagePack from 2.1.90 to 2.5.301 Cysharp/Ulid#113
Open
Bump MessagePack from 2.2.113 to 2.5.301 x0oo11235oo0x/dotnet-algorand-sdk#1
Open
Bump MessagePack and System.Memory nmaier/NMaier.Serializers#1
Open
Bump MessagePack from 2.3.85 to 2.5.301 curiosity-ai/wiktionary#2
Open
Bump MessagePack from 2.1.115 to 2.5.301 generatives/VoidTraveler#1
Open
Bump MessagePack and System.Memory Philippe-Laval/catalyst#1
Open
Bump MessagePack from 2.1.115 to 2.5.301 starchen/Brighter#5
Open
Bump the nuget group with 1 update pawelkasperek/AlterNats#1
Open
Bump MessagePack from 1.9.11 to 2.5.301 ConnectionMaster/dd-trace-dotnet#788
Open
Bump MessagePack from 1.9.3 to 2.5.301 IllusionMods/ZipStudio#5
Merged
This was referenced Jun 26, 2026
Bump MessagePack from 2.3.112 to 2.5.301 nanoframework/nf-Visual-Studio-extension#936
Closed
Bump the nuget group with 3 updates infinispan/Infinispan.Hotrod.Core#56
Open
@dependabot dependabot Bot mentioned this pull request Sep 15, 2026
Bump MessagePack from 1.9.11 to 2.5.301 f2calv/vs-nuget-issue#1
Closed
This was referenced Oct 19, 2026
Bump MessagePack from 2.3.85 to 2.5.303 gengle/MessagePipe#4
Open
Bump the nuget group with 1 update aetos382/MemoryPack#1
Open
Bump MessagePack from 2.2.85 to 2.5.303 umbraco/Umbraco.Cms.Integrations#347
Open
Bump MessagePack from 2.3.112 to 2.5.303 nanoframework/nf-Visual-Studio-extension#956
Closed
Bump MessagePack to 2.5.303 Senparc/Senparc.CO2NET#347
Open
Bump the nuget group with 5 updates maximumstock/exilence-next#4
Open
@dependabot dependabot Bot mentioned this pull request Nov 7, 2026
Bump MessagePack from 1.7.3.4 to 2.5.303 automatica-core/automatica#136
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AArnott AArnott AArnott left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

v2.5

Development

Successfully merging this pull request may close these issues.

UnsafeBlitFormatter for Unity types is not compatible with the MessagePack specification

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@lynzrand @AArnott
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.