Skip to content

Overruning write by sccanf #576

Description

@szsam

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions