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

Flexible size types in va_list #2437

Open
kodebach opened this Issue Feb 23, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@kodebach
Copy link
Contributor

kodebach commented Feb 23, 2019

keyVInit and therefore keyVNew and keyNew (and maybe others) currently use size_t for the value size of a key. The C standard doesn't define a fixed size for size_t, only that it should be at least 16 bits. This can lead to problems, if a bigger type (e.g. kdb_unsigned_long_long_t) is passed without casting, because of the way that some compilers implement va_list.

We should change all va_list usages to only use our fixed size integer types declared in kdbtypes.h.

@kodebach kodebach added the bug label Feb 23, 2019

@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Feb 23, 2019

Thank you for creating the issue!

Yes, other methods are affected, too: e.g. ksNew

@markus2330 markus2330 added this to the 0.9.0 milestone Feb 23, 2019

@kodebach

This comment has been minimized.

Copy link
Contributor Author

kodebach commented Feb 23, 2019

ksNew is not as big a problem. We do use size_t, so the maximum size of a KeySet is implementation/architecture dependent, but it cannot lead to the same kind of bug, because die parameter is declared as size_t and not part of a va_list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.