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

common: fw-update-helper, don't compare addresses #5443

Merged
merged 1 commit into from
Dec 29, 2019
Merged

common: fw-update-helper, don't compare addresses #5443

merged 1 commit into from
Dec 29, 2019

Conversation

jirislaby
Copy link

create_default_fw_table tries to compare "" with another string. But
both are addresses. Use strlen in that case.

The compiler warns about it:

../common/fw-update-helper.cpp: In function 'std::map<int, std::vector<unsigned char> > rs2::create_default_fw_table()':
../common/fw-update-helper.cpp:21:34: warning: comparison with string literal results in unspecified behavior [-Waddress]
 #define FW_D4XX_FW_IMAGE_VERSION ""
                                  ^
../common/fw-update-helper.cpp:71:19: note: in expansion of macro 'FW_D4XX_FW_IMAGE_VERSION'
         if ("" != FW_D4XX_FW_IMAGE_VERSION && !allow_rc_firmware)
                   ^~~~~~~~~~~~~~~~~~~~~~~~

create_default_fw_table tries to compare "" with another string. But
both are addresses. Use strlen in that case.

The compiler warns about it:
../common/fw-update-helper.cpp: In function 'std::map<int, std::vector<unsigned char> > rs2::create_default_fw_table()':
../common/fw-update-helper.cpp:21:34: warning: comparison with string literal results in unspecified behavior [-Waddress]
 #define FW_D4XX_FW_IMAGE_VERSION ""
                                  ^
../common/fw-update-helper.cpp:71:19: note: in expansion of macro 'FW_D4XX_FW_IMAGE_VERSION'
         if ("" != FW_D4XX_FW_IMAGE_VERSION && !allow_rc_firmware)
                   ^~~~~~~~~~~~~~~~~~~~~~~~
@dorodnic dorodnic changed the base branch from master to development December 17, 2019 10:25
@dorodnic
Copy link
Contributor

Thanks @jirislaby
This is a good find

@dorodnic dorodnic merged commit 23ede77 into IntelRealSense:development Dec 29, 2019
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

Successfully merging this pull request may close these issues.

2 participants