GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Fix for issue 775 by dcleblanc · Pull Request #776 · msgpack/msgpack-c Fix for issue 775 #776New issueHave 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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Fix for issue 775 #776Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2deed25
Fix for issue 775
ed30252
Spaces not tabs
eff6f5a
Two more tabs
fadc615
Fix typo
2d54c0e
Change integer overflow check to conform with spec
a2f3689
Older compilers don't allow declaring variables other than at the top of
fcf89fe
Fix tabs, also attempt work-around for compile time constant conditional
7a70d74
Use a #define to only check for integer overflow when it is actually
File filterConversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page. Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page. Diff viewDiff viewThere are no files selected for viewing
I think that only ARRAY and MAP require I'm not 100% sure but replacing
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
|
// integer overflow |
|
|
return MSGPACK_UNPACK_NOMEM_ERROR; |
|
|
} |
|
|
|
|
|
size = (unsigned int)tmp; |
|
|
|
|
|
if (*u->z == NULL) { |
|
|
*u->z = msgpack_zone_new(MSGPACK_ZONE_CHUNK_SIZE); |
|
|
if(*u->z == NULL) { |
|
|
return MSGPACK_UNPACK_NOMEM_ERROR; |
|
|
} |
|
|
} |
|
|
|
|
|
// Unsure whether size = 0 should be an error, and if so, what to return |
|
|
o->via.array.ptr = (msgpack_object*)msgpack_zone_malloc(*u->z, size); |
|
|
if(o->via.array.ptr == NULL) { return MSGPACK_UNPACK_NOMEM_ERROR; } |
|
|
return 0; |
|
@@ -223,19 +231,27 @@ static inline int template_callback_array_item(unpack_user* u, msgpack_object* c |
|
|
static inline int template_callback_map(unpack_user* u, unsigned int n, msgpack_object* o) |
|
|
{ |
|
|
unsigned int size; |
|
|
unsigned long long tmp; |
|
|
|
|
|
o->type = MSGPACK_OBJECT_MAP; |
|
|
o->via.map.size = 0; |
|
|
size = n*sizeof(msgpack_object_kv); |
|
|
if (size / sizeof(msgpack_object_kv) != n) { |
|
|
tmp = (unsigned long long)n * sizeof(msgpack_object_kv); |
|
|
|
|
|
if (tmp & 0xffffffff00000000) { |
|
|
// integer overflow |
|
|
return MSGPACK_UNPACK_NOMEM_ERROR; |
|
|
} |
|
|
|
|
|
size = (unsigned int)tmp; |
|
|
|
|
|
if (*u->z == NULL) { |
|
|
*u->z = msgpack_zone_new(MSGPACK_ZONE_CHUNK_SIZE); |
|
|
if(*u->z == NULL) { |
|
|
return MSGPACK_UNPACK_NOMEM_ERROR; |
|
|
} |
|
|
} |
|
|
|
|
|
// Should size = 0 be an error? If so, what error to return? |
|
|
o->via.map.ptr = (msgpack_object_kv*)msgpack_zone_malloc(*u->z, size); |
|
|
if(o->via.map.ptr == NULL) { return MSGPACK_UNPACK_NOMEM_ERROR; } |
|
|
return 0; |
|
|
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 01402792 — 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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||