freebsd-dev/usr.sbin
Bill Paul 51d6d0952b Clean up and apply the fix for PR 83477. The calculation for locating
the start of the section headers has to take into account the fact
that the image_nt_header is really variable sized. It happens that
the existing calculation is correct for _most_ production binaries
produced by the Windows DDK, but if we get a binary with oddball
offsets, the PE loader could crash.

Changes from the supplied patch are:

- We don't really need to use the IMAGE_SIZEOF_NT_HEADER() macro when
  computing how much of the header to return to callers of
  pe_get_optional_header(). While it's important to take the variable
  size of the header into account in other calculations, we never
  actually look at anything outside the non-variable portion of the
  header. This saves callers from having to allocate a variable sized
  buffer off the heap (I purposely tried to avoid using malloc()
  in subr_pe.c to make it easier to compile in both the -D_KERNEL and
  !-D_KERNEL case), and since we're copying into a buffer on the
  stack, we always have to copy the same amount of data or else
  we'll trash the stack something fierce.

- We need <stddef.h> to get offsetof() in the !-D_KERNEL case.

- ndiscvt.c needs the IMAGE_FIRST_SECTION() macro too, since it does
  a little bit of section pre-processing.

PR: kern/83477
2005-10-26 18:46:27 +00:00
..
ac
accton
acpi
adduser
amd
ancontrol
apm
apmd
arlcontrol
arp
asf Initialize uninitialized variables. 2005-09-21 05:33:46 +00:00
atm
authpf
bluetooth
boot0cfg
boot98cfg
bootparamd
bsnmpd Catch up with the import of bsnmp-1.11. Add a couple of new 2005-10-04 15:03:39 +00:00
btxld
burncd
cdcontrol Use the new name H_SETSIZE instead of the old H_EVENT to set the history 2005-10-19 15:37:43 +00:00
chkgrp
chown
chroot
ckdist
config
cron Pidfiles should be created with permission preventing users from opening 2005-09-16 11:24:28 +00:00
crunch
ctm
daemon
dconschat
devinfo
digictl
diskinfo
dnssec-keygen
dnssec-signzone
editmap
edquota
eeprom
elf2exe
extattr
extattrctl
faithd
fdcontrol
fdformat
fdread
fdwrite
flowctl
fwcontrol
getfmac
getpmac
gstat
i4b Include <osreldate.h> at the top of the file. 2005-09-12 16:06:15 +00:00
ifmcstat
inetd Pidfiles should be created with permission preventing users from opening 2005-09-16 11:24:28 +00:00
iostat
ip6addrctl
ipfwpcap Add a small tool which captures packets on a DIVERT socket and writes 2005-10-17 20:27:15 +00:00
IPXrouted
jail
jexec
jls
kbdcontrol
kbdmap
kernbb
keyserv
kgmon
kgzip
kldxref
lastlogin
lmcconfig Add the lmcconfig tool for controlling the lmc driver. Add man pages and 2005-10-03 07:09:41 +00:00
lpr Use the new name H_SETSIZE instead of the old H_EVENT to set the history 2005-10-19 16:37:52 +00:00
lptcontrol
mailstats
mailwrapper
makemap
manctl
memcontrol
mergemaster
mixer
mld6query
mlxcontrol
mount_nwfs
mount_portalfs
mount_smbfs
mountd Pidfiles should be created with permission preventing users from opening 2005-09-16 11:24:28 +00:00
moused Fix a small typo. 2005-09-19 09:29:59 +00:00
mptable
mrouted
mtest
mtree
named
named-checkconf
named-checkzone
named.reload
ndiscvt Clean up and apply the fix for PR 83477. The calculation for locating 2005-10-26 18:46:27 +00:00
ndp supported an ndp command suboption to disable IPv6 in the given interface 2005-10-19 16:20:18 +00:00
newsyslog
nfsd
ngctl
nghook
nologin
ntp Add NO_OBJ, remove redundant SCRIPTSNAME. 2005-09-28 07:52:27 +00:00
ofwdump
pccard Remove now redundant NO_SHARED. 2005-10-17 15:28:25 +00:00
pciconf
pcvt
periodic
pkg_install * pkg_version(1) exits if INDEX files is not found and -I is not 2005-10-10 12:35:31 +00:00
pmccontrol The 'intr_bufferfull' driver statistic actually counts the number 2005-09-29 01:40:03 +00:00
pmcstat Warn the user if the kernel driver dropped samples or ran out of event buffers 2005-10-21 18:59:59 +00:00
pnpinfo
portsnap Add HTTP proxy authentication, via the HTTP_PROXY_AUTH environment 2005-09-22 07:11:27 +00:00
powerd Create the devd thread after we have called daemon(). Otherwise, it would 2005-10-24 18:34:54 +00:00
ppp Fix a typo 2005-09-22 11:18:30 +00:00
pppctl
pppd
pppstats
praliases
procctl
pstat
pw
pwd_mkdb
quot
quotaon
rarpd
raycontrol
repquota
rip6query
rmt
rndc
rndc-confgen
route6d
rpc.lockd
rpc.statd
rpc.umntall
rpc.yppasswdd
rpc.ypupdated
rpc.ypxfrd
rpcbind
rrenumd
rtadvd changed syslog level to more appropriate ones 2005-10-19 15:19:06 +00:00
rtprio
rtsold
rwhod
sa
sade Sync whitespace change that is found uniquely in RELENG_6, to reduce diff 2005-10-09 04:44:51 +00:00
sendmail
setfmac
setpmac
sicontrol
sliplogin
slstat
smbmsg
snapinfo
spkrtest
spray
sysinstall Sync whitespace change that is found uniquely in RELENG_6, to reduce diff 2005-10-09 04:44:51 +00:00
syslogd style(9) nitlet: 2005-10-17 16:51:06 +00:00
tcpdchk
tcpdmatch
tcpdrop
tcpdump
timed
traceroute
traceroute6
trpt
tzsetup
ugidfw
usbd
usbdevs
vidcontrol Fix so that color changes are not lost when the video mode changes. 2005-09-17 12:52:04 +00:00
vipw Mention the possibility of non-interactive scripts for EDITOR and add a 2005-10-20 19:23:16 +00:00
vnconfig
watch Close the tty file descriptor once we're done with it. 2005-09-21 14:30:14 +00:00
watchdogd Report any errors we might see when disabling the watchdog. 2005-09-30 08:30:20 +00:00
wicontrol
wlconfig
wpa Hide a diagnostic message under if (verbose) to avoid cluttering the 2005-10-21 16:57:57 +00:00
yp_mkdb
ypbind
yppoll
yppush
ypserv
ypset
zic
zzz
Makefile Hook ipfwpcap into the build tree. 2005-10-17 20:47:44 +00:00
Makefile.inc