Skip to content

Commit

Permalink
Merge pull request #83 from troxor/disk-by-label
Browse files Browse the repository at this point in the history
Fix segfault on invalid label
  • Loading branch information
brndnmtthws committed Mar 9, 2015
2 parents 85aca29 + 9fd4090 commit 9c83366
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/diskio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ struct diskio_stat *prepare_diskio_stat(const char *s)

char * rpbuf;
rpbuf = realpath(&device_name[0], NULL);
strncpy(&device_s[0], rpbuf, text_buffer_size.get(*state));
if (rpbuf) {
strncpy(&device_s[0], rpbuf, text_buffer_size.get(*state));
}
free(rpbuf);

} else {
Expand Down

0 comments on commit 9c83366

Please sign in to comment.