From 7b92303b237c4179a3dc8715756892186a246c1c Mon Sep 17 00:00:00 2001
From: Janos Magasrevy <75690572+wes-jmagasrevy@users.noreply.github.com>
Date: Tue, 11 May 2021 22:05:41 -0400
Subject: [PATCH 1/3] In DHCPc, added argument checks for null pointers that
are passed into public APIs
---
Source/dhcp-c.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/Source/dhcp-c.c b/Source/dhcp-c.c
index 5062ee1..1629536 100644
--- a/Source/dhcp-c.c
+++ b/Source/dhcp-c.c
@@ -503,6 +503,10 @@ void DHCPc_Start (NET_IF_NBR if_nbr,
#if (DHCPc_CFG_ARG_CHK_EXT_EN == DEF_ENABLED)
+ if (perr == DEF_NULL) { /* Validate perr ptr. */
+ CPU_SW_EXCEPTION();
+ }
+
if (req_param_tbl_qty > 0) {
if (preq_param_tbl == (DHCPc_OPT_CODE *)0) {
*perr = DHCPc_ERR_NULL_PTR;
@@ -638,6 +642,12 @@ void DHCPc_Stop (NET_IF_NBR if_nbr,
DHCPc_COMM_MSG comm_msg;
+#if (DHCPc_CFG_ARG_CHK_EXT_EN == DEF_ENABLED)
+ if (perr == DEF_NULL) { /* Validate perr ptr. */
+ CPU_SW_EXCEPTION();
+ }
+#endif
+
if (DHCPc_InitDone != DEF_YES) { /* If init NOT complete, exit (see Note #3). */
*perr = DHCPc_ERR_INIT_INCOMPLETE;
return;
@@ -743,6 +753,12 @@ DHCPc_STATUS DHCPc_ChkStatus (NET_IF_NBR if_nbr,
CPU_SR_ALLOC();
+#if (DHCPc_CFG_ARG_CHK_EXT_EN == DEF_ENABLED)
+ if (perr_last == DEF_NULL) { /* Validate perr_last ptr. */
+ CPU_SW_EXCEPTION();
+ }
+#endif
+
if (DHCPc_InitDone != DEF_YES) { /* If init NOT complete, exit (see Note #1). */
*perr_last = DHCPc_ERR_INIT_INCOMPLETE;
return (DHCP_STATUS_NONE);
@@ -852,6 +868,10 @@ void DHCPc_GetOptVal (NET_IF_NBR if_nbr,
/* -------------- VALIDATE BUF & BUF LEN -------------- */
#if (DHCPc_CFG_ARG_CHK_EXT_EN == DEF_ENABLED)
+ if (perr == DEF_NULL) { /* Validate perr ptr. */
+ CPU_SW_EXCEPTION();
+ }
+
if ((pval_buf == (CPU_INT08U *)0) ||
(pval_buf_len == (CPU_INT16U *)0)) {
*perr = DHCPc_ERR_NULL_PTR;
From e3881c6b867e1935a05be42d08f01d53ec8f789e Mon Sep 17 00:00:00 2001
From: Janos Magasrevy <75690572+wes-jmagasrevy@users.noreply.github.com>
Date: Thu, 20 May 2021 11:08:15 -0400
Subject: [PATCH 2/3] Updated version number and copyright year. Incremented
DHCPc_VERSION to 21101
---
Cfg/Template/dhcp-c_cfg.h | 4 ++--
Examples/dhcp-c_init.c | 2 +-
Examples/dhcp-c_mgr.c | 2 +-
Examples/dhcp-c_multiple_if.c | 2 +-
OS/uCOS-II/dhcp-c_os.c | 4 ++--
OS/uCOS-III/dhcp-c_os.c | 4 ++--
Source/dhcp-c.c | 4 ++--
Source/dhcp-c.h | 6 +++---
8 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/Cfg/Template/dhcp-c_cfg.h b/Cfg/Template/dhcp-c_cfg.h
index 37f34b2..cbb5306 100644
--- a/Cfg/Template/dhcp-c_cfg.h
+++ b/Cfg/Template/dhcp-c_cfg.h
@@ -3,7 +3,7 @@
* uC/DHCPc
* Dynamic Host Configuration Protocol Client
*
-* Copyright 2004-2020 Silicon Laboratories Inc. www.silabs.com
+* Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
@@ -22,7 +22,7 @@
* TEMPLATE
*
* Filename : dhcp-c_cfg.h
-* Version : V2.11.00
+* Version : V2.11.01
*********************************************************************************************************
*/
diff --git a/Examples/dhcp-c_init.c b/Examples/dhcp-c_init.c
index fbce8de..a71128d 100644
--- a/Examples/dhcp-c_init.c
+++ b/Examples/dhcp-c_init.c
@@ -20,7 +20,7 @@
* DHCPc SINGLE INTERFACE
*
* Filename : dhcp-c_init.c
-* Version : V2.11.00
+* Version : V2.11.01
*********************************************************************************************************
* Note(s) : (1) This example shows how to initialize uC/DHCPc, start DHCP negotiation on 1 interface,
* request parameters from the server during the negotiation. The function returns only
diff --git a/Examples/dhcp-c_mgr.c b/Examples/dhcp-c_mgr.c
index e94fe14..2177f8a 100644
--- a/Examples/dhcp-c_mgr.c
+++ b/Examples/dhcp-c_mgr.c
@@ -20,7 +20,7 @@
* DHCPc MANAGER
*
* Filename : dhcp-c_mgr.c
-* Version : V2.11.00
+* Version : V2.11.01
*********************************************************************************************************
* Note(s) : (1) This example shows how to initialize uC/DHCPc and manage DHCP following the interface link
* state change (restart DHCP negotiation when the link move UP to DOWN to UP). This example use
diff --git a/Examples/dhcp-c_multiple_if.c b/Examples/dhcp-c_multiple_if.c
index c260454..feec621 100644
--- a/Examples/dhcp-c_multiple_if.c
+++ b/Examples/dhcp-c_multiple_if.c
@@ -20,7 +20,7 @@
* DHCPc MULTIPLE INTERFACE
*
* Filename : dhcp-c_multiple_if.c
-* Version : V2.11.00
+* Version : V2.11.01
*********************************************************************************************************
* Note(s) : (1) This example shows how to initialize uC/DHCPc, start DHCP negotiation on many interface
* and return only when all DHCP negotiation are completed.
diff --git a/OS/uCOS-II/dhcp-c_os.c b/OS/uCOS-II/dhcp-c_os.c
index 121f20d..f147088 100644
--- a/OS/uCOS-II/dhcp-c_os.c
+++ b/OS/uCOS-II/dhcp-c_os.c
@@ -3,7 +3,7 @@
* uC/DHCPc
* Dynamic Host Configuration Protocol Client
*
-* Copyright 2004-2020 Silicon Laboratories Inc. www.silabs.com
+* Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
@@ -22,7 +22,7 @@
* Micrium uC/OS-II
*
* Filename : dhcp-c_os.c
-* Version : V2.11.00
+* Version : V2.11.01
*********************************************************************************************************
* Note(s) : (1) Assumes uC/OS-II V2.86 (or more recent version) is included in the project build.
*
diff --git a/OS/uCOS-III/dhcp-c_os.c b/OS/uCOS-III/dhcp-c_os.c
index f1f1ed8..b3e091d 100644
--- a/OS/uCOS-III/dhcp-c_os.c
+++ b/OS/uCOS-III/dhcp-c_os.c
@@ -3,7 +3,7 @@
* uC/DHCPc
* Dynamic Host Configuration Protocol Client
*
-* Copyright 2004-2020 Silicon Laboratories Inc. www.silabs.com
+* Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
@@ -21,7 +21,7 @@
* Micrium uC/OS-III
*
* Filename : dhcp-c_os.c
-* Version : V2.11.00
+* Version : V2.11.01
*********************************************************************************************************
* Note(s) : (1) Assumes uC/OS-III V3.01.0 (or more recent version) is included in the project build.
*
diff --git a/Source/dhcp-c.c b/Source/dhcp-c.c
index 1629536..168037e 100644
--- a/Source/dhcp-c.c
+++ b/Source/dhcp-c.c
@@ -3,7 +3,7 @@
* uC/DHCPc
* Dynamic Host Configuration Protocol Client
*
-* Copyright 2004-2020 Silicon Laboratories Inc. www.silabs.com
+* Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
@@ -20,7 +20,7 @@
* DHCP CLIENT
*
* Filename : dhcp-c.c
-* Version : V2.11.00
+* Version : V2.11.01
*********************************************************************************************************
* Note(s) : (1) Supports Dynamic Host Configuration Protocol as described in RFC #2131 with the
* following features/restrictions/constraints :
diff --git a/Source/dhcp-c.h b/Source/dhcp-c.h
index ad4fbfc..508f3fd 100644
--- a/Source/dhcp-c.h
+++ b/Source/dhcp-c.h
@@ -3,7 +3,7 @@
* uC/DHCPc
* Dynamic Host Configuration Protocol Client
*
-* Copyright 2004-2020 Silicon Laboratories Inc. www.silabs.com
+* Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
@@ -20,7 +20,7 @@
* DHCP CLIENT
*
* Filename : dhcp-c.h
-* Version : V2.11.00
+* Version : V2.11.01
*********************************************************************************************************
* Note(s) : (1) Supports Dynamic Host Configuration Protocol as described in RFC #2131 with the
* following features/restrictions/constraints :
@@ -101,7 +101,7 @@
*********************************************************************************************************
*/
-#define DHCPc_VERSION 21100u /* See Note #1. */
+#define DHCPc_VERSION 21101u /* See Note #1. */
/*
From e343729fe636d877b2140c715e2d7a82ae0c8517 Mon Sep 17 00:00:00 2001
From: Janos Magasrevy <75690572+wes-jmagasrevy@users.noreply.github.com>
Date: Thu, 20 May 2021 16:23:57 -0400
Subject: [PATCH 3/3] Added new readme
---
README.rst | 45 +++++++++++++++++++++++++++++++++++++++++++++
readme.md | 10 ----------
2 files changed, 45 insertions(+), 10 deletions(-)
create mode 100644 README.rst
delete mode 100644 readme.md
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..a75ea7e
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,45 @@
+.. raw:: html
+
+
+
+
+
+
+
+µC/OS is a full-featured embedded operating system originally developed by Micriµm™. In addition to the two highly popular kernels, µC/OS features support for TCP/IP, USB-Device, USB-Host, and Modbus, as well as a robust File System.
+
+Since its founding in 1999 as a private company, Micriµm and its team of engineers have offered world-class embedded software components for the most critical and demanding real-time applications. Recognized as having some of the cleanest code in the industry, with easy-to-understand documentation, the Micrium real-time kernels, and software components have successfully been deployed in thousands of products worldwide across a broad range of industries. Micrium’s µC/OS-II™ kernel has been certified for use in safety-critical applications and remains a respected favorite in the medical, aerospace, and industrial markets. µC/OS continues to be the RTOS of choice for engineers requiring the most reliable and trusted solution for their mission-critical applications.
+
+----------
+
+.. raw:: HTML
+
+
+
+
+
+
+
+Founded by a team of former Micrium employees, Weston Embedded Solutions is the official custodian for the µC/OS RTOS and Stacks software repository to ensure it remains the trusted choice for embedded engineers around the world.
+
+----------
+
+Product Documentation and Release Notes
+***************
+https://micrium.atlassian.net/
+
+Technical Support
+*****************
+https://weston-embedded.com/micrium-support
+
+Example Projects
+*********
+https://weston-embedded.com/micrium-examples
+
+Commercial Licensing Option
+*********
+https://weston-embedded.com/products/cesium
+
+Who to Contact
+*********
+https://weston-embedded.com/company/contact
\ No newline at end of file
diff --git a/readme.md b/readme.md
deleted file mode 100644
index 8115bd1..0000000
--- a/readme.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# uC/DHCPc
-
-µC/DHCPc is a Dynamic Host Configuration Protocol client. µC/DHCPc has the following features:
-
-* Delivered with complete 100% ANSI C source code.
-* Scalable to contain only required features and minimize memory footprint.
-* Support dynamic IP address configuration for multiple interfaces.
-* Support for any real-time kernel available. A kernel is required.
-
-## For the complete documentation, visit https://doc.micrium.com/display/ucos/
\ No newline at end of file