From: Alan T. DeKok Date: Mon, 18 Feb 2013 18:29:57 +0000 (-0500) Subject: Fix coverity errors X-Git-Tag: release_3_0_0_beta1~1040 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e7df356f97da46855cc17fd117b434e852fc4e3;p=thirdparty%2Ffreeradius-server.git Fix coverity errors --- diff --git a/scripts/jlibtool.c b/scripts/jlibtool.c index a34a5d5ba4a..b0bc2ae21a2 100644 --- a/scripts/jlibtool.c +++ b/scripts/jlibtool.c @@ -651,7 +651,7 @@ static int parse_long_opt(char *arg, command_t *cmd_data) if (equal_pos) { strncpy(var, arg, equal_pos - arg); var[equal_pos - arg] = 0; - strcpy(value, equal_pos + 1); + strlcpy(value, equal_pos + 1, sizeof(var)); } else { strncpy(var, arg, sizeof(var) - 1); var[sizeof(var) - 1] = '\0'; @@ -1270,6 +1270,7 @@ static void add_rpath_file(count_chars *cc, const char *arg) path = load_install_path(arg); if (path) { add_rpath(cc, path); + free(path); } } @@ -2363,6 +2364,7 @@ static void cleanup_tmp_dir(const char *dirname) if ((strlen(dirname) + 1 + sizeof(entry->d_name)) >= sizeof(fullname)) { fprintf(stderr, "Dirname too long out of buffer space"); + (void) closedir(dir); return; }