Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect padding #311

Closed
isotoxin opened this issue Dec 10, 2016 · 4 comments
Closed

Incorrect padding #311

isotoxin opened this issue Dec 10, 2016 · 4 comments
Assignees
Labels
bug Bug fix for the user, not a fix to a build script P1 High priority
Milestone

Comments

@isotoxin
Copy link

https://github.com/TokTok/c-toxcore/blob/master/toxcore/Messenger.c#L2666

Guys, why your tests didn't failed?

Lets see my fix instead of #281

#pragma pack(push, 8) // just add this before SAVED_FRIEND
struct SAVED_FRIEND {
.......
};
#pragma pack(pop) // and just add this after SAVED_FRIEND
@iphydf
Copy link
Member

iphydf commented Dec 10, 2016

Your fix is not standard C.

We changed the code to use the layout on AMD64 Linux (LP64). What data model does Windows use? Which failures do you see? I expect the assert to fail, and we will remove that assert today.

@isotoxin
Copy link
Author

isotoxin commented Dec 10, 2016

Your fix is not standard C.

But gcc supports it.
Just see https://github.com/zetok/tox-spec/blob/master/spec.md
Where pudding must be? Right, after Status message (due it has size 1007 bytes), not after name

@iphydf
Copy link
Member

iphydf commented Dec 10, 2016

You're right, the code seems wrong. We'll add a test that fails, and then fix it.

@iphydf iphydf added this to the v0.1.0 milestone Dec 11, 2016
@iphydf iphydf added P1 High priority bug Bug fix for the user, not a fix to a build script labels Dec 11, 2016
@iphydf
Copy link
Member

iphydf commented Dec 13, 2016

Fixed in #313.

@iphydf iphydf closed this as completed Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fix for the user, not a fix to a build script P1 High priority
Projects
None yet
Development

No branches or pull requests

3 participants