diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2009-02-25 17:48:40 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2009-02-25 17:48:40 +0200 |
commit | 1c195ab280da561f38e54449e4eb3d6882c69b3b (patch) | |
tree | 12583570730c9e5a1505416aa445666aa1449f6b /src/main.c | |
parent | d7aa6d1b2d6f3fc48b8287ea04c741078b22f2da (diff) |
Fix strncpy length parameters to avoid non-nul-terminated strings
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -189,7 +189,8 @@ static void parse_config(GKeyFile *config) g_clear_error(&err); } else { debug("deviceid=%s", str); - strncpy(main_opts.deviceid, str, sizeof(main_opts.deviceid)); + strncpy(main_opts.deviceid, str, + sizeof(main_opts.deviceid) - 1); g_free(str); } |