guillaumezin / nvidiabl

/!\ Please note that I don't maintain this repository anymore, please have a look at forked projects. /!\
82 stars 82 forks source link

Incorrect sizeof() use on bl_type #76

Closed iam-TJ closed 11 years ago

iam-TJ commented 11 years ago

I was reviewing some problems for issue #45 and looked at the code that replaced my patches for the "type" parameter. The user is having problems with a Fatal error when passing "type=firmware".

The replacement code is doing a strnicmp() with the number of characters to compare set by sizeof(bl_type).

This is incorrect. bl_type is a char* (pointer to an array of chars) and will therefore always return 4 on a 32-bit kernel or 8 on a 64-bit kernel.

The correct code would be strlen(bl_type).

iam-TJ commented 11 years ago

I may have myself confused on this. Testing reported values of 4 and 8 initially but after playing with code some more it seems I may be wrong. Disregard me until I've figured out the root cause of the original problem!