diff --git a/src/app_info.c b/src/app_info.c
index 0484554f6a5fe9f18e6fabea5d52c61627beae08..3c136740dbce523f3c3a62dde116b63a586454f9 100644
--- a/src/app_info.c
+++ b/src/app_info.c
@@ -110,7 +110,7 @@ static void info_who_owns(struct info_ctx *ctx, struct apk_database *db,
 		if (pkg == NULL) {
 			r = readlinkat(db->root_fd, *parg, buf, sizeof(buf));
 			if (r > 0 && r < PATH_MAX && buf[0] == '/') {
-				pkg = apk_db_get_file_owner(db, APK_BLOB_STR(buf));
+				pkg = apk_db_get_file_owner(db, APK_BLOB_PTR_LEN(buf, r));
 				via = "symlink target ";
 			}
 		}