nuttx-apps/netutils/netlib
YAMAMOTO Takashi 998abe1deb netlib_parseurl.c: Fix string overruns
For EINVAL, it doesn't make sense to keep parsing.
(For E2BIG, it might make some sense.)

Found by LLVM ASan.

```
=================================================================
==81622==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000000f2 at pc 0x00010d2746ca bp 0x7ffee29a9980 sp 0x7ffee29a9978
READ of size 1 at 0x6020000000f2 thread T0
    #0 0x10d2746c9 in netlib_parseurl netlib_parseurl.c:121
    #1 0x10d26b293 in parseurl webclient.c:479
    #2 0x10d265e48 in webclient_perform webclient.c:690
    #3 0x10d277c5b in main main.c:210
    #4 0x7fff7a06f3d4 in start+0x0 (libdyld.dylib:x86_64+0x163d4)

0x6020000000f2 is located 0 bytes to the right of 2-byte region [0x6020000000f0,0x6020000000f2)
allocated by thread T0 here:
    #0 0x10d3996d3 in wrap_strdup+0x203 (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x3e6d3)
    #1 0x10d276abe in main main.c:147
    #2 0x7fff7a06f3d4 in start+0x0 (libdyld.dylib:x86_64+0x163d4)

SUMMARY: AddressSanitizer: heap-buffer-overflow netlib_parseurl.c:121 in netlib_parseurl
Shadow bytes around the buggy address:
  0x1c03ffffffc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c03ffffffd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c03ffffffe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c03fffffff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c0400000000: fa fa fd fd fa fa fd fd fa fa 00 00 fa fa 00 00
=>0x1c0400000010: fa fa 00 fa fa fa 00 00 fa fa 00 06 fa fa[02]fa
  0x1c0400000020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0400000030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0400000040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0400000050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0400000060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==81622==ABORTING
```
2021-05-07 20:23:01 -07:00
..
Kconfig netutils/netlib/netlib_parseurl.c: Add a more flexible version of netlib_parsehttpurl. This one can parse any URL, and is extensible so future improvements keep the same API. 2019-04-26 13:08:38 -06:00
Make.defs Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
Makefile build: Replace $(TOPDIR)/Make.defs with $(APPDIR)/Make.defs 2020-07-09 15:17:37 -03:00
netlib_autoconfig.c Remove use of set_errno() from application code. 2020-05-07 22:23:19 +01:00
netlib_delarp.c apps/: Remove/replace all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0. That value is always greater than zero now. In places just replace with #ifdef CONFIG_NET. 2019-02-11 16:23:55 -06:00
netlib_eaddrconv.c NSH: Fix some ieee 802.15.4 initialization logic. It should not set the saddr or panid; those cannot be hard-coded but must come from the coordinator. 2017-06-17 10:04:18 -06:00
netlib_ethaddrconv.c This is the Pokemon patch to change all includes fronm <apps/bla/bla.h> to "bla/bla.h" 2016-07-11 10:11:18 -06:00
netlib_getarp.c apps/: Remove/replace all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0. That value is always greater than zero now. In places just replace with #ifdef CONFIG_NET. 2019-02-11 16:23:55 -06:00
netlib_getarptab.c netlib: fix nxstyle issue for netlink related code 2020-04-10 09:22:08 -06:00
netlib_getdevs.c netlib: fix nxstyle issue for netlink related code 2020-04-10 09:22:08 -06:00
netlib_getdripv4addr.c apps/: Remove/replace all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0. That value is always greater than zero now. In places just replace with #ifdef CONFIG_NET. 2019-02-11 16:23:55 -06:00
netlib_getessid.c netlib: Remove AF_FAMILY and PF_FAMILY definition 2020-04-09 07:36:19 -06:00
netlib_getifstatus.c netlib: Remove AF_FAMILY and PF_FAMILY definition 2020-04-09 07:36:19 -06:00
netlib_getipv4addr.c apps/: Remove/replace all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0. That value is always greater than zero now. In places just replace with #ifdef CONFIG_NET. 2019-02-11 16:23:55 -06:00
netlib_getipv4netmask.c Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
netlib_getipv6addr.c Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
netlib_getmacaddr.c netlib: Remove AF_FAMILY and PF_FAMILY definition 2020-04-09 07:36:19 -06:00
netlib_getnbtab.c netlib: fix nxstyle issue for netlink related code 2020-04-10 09:22:08 -06:00
netlib_getnodeaddr.c Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
netlib_getpanid.c Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
netlib_getproperties.c Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
netlib_getroute.c netlib: fix nxstyle issue for netlink related code 2020-04-10 09:22:08 -06:00
netlib_ipmsfilter.c netutils/netlib/netlib_ipmsfilter.c: Fix a syslog format 2020-11-23 04:59:11 -08:00
netlib_ipv4adaptor.c Correct and standardize some naming used in the previous commits. 2017-10-30 14:16:37 -06:00
netlib_ipv4addrconv.c This is the Pokemon patch to change all includes fronm <apps/bla/bla.h> to "bla/bla.h" 2016-07-11 10:11:18 -06:00
netlib_ipv4route.c Run codespell -w with the latest dictonary again 2020-02-23 07:10:14 -06:00
netlib_ipv4router.c Correct a typo in some C comments. 2018-02-09 11:15:35 -06:00
netlib_ipv6adaptor.c Correct and standardize some naming used in the previous commits. 2017-10-30 14:16:37 -06:00
netlib_ipv6netmask2prefix.c Fix nxstyle warning 2020-10-18 22:27:57 -07:00
netlib_ipv6route.c Run codespell -w with the latest dictonary again 2020-02-23 07:10:14 -06:00
netlib_ipv6router.c Squashed commit of the following: 2017-09-20 10:35:56 -06:00
netlib_listenon.c Make SO_REUSEADDR not mandatory in netlib 2020-02-06 23:43:37 +01:00
netlib_nodeaddrconv.c Run codespell -w with the latest dictonary again 2020-02-23 07:10:14 -06:00
netlib_parsehttpurl.c netlib_parsehttpurl: Fix pathlen check 2020-05-28 19:59:03 +08:00
netlib_parseurl.c netlib_parseurl.c: Fix string overruns 2021-05-07 20:23:01 -07:00
netlib_prefix2ipv6netmask.c Remove trailing spaces at the end of lines. 2018-08-13 07:47:26 -06:00
netlib_saddrconv.c Squashed commit of the following: 2017-08-19 08:47:35 -06:00
netlib_server.c Unify the void cast usage 2020-01-02 23:21:01 +08:00
netlib_setarp.c apps/: Remove/replace all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0. That value is always greater than zero now. In places just replace with #ifdef CONFIG_NET. 2019-02-11 16:23:55 -06:00
netlib_setdripv4addr.c Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
netlib_setdripv6addr.c Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
netlib_seteaddr.c Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
netlib_setessid.c netlib: Remove AF_FAMILY and PF_FAMILY definition 2020-04-09 07:36:19 -06:00
netlib_setifstatus.c netlib: Remove AF_FAMILY and PF_FAMILY definition 2020-04-09 07:36:19 -06:00
netlib_setipv4addr.c Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
netlib_setipv4dnsaddr.c This is the Pokemon patch to change all includes fronm <apps/bla/bla.h> to "bla/bla.h" 2016-07-11 10:11:18 -06:00
netlib_setipv4netmask.c Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
netlib_setipv6addr.c Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
netlib_setipv6netmask.c Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
netlib_setmacaddr.c netlib: Remove AF_FAMILY and PF_FAMILY definition 2020-04-09 07:36:19 -06:00
netlib_setnodeaddr.c Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00