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

possible driver path truncation #222

Open
ceyusa opened this issue Jul 13, 2018 · 0 comments
Open

possible driver path truncation #222

ceyusa opened this issue Jul 13, 2018 · 0 comments

Comments

@ceyusa
Copy link
Contributor

ceyusa commented Jul 13, 2018

When compiling with gcc 8, it complains about a possible string truncation when constructing the driver path.

../subprojects/libva/va/va.c: In function ‘va_openDriver’:
../subprojects/libva/va/va.c:381:9: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]                                                                                              
         strncat( driver_path, "/", strlen("/") );
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/libva/va/va.c:383:9: warning: ‘strncat’ specified bound 13 equals source length [-Wstringop-overflow=]                                                                                             
         strncat( driver_path, DRIVER_EXTENSION, strlen(DRIVER_EXTENSION) );
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/libva/va/va.c:380:9: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]                                                                        
         strncpy( driver_path, driver_dir, strlen(driver_dir) + 1);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/libva/va/va.c:380:43: note: length computed here
         strncpy( driver_path, driver_dir, strlen(driver_dir) + 1);
                                           ^~~~~~~~~~~~~~~~~~
../subprojects/libva/va/va.c:382:9: warning: ‘strncat’ specified bound depends on the length of the source argument [-Wstringop-overflow=]                                                                        
         strncat( driver_path, driver_name, strlen(driver_name) );
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

No branches or pull requests

1 participant