1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-12 03:00:28 +00:00
freebsd-ports/ports-mgmt/portfind
Enji Cooper b2eb1410b4 Fix ports-mgmt/portfind string management/searching issues
Makefile:

  Bump `PORT_REVISION` for the change.

portfind.c:

  get_release(..):

  The function was incorrectly modifying a pointer that wasn't the original
  calloc'ed pointer, tripping asserts when MALLOC_PRODUCTION wasn't enabled
  in jemalloc [*].

  - Use one temporary buffer (`release`) instead of two (`release` and
    `version`).
  - Improve temporary memory idiom for managing memory used with
    sysctlbyname(3) by first checking the length, mallocing the buffer,
    then filling it with a second call to sysctlbyname(3).
  - Use strchr(3) instead of handrolling it in a while-loop and to
    avoid the improper free(3) of the memory allocated for `release`.

  main(..):

  - Use asprintf instead of calloc + sprintf.
  - Use constant `pasting` with `INDEX_FILE` instead of passing it in to
    asprintf(3).
  - Fix error message when unable to open `INDEX_FILE`.

Approved by: brd
Differential Revision: https://reviews.freebsd.org/D7198
PR: 211032 [*]
Reported by: Michael Zhilin <mizhka@gmail.com>
Reviewed by: Michael Zhilin <mizhka@gmail.com>
Sponsored by: EMC / Isilon Storage Division
2016-07-14 15:46:41 +00:00
..
files Fix ports-mgmt/portfind string management/searching issues 2016-07-14 15:46:41 +00:00
distinfo
Makefile Fix ports-mgmt/portfind string management/searching issues 2016-07-14 15:46:41 +00:00
pkg-descr
pkg-plist