The NetBSD Project

CVS log for pkgsrc/pkgtools/pkg_install/files/add/parse_cross.c

[BACK] Up to [cvs.NetBSD.org] / pkgsrc / pkgtools / pkg_install / files / add

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Feb 28 09:49:35 2026 UTC (8 months, 2 weeks ago) by bsiegert
Branches: MAIN
CVS tags: pkgsrc-2026Q3-base, pkgsrc-2026Q3, pkgsrc-2026Q2-base, pkgsrc-2026Q2, pkgsrc-2026Q1-base, pkgsrc-2026Q1, HEAD
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +3 -3 lines
pkg_install: fix null pointer dereference

The pkg_add -m option crashes on null pointer dereference if the input has a
slash but then no space.

Patch by riastradh@ in PR pkg/59991.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Tue Jun 11 09:11:33 2024 UTC (2 years, 5 months ago) by wiz
Branches: MAIN
CVS tags: pkgsrc-2025Q4-base, pkgsrc-2025Q4, pkgsrc-2025Q3-base, pkgsrc-2025Q3, pkgsrc-2025Q2-base, pkgsrc-2025Q2, pkgsrc-2025Q1-base, pkgsrc-2025Q1, pkgsrc-2024Q4-base, pkgsrc-2024Q4, pkgsrc-2024Q3-base, pkgsrc-2024Q3, pkgsrc-2024Q2-base, pkgsrc-2024Q2
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +5 -2 lines
pkg_install: include err.h for errx()

Revision 1.2: download - view: text, markup, annotated - select for diffs
Fri Jan 26 12:40:04 2024 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
CVS tags: pkgsrc-2024Q1-base, pkgsrc-2024Q1
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +3 -3 lines
pkg_install: Fix mistake in previous: this is strchr, not strchrnul.

Either

	if ((q = strchr(p, '/')) == NULL)

or

	if (*(q = strchrnul(p, '/')) == '\0')

will work, but not

	if (*(q = strchr(p, '/')) == '\0')

which will crash with a null pointer dereference.  Let's get the
right version of this committed, not the wrong one!  Oops.

While here, reset PKGREVISION like I meant to do yesterday.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Fri Jan 26 03:24:49 2024 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
pkg_install-20240125: Extend `-m' syntax to allow OPSYS too.

- If there's no slash `/', take it all as ${MACHINE_ARCH}.

- If there is a slash, then split it by `/' and ` ' into:

        ${OPSYS}/${MACHINE_ARCH} ${OPSYS_VERSION}

  For example:

        NetBSD/aarch64 10.0

All the variables are restricted to lie in a safe set [a-zA-Z0-9._-],
so the notation can be extended later.

No change to existing syntax (no MACHINE_ARCH has `/' in it, or
anything outside the safe set), and `-m' is generally only used with
cross builds anyway, so this shouldn't break existing cross builds
and should have no impact on native builds.

Proposed on tech-pkg:
https://mail-index.netbsd.org/tech-pkg/2024/01/13/msg028825.html

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>