Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Constify the buffer passed to pkg_repo_binary_add_from_manifest() and pkg_parse_manifest() functions.
Alexey Dokuchaev committed 5 years ago
commit 0de41e25690430a0464183ac80ad81f67b76be38
parent f1a60ef
3 files changed +3 -3
modified libpkg/pkg.h.in
@@ -740,7 +740,7 @@ int pkg_addluascript_fileat(int fd, struct pkg *pkg, const char *path);
 * @param buf An NULL-terminated buffer containing the manifest data.
 * @return An error code.
 */
-
int pkg_parse_manifest(struct pkg *pkg, char *buf, size_t len, struct pkg_manifest_key *key);
+
int pkg_parse_manifest(struct pkg *pkg, const char *buf, size_t len, struct pkg_manifest_key *key);
int pkg_parse_manifest_file(struct pkg *pkg, const char *, struct pkg_manifest_key *key);
int pkg_parse_manifest_fileat(int fd, struct pkg *pkg, const char *, struct pkg_manifest_key *key);
int pkg_manifest_keys_new(struct pkg_manifest_key **k);
modified libpkg/pkg_manifest.c
@@ -830,7 +830,7 @@ pkg_parse_manifest_ucl (struct pkg *pkg, ucl_object_t *obj, struct pkg_manifest_
}

int
-
pkg_parse_manifest(struct pkg *pkg, char *buf, size_t len, struct pkg_manifest_key *keys)
+
pkg_parse_manifest(struct pkg *pkg, const char *buf, size_t len, struct pkg_manifest_key *keys)
{
	struct ucl_parser *p = NULL;
	ucl_object_t *obj = NULL;
modified libpkg/repo/binary/update.c
@@ -368,7 +368,7 @@ pkg_repo_binary_register_conflicts(const char *origin, char **conflicts,
}

static int
-
pkg_repo_binary_add_from_manifest(char *buf, sqlite3 *sqlite, size_t len,
+
pkg_repo_binary_add_from_manifest(const char *buf, sqlite3 *sqlite, size_t len,
		struct pkg_manifest_key **keys, struct pkg **p __unused,
		struct pkg_repo *repo)
{