SLOF/lib/libnet
Thomas Huth 2317427ce7 lib/libnet/pxelinux: Fix two off-by-one bugs in the pxelinux.cfg parser
There are two small bugs in the pxelinux.cfg parser:

1. If the file does not end with a '\n', the code set 'eol = cfg + cfgsize'
and later wrote a NUL character to *eol, i.e. it wrote the NUL character
beyond the end of the buffer. We've got to use 'eol = cfg + cfgsize - 1'
instead.

2. The code always replaced the last byte of the buffer with a NUL character
to get a proper termination. If the config file ends with a required character
(e.g. the last line is a KERNEL or INITRD line and the file does not have
a '\n' at the end), the last character got lost. Move the obligation for the
terminating NUL character to the caller instead so that we can be sure to
have a proper terminated buffer in pxelinux_parse_cfg() without the need to
blindly overwrite the last character here.

Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2018-06-07 16:44:25 +10:00
..
Makefile libnet: Add functions for downloading and parsing pxelinux.cfg files 2018-05-29 19:06:31 +10:00
args.c net: Move also files from clients/net-snk/app/netapps/ to lib/libnet/ 2016-06-27 12:31:06 +10:00
args.h net: Move also files from clients/net-snk/app/netapps/ to lib/libnet/ 2016-06-27 12:31:06 +10:00
bootp.c libnet: Get rid of unnecessary (char *) casts 2018-05-14 19:56:07 +10:00
dhcp.c libnet: Add support for DHCPv4 options 209 and 210 2018-05-29 19:06:59 +10:00
dhcp.h net: Remove remainders of the MTFTP code 2016-06-27 12:31:06 +10:00
dhcpv6.c libnet: Get rid of unnecessary (char *) casts 2018-05-14 19:56:07 +10:00
dhcpv6.h net: Move files from clients/net-snk/app/netlib/ to lib/libnet/ 2016-06-27 12:31:06 +10:00
dns.c net: Move files from clients/net-snk/app/netlib/ to lib/libnet/ 2016-06-27 12:31:06 +10:00
dns.h net: Move files from clients/net-snk/app/netlib/ to lib/libnet/ 2016-06-27 12:31:06 +10:00
ethernet.c net: Move files from clients/net-snk/app/netlib/ to lib/libnet/ 2016-06-27 12:31:06 +10:00
ethernet.h libnet: Move the external declaration of send_ip to ethernet.h 2017-07-07 16:40:53 +10:00
icmpv6.c libnet: Cosmetical clean-up 2017-06-15 16:11:32 +10:00
icmpv6.h net: Move files from clients/net-snk/app/netlib/ to lib/libnet/ 2016-06-27 12:31:06 +10:00
ipv4.c net: Move files from clients/net-snk/app/netlib/ to lib/libnet/ 2016-06-27 12:31:06 +10:00
ipv4.h libnet: Move the external declaration of send_ip to ethernet.h 2017-07-07 16:40:53 +10:00
ipv6.c libnet/ipv6: assign times_asked value directly 2017-09-26 12:42:05 +10:00
ipv6.h libnet: Move the external declaration of send_ip to ethernet.h 2017-07-07 16:40:53 +10:00
libnet.code libnet: Get rid of unused huge_load and block_size parameters 2018-05-25 14:55:50 +10:00
libnet.in Add a Forth-to-C wrapper for the ping command, too 2016-10-17 11:02:15 +11:00
ndp.c net: Move files from clients/net-snk/app/netlib/ to lib/libnet/ 2016-06-27 12:31:06 +10:00
ndp.h net: Move files from clients/net-snk/app/netlib/ to lib/libnet/ 2016-06-27 12:31:06 +10:00
netapps.h libnet: Get rid of unused huge_load and block_size parameters 2018-05-25 14:55:50 +10:00
netload.c libnet: Support UUID-based pxelinux.cfg file names 2018-05-29 19:08:14 +10:00
ping.c libnet: Add support for DHCPv4 options 209 and 210 2018-05-29 19:06:59 +10:00
pxelinux.c lib/libnet/pxelinux: Fix two off-by-one bugs in the pxelinux.cfg parser 2018-06-07 16:44:25 +10:00
pxelinux.h libnet: Support UUID-based pxelinux.cfg file names 2018-05-29 19:08:14 +10:00
tcp.c net: Move files from clients/net-snk/app/netlib/ to lib/libnet/ 2016-06-27 12:31:06 +10:00
tcp.h net: Move files from clients/net-snk/app/netlib/ to lib/libnet/ 2016-06-27 12:31:06 +10:00
tftp.c libnet: Put code for determing TFTP error strings into a separate function 2018-05-29 19:06:18 +10:00
tftp.h libnet: Add support for DHCPv4 options 209 and 210 2018-05-29 19:06:59 +10:00
time.h paflof: Provide get_timer() and set_timer() helper functions 2016-09-14 17:50:40 +10:00
udp.c net: Remove remainders of the MTFTP code 2016-06-27 12:31:06 +10:00
udp.h net: Remove remainders of the MTFTP code 2016-06-27 12:31:06 +10:00