Bug 199486 - usr.bin/make switch from memcpy() to memmove() for copying between overlapping buffers
Summary: usr.bin/make switch from memcpy() to memmove() for copying between overlappin...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Simon J. Gerraty
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-16 16:25 UTC by Sevan Janiyan
Modified: 2015-12-29 05:01 UTC (History)
2 users (show)

See Also:


Attachments
switch from memcpy() to memmove() in jobs.c (865 bytes, text/plain)
2015-04-16 16:25 UTC, Sevan Janiyan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sevan Janiyan 2015-04-16 16:25:51 UTC
Created attachment 155648 [details]
switch from memcpy() to memmove() in jobs.c

Attached patch:
Switches from memcpy() to memmove() when copying between overlapping buffers.
Adds a description of what max is and handle i reaching it again.

Taken from r1.79/1.80 of job.c from NetBSD, Issue with copying between overlapping buffers found via building on OpenBSD.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2015-04-17 13:20:48 UTC
sjg, do you have an upstream import planned that will pick up this change?
Comment 2 Simon J. Gerraty freebsd_committer freebsd_triage 2015-04-19 19:16:10 UTC
Yes was planning an import soon, will now be bmake-20150418 which includes this.
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-04-21 04:40:48 UTC
A commit references this bug:

Author: sjg
Date: Tue Apr 21 04:40:42 UTC 2015
New revision: 281812
URL: https://svnweb.freebsd.org/changeset/base/281812

Log:
  Merge bmake-20150418

  PR: 199486

Changes:
_U  head/contrib/bmake/
  head/contrib/bmake/ChangeLog
  head/contrib/bmake/FILES
  head/contrib/bmake/Makefile
  head/contrib/bmake/PSD.doc/Makefile
  head/contrib/bmake/PSD.doc/tutorial.ms
  head/contrib/bmake/bmake.1
  head/contrib/bmake/bmake.cat1
  head/contrib/bmake/compat.c
  head/contrib/bmake/configure
  head/contrib/bmake/configure.in
  head/contrib/bmake/job.c
  head/contrib/bmake/lst.h
  head/contrib/bmake/lst.lib/lstInt.h
  head/contrib/bmake/lst.lib/lstRemove.c
  head/contrib/bmake/main.c
  head/contrib/bmake/make.1
  head/contrib/bmake/make.c
  head/contrib/bmake/make.h
  head/contrib/bmake/meta.c
  head/contrib/bmake/mk/ChangeLog
  head/contrib/bmake/mk/FILES
  head/contrib/bmake/mk/auto.dep.mk
  head/contrib/bmake/mk/auto.obj.mk
  head/contrib/bmake/mk/autodep.mk
  head/contrib/bmake/mk/cython.mk
  head/contrib/bmake/mk/dep.mk
  head/contrib/bmake/mk/dirdeps.mk
  head/contrib/bmake/mk/gendirdeps.mk
  head/contrib/bmake/mk/install-mk
  head/contrib/bmake/mk/links.mk
  head/contrib/bmake/mk/manifest.mk
  head/contrib/bmake/mk/meta.autodep.mk
  head/contrib/bmake/mk/meta.stage.mk
  head/contrib/bmake/mk/meta.sys.mk
  head/contrib/bmake/mk/meta2deps.py
  head/contrib/bmake/mk/meta2deps.sh
  head/contrib/bmake/mk/mk-files.txt
  head/contrib/bmake/mk/mkopt.sh
  head/contrib/bmake/mk/own.mk
  head/contrib/bmake/mk/sys.dependfile.mk
  head/contrib/bmake/mk/whats.mk
  head/contrib/bmake/nonints.h
  head/contrib/bmake/parse.c
  head/contrib/bmake/suff.c
  head/contrib/bmake/targ.c
  head/contrib/bmake/unit-tests/Makefile.in
  head/contrib/bmake/unit-tests/comment
  head/contrib/bmake/unit-tests/comment.exp
  head/contrib/bmake/unit-tests/comment.mk
  head/contrib/bmake/unit-tests/cond1
  head/contrib/bmake/unit-tests/cond1.exp
  head/contrib/bmake/unit-tests/cond1.mk
  head/contrib/bmake/unit-tests/doterror
  head/contrib/bmake/unit-tests/doterror.exp
  head/contrib/bmake/unit-tests/doterror.mk
  head/contrib/bmake/unit-tests/dotwait
  head/contrib/bmake/unit-tests/dotwait.exp
  head/contrib/bmake/unit-tests/dotwait.mk
  head/contrib/bmake/unit-tests/error
  head/contrib/bmake/unit-tests/error.exp
  head/contrib/bmake/unit-tests/error.mk
  head/contrib/bmake/unit-tests/escape.exp
  head/contrib/bmake/unit-tests/escape.mk
  head/contrib/bmake/unit-tests/export
  head/contrib/bmake/unit-tests/export-all
  head/contrib/bmake/unit-tests/export-all.exp
  head/contrib/bmake/unit-tests/export-all.mk
  head/contrib/bmake/unit-tests/export-env
  head/contrib/bmake/unit-tests/export-env.exp
  head/contrib/bmake/unit-tests/export-env.mk
  head/contrib/bmake/unit-tests/export.exp
  head/contrib/bmake/unit-tests/export.mk
  head/contrib/bmake/unit-tests/forloop
  head/contrib/bmake/unit-tests/forloop.exp
  head/contrib/bmake/unit-tests/forloop.mk
  head/contrib/bmake/unit-tests/forsubst
  head/contrib/bmake/unit-tests/forsubst.exp
  head/contrib/bmake/unit-tests/forsubst.mk
  head/contrib/bmake/unit-tests/hash
  head/contrib/bmake/unit-tests/hash.exp
  head/contrib/bmake/unit-tests/hash.mk
  head/contrib/bmake/unit-tests/impsrc.exp
  head/contrib/bmake/unit-tests/impsrc.mk
  head/contrib/bmake/unit-tests/misc
  head/contrib/bmake/unit-tests/misc.exp
  head/contrib/bmake/unit-tests/misc.mk
  head/contrib/bmake/unit-tests/moderrs
  head/contrib/bmake/unit-tests/moderrs.exp
  head/contrib/bmake/unit-tests/moderrs.mk
  head/contrib/bmake/unit-tests/modmatch
  head/contrib/bmake/unit-tests/modmatch.exp
  head/contrib/bmake/unit-tests/modmatch.mk
  head/contrib/bmake/unit-tests/modmisc
  head/contrib/bmake/unit-tests/modmisc.exp
  head/contrib/bmake/unit-tests/modmisc.mk
  head/contrib/bmake/unit-tests/modorder
  head/contrib/bmake/unit-tests/modorder.exp
  head/contrib/bmake/unit-tests/modorder.mk
  head/contrib/bmake/unit-tests/modts
  head/contrib/bmake/unit-tests/modts.exp
  head/contrib/bmake/unit-tests/modts.mk
  head/contrib/bmake/unit-tests/modword
  head/contrib/bmake/unit-tests/modword.exp
  head/contrib/bmake/unit-tests/modword.mk
  head/contrib/bmake/unit-tests/order
  head/contrib/bmake/unit-tests/order.exp
  head/contrib/bmake/unit-tests/order.mk
  head/contrib/bmake/unit-tests/phony-end
  head/contrib/bmake/unit-tests/phony-end.exp
  head/contrib/bmake/unit-tests/phony-end.mk
  head/contrib/bmake/unit-tests/posix
  head/contrib/bmake/unit-tests/posix.exp
  head/contrib/bmake/unit-tests/posix.mk
  head/contrib/bmake/unit-tests/posix1.exp
  head/contrib/bmake/unit-tests/posix1.mk
  head/contrib/bmake/unit-tests/qequals
  head/contrib/bmake/unit-tests/qequals.exp
  head/contrib/bmake/unit-tests/qequals.mk
  head/contrib/bmake/unit-tests/suffixes.exp
  head/contrib/bmake/unit-tests/suffixes.mk
  head/contrib/bmake/unit-tests/sunshcmd
  head/contrib/bmake/unit-tests/sunshcmd.exp
  head/contrib/bmake/unit-tests/sunshcmd.mk
  head/contrib/bmake/unit-tests/sysv
  head/contrib/bmake/unit-tests/sysv.exp
  head/contrib/bmake/unit-tests/sysv.mk
  head/contrib/bmake/unit-tests/ternary
  head/contrib/bmake/unit-tests/ternary.exp
  head/contrib/bmake/unit-tests/ternary.mk
  head/contrib/bmake/unit-tests/test.exp
  head/contrib/bmake/unit-tests/unexport
  head/contrib/bmake/unit-tests/unexport-env
  head/contrib/bmake/unit-tests/unexport-env.exp
  head/contrib/bmake/unit-tests/unexport-env.mk
  head/contrib/bmake/unit-tests/unexport.exp
  head/contrib/bmake/unit-tests/unexport.mk
  head/contrib/bmake/unit-tests/varcmd
  head/contrib/bmake/unit-tests/varcmd.exp
  head/contrib/bmake/unit-tests/varcmd.mk
  head/contrib/bmake/unit-tests/varmisc.exp
  head/contrib/bmake/unit-tests/varmisc.mk
  head/contrib/bmake/unit-tests/varshell.exp
  head/contrib/bmake/unit-tests/varshell.mk
  head/contrib/bmake/var.c
  head/usr.bin/bmake/Makefile
  head/usr.bin/bmake/unit-tests/Makefile