* [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4.
@ 2016-08-19 7:53 Zhang Lubo
2016-08-19 9:54 ` Hegde, Nagaraj P
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Zhang Lubo @ 2016-08-19 7:53 UTC (permalink / raw)
To: edk2-devel; +Cc: Fu Siyuan, Ye Ting, Wu Jiaxin, Hegde Nagaraj P
If a FQDN contains 3 dots '.' like "a.b.c.com", the AsciiStrToIp4
will return success as the HostName has a valid IP address. So we
need to check if it is a decimal character before using AsciiStrDecimalToUintn.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
---
MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
index ef19439..f4376e9 100644
--- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
+++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
@@ -2724,10 +2724,13 @@ NetLibAsciiStrToIp4 (
for (Index = 0; Index < 4; Index++) {
TempStr = Ip4Str;
while ((*Ip4Str != '\0') && (*Ip4Str != '.')) {
+ if (!NET_IS_DIGIT(*Ip4Str)) {
+ return EFI_INVALID_PARAMETER;
+ }
Ip4Str++;
}
//
// The IPv4 address is X.X.X.X
--
1.9.5.msysgit.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4.
2016-08-19 7:53 [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4 Zhang Lubo
@ 2016-08-19 9:54 ` Hegde, Nagaraj P
2016-08-23 1:21 ` Fu, Siyuan
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Hegde, Nagaraj P @ 2016-08-19 9:54 UTC (permalink / raw)
To: Zhang Lubo, edk2-devel@lists.01.org; +Cc: Fu Siyuan, Ye Ting, Wu Jiaxin
Cosmetic comment:
if (!NET_IS_DIGIT(*Ip4Str)) {
^
Add a space here
Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
-----Original Message-----
From: Zhang Lubo [mailto:lubo.zhang@intel.com]
Sent: Friday, August 19, 2016 1:23 PM
To: edk2-devel@lists.01.org
Cc: Fu Siyuan <siyuan.fu@intel.com>; Ye Ting <ting.ye@intel.com>; Wu Jiaxin <jiaxin.wu@intel.com>; Hegde, Nagaraj P <nagaraj-p.hegde@hpe.com>
Subject: [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4.
If a FQDN contains 3 dots '.' like "a.b.c.com", the AsciiStrToIp4 will return success as the HostName has a valid IP address. So we need to check if it is a decimal character before using AsciiStrDecimalToUintn.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
---
MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
index ef19439..f4376e9 100644
--- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
+++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
@@ -2724,10 +2724,13 @@ NetLibAsciiStrToIp4 (
for (Index = 0; Index < 4; Index++) {
TempStr = Ip4Str;
while ((*Ip4Str != '\0') && (*Ip4Str != '.')) {
+ if (!NET_IS_DIGIT(*Ip4Str)) {
+ return EFI_INVALID_PARAMETER;
+ }
Ip4Str++;
}
//
// The IPv4 address is X.X.X.X
--
1.9.5.msysgit.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4.
2016-08-19 7:53 [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4 Zhang Lubo
2016-08-19 9:54 ` Hegde, Nagaraj P
@ 2016-08-23 1:21 ` Fu, Siyuan
2016-08-23 1:37 ` Ye, Ting
2016-08-23 3:16 ` Subramanian, Sriram (EG Servers Platform SW)
3 siblings, 0 replies; 5+ messages in thread
From: Fu, Siyuan @ 2016-08-23 1:21 UTC (permalink / raw)
To: Zhang, Lubo, edk2-devel@lists.01.org
Cc: Ye, Ting, Wu, Jiaxin, Hegde Nagaraj P
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
> -----Original Message-----
> From: Zhang, Lubo
> Sent: Friday, August 19, 2016 3:53 PM
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan.fu@intel.com>; Ye, Ting <ting.ye@intel.com>; Wu,
> Jiaxin <jiaxin.wu@intel.com>; Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
> Subject: [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4.
>
> If a FQDN contains 3 dots '.' like "a.b.c.com", the AsciiStrToIp4
> will return success as the HostName has a valid IP address. So we
> need to check if it is a decimal character before using
> AsciiStrDecimalToUintn.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
> ---
> MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
> b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
> index ef19439..f4376e9 100644
> --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
> +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
> @@ -2724,10 +2724,13 @@ NetLibAsciiStrToIp4 (
>
> for (Index = 0; Index < 4; Index++) {
> TempStr = Ip4Str;
>
> while ((*Ip4Str != '\0') && (*Ip4Str != '.')) {
> + if (!NET_IS_DIGIT(*Ip4Str)) {
> + return EFI_INVALID_PARAMETER;
> + }
> Ip4Str++;
> }
>
> //
> // The IPv4 address is X.X.X.X
> --
> 1.9.5.msysgit.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4.
2016-08-19 7:53 [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4 Zhang Lubo
2016-08-19 9:54 ` Hegde, Nagaraj P
2016-08-23 1:21 ` Fu, Siyuan
@ 2016-08-23 1:37 ` Ye, Ting
2016-08-23 3:16 ` Subramanian, Sriram (EG Servers Platform SW)
3 siblings, 0 replies; 5+ messages in thread
From: Ye, Ting @ 2016-08-23 1:37 UTC (permalink / raw)
To: Zhang, Lubo, edk2-devel@lists.01.org
Cc: Fu, Siyuan, Wu, Jiaxin, Hegde Nagaraj P
Reviewed-by: Ye Ting <ting.ye@intel.com>
-----Original Message-----
From: Zhang, Lubo
Sent: Friday, August 19, 2016 3:53 PM
To: edk2-devel@lists.01.org
Cc: Fu, Siyuan <siyuan.fu@intel.com>; Ye, Ting <ting.ye@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>; Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Subject: [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4.
If a FQDN contains 3 dots '.' like "a.b.c.com", the AsciiStrToIp4 will return success as the HostName has a valid IP address. So we need to check if it is a decimal character before using AsciiStrDecimalToUintn.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
---
MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
index ef19439..f4376e9 100644
--- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
+++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
@@ -2724,10 +2724,13 @@ NetLibAsciiStrToIp4 (
for (Index = 0; Index < 4; Index++) {
TempStr = Ip4Str;
while ((*Ip4Str != '\0') && (*Ip4Str != '.')) {
+ if (!NET_IS_DIGIT(*Ip4Str)) {
+ return EFI_INVALID_PARAMETER;
+ }
Ip4Str++;
}
//
// The IPv4 address is X.X.X.X
--
1.9.5.msysgit.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4.
2016-08-19 7:53 [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4 Zhang Lubo
` (2 preceding siblings ...)
2016-08-23 1:37 ` Ye, Ting
@ 2016-08-23 3:16 ` Subramanian, Sriram (EG Servers Platform SW)
3 siblings, 0 replies; 5+ messages in thread
From: Subramanian, Sriram (EG Servers Platform SW) @ 2016-08-23 3:16 UTC (permalink / raw)
To: Zhang Lubo, edk2-devel@lists.01.org; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhang Lubo
Sent: Friday, August 19, 2016 1:23 PM
To: edk2-devel@lists.01.org
Cc: Ye Ting <ting.ye@intel.com>; Fu Siyuan <siyuan.fu@intel.com>; Wu Jiaxin <jiaxin.wu@intel.com>
Subject: [edk2] [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4.
If a FQDN contains 3 dots '.' like "a.b.c.com", the AsciiStrToIp4
will return success as the HostName has a valid IP address. So we
need to check if it is a decimal character before using AsciiStrDecimalToUintn.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
---
MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
index ef19439..f4376e9 100644
--- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
+++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
@@ -2724,10 +2724,13 @@ NetLibAsciiStrToIp4 (
for (Index = 0; Index < 4; Index++) {
TempStr = Ip4Str;
while ((*Ip4Str != '\0') && (*Ip4Str != '.')) {
+ if (!NET_IS_DIGIT(*Ip4Str)) {
+ return EFI_INVALID_PARAMETER;
+ }
Ip4Str++;
}
//
// The IPv4 address is X.X.X.X
--
1.9.5.msysgit.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-08-23 3:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-19 7:53 [patch] MdeModulePkg:Fix bug in function AsciiStrToIp4 Zhang Lubo
2016-08-19 9:54 ` Hegde, Nagaraj P
2016-08-23 1:21 ` Fu, Siyuan
2016-08-23 1:37 ` Ye, Ting
2016-08-23 3:16 ` Subramanian, Sriram (EG Servers Platform SW)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox