adib / google-toolbox-for-mac

Automatically exported from code.google.com/p/google-toolbox-for-mac
Apache License 2.0
0 stars 0 forks source link

+[GTMSystemVersion getMajor:minor:bugFix:] causes bus error when major, but not bugfix, version requested #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Send GTMSystemVersion a +getMajor:minor:bugFix: message with a valid
|major| pointer but nil |bugFix| pointer:

SInt32 major = 0;
[GTMSystemVersion getMajor:&major minor:nil bugFix:nil];
NSLog(@"Major version: %ld", major);

What is the expected output?
$ ./a.out
2009-02-27 15:08:56.966 a.out[20508:10b] Major version: 10

What do you see instead?
$ ./a.out
Bus error

What version of the product are you using? On what operating system?
r86 (GTMSystemVersion.m last changed by r73) running under Mac OS X 10.5.6
(9G55)

Please provide any additional information below.
The attached file demonstrates the crashing behavior.

The error is caused by an erroneous test for |major| instead of |bugFix| at
GTMSystemVersion.m:105.

The current unit tests fail to catch this because they request all three
values at once, without trying any other combination of the requested outputs.

Original issue reported on code.google.com by jeremyw....@gmail.com on 1 Mar 2009 at 4:18

Attachments:

GoogleCodeExporter commented 9 years ago
what type of hardware are you running on?

Original comment by thoma...@gmail.com on 1 Mar 2009 at 9:34

GoogleCodeExporter commented 9 years ago
oops, i see the bug.

Original comment by thoma...@gmail.com on 1 Mar 2009 at 9:34

GoogleCodeExporter commented 9 years ago
thanks.

fixed w/ revision 90.

Original comment by thoma...@gmail.com on 1 Mar 2009 at 9:46