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

mj2: Array overflow #485

Closed
gcode-importer opened this issue Apr 11, 2015 · 0 comments
Closed

mj2: Array overflow #485

gcode-importer opened this issue Apr 11, 2015 · 0 comments
Labels
bug Priority-Medium removed_components Issues that affect MJ2, JPWL or JP3D wontfix

Comments

@gcode-importer
Copy link

Originally reported on Google Code with ID 485

In mj2.c the mj2_write_urn() function writes four 32bit words to the urn name field:

  cio_write(cio, tk->urn[urn_num].name[0], 4);
  cio_write(cio, tk->urn[urn_num].name[1], 4);
  cio_write(cio, tk->urn[urn_num].name[2], 4);
  cio_write(cio, tk->urn[urn_num].name[3], 4);

However, in mj2.h this array is defined as being two words long:

typedef struct mj2_urn {
  int name[2];
  int location[4];
} mj2_urn_t;

It will therefore overwrite location with name info, which is in turn overwritten by
location info.

Reported by per.mathisen on 2015-04-11 23:06:09

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Priority-Medium removed_components Issues that affect MJ2, JPWL or JP3D wontfix
Projects
None yet
Development

No branches or pull requests

2 participants