Bug 106281 - upekts: Fix compilation warning
Summary: upekts: Fix compilation warning
Status: RESOLVED FIXED
Alias: None
Product: libfprint
Classification: Unclassified
Component: libfprint (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: libfprint-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-27 12:25 UTC by Bastien Nocera
Modified: 2018-05-25 11:20 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
upekts: Fix compilation warning (1.52 KB, patch)
2018-04-27 12:25 UTC, Bastien Nocera
Details | Splinter Review

Description Bastien Nocera 2018-04-27 12:25:27 UTC
libfprint/drivers/upekts.c: In function ‘alloc_send_cmd_transfer’:
libfprint/drivers/upekts.c:161:2: warning: ‘strncpy’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
      strncpy(buf, "Ciao", 4);
      ^~~~~~~~~~~~~~~~~~~~~~~
    
Replace with memcpy() to only copy the 4 bytes we need.
Comment 1 Bastien Nocera 2018-04-27 12:25:42 UTC
Created attachment 139172 [details] [review]
upekts: Fix compilation warning

libfprint/drivers/upekts.c: In function ‘alloc_send_cmd_transfer’:
libfprint/drivers/upekts.c:161:2: warning: ‘strncpy’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
  strncpy(buf, "Ciao", 4);
  ^~~~~~~~~~~~~~~~~~~~~~~

Replace with memcpy() to only copy the 4 bytes we need.
Comment 2 Bastien Nocera 2018-05-25 11:20:27 UTC
Attachment 139172 [details] pushed as f433a4d - upekts: Fix compilation warning


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.