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

Overruning write by sccanf #576

Open
szsam opened this issue May 24, 2023 · 0 comments
Open

Overruning write by sccanf #576

szsam opened this issue May 24, 2023 · 0 comments

Comments

@szsam
Copy link

szsam commented May 24, 2023

In the following sscanf calls, '%64s' requires 65 bytes.

ret = sscanf(buffer, "%c %64s", &result[i].cmd, result[i].key);

ret = sscanf(buffer,
"%c %64s %lu\n",
&result[i].cmd,
result[i].key,
&result[i].range_len);

But the length of result[i].key is only 24 bytes.

typedef struct ycsb_op {
char cmd;
char key[YCSB_KEY_SIZE];

#define YCSB_KEY_SIZE 24

Please either modify the sscanf format specifier, or make YCSB_KEY_SIZE larger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant