Task #73088 - added.err

back to task #73088
download
Error: COMPILER_WARNING:
crun-HEAD/src/libcrun/chroot_realpath.c: scope_hint: In function 'chroot_realpath'
crun-HEAD/src/libcrun/chroot_realpath.c:138:65: warning[-Wsizeof-array-argument]: 'sizeof' on array function parameter 'resolved_path' will return size of 'char *'
crun-HEAD/src/libcrun/chroot_realpath.c:50:66: note: declared here
#  136|   			/* If a component doesn't exist, then return what we could translate. */
#  137|   			if (errno == ENOENT) {
#  138|-> 				snprintf (resolved_path, sizeof (resolved_path), "%s%s%s", got_path, path[0] == '/' || path[0] == '\0' ? "" : "/", path);
#  139|   				return resolved_path;
#  140|   			}

Error: COMPILER_WARNING (CWE-805):
crun-HEAD/src/libcrun/chroot_realpath.c:138:65: warning[-Wsizeof-pointer-memaccess]: argument to 'sizeof' in 'snprintf' call is the same expression as the destination; did you mean to provide an explicit length?
#  138 |                                 snprintf (resolved_path, sizeof (resolved_path), "%s%s%s", got_path, path[0] == '/' || path[0] == '\0' ? "" : "/", path);
#      |                                                                 ^
#  136|   			/* If a component doesn't exist, then return what we could translate. */
#  137|   			if (errno == ENOENT) {
#  138|-> 				snprintf (resolved_path, sizeof (resolved_path), "%s%s%s", got_path, path[0] == '/' || path[0] == '\0' ? "" : "/", path);
#  139|   				return resolved_path;
#  140|   			}