Compilers are picky about not truncating the output when copying data
with strncpy. From the static buffer sizes it sees the potential
buffer truncation, so adjust the buffer sizes so that it is not
possible to truncate buffers and leave the data unterminated.
Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
break;
/* Copy the onewire path without options */
break;
/* Copy the onewire path without options */
- strncpy(ow_path, start_str, pathlen);
+ strncpy(ow_path, start_str, pathlen - 1);
ow_path[str - start_str] = '\0';
/* Get the next non-space, which is where the argument begins */
ow_path[str - start_str] = '\0';
/* Get the next non-space, which is where the argument begins */
static int make_uncached(char *path, size_t len)
{
int ret;
static int make_uncached(char *path, size_t len)
{
int ret;
- char p1[1024], p2[1024], *p = path;
+ char p1[1028], p2[1028], *p = path;
if (strstr(path, "/uncached/"))
return 0;
if (strstr(path, "/uncached/"))
return 0;