Re: [PATCH] isdn: eicon: fix a missing check of api_parse

2018-12-27 Thread David Miller
From: Kangjie Lu 
Date: Wed, 26 Dec 2018 00:40:32 -0600

> api_parse can fail, and if it fails, we should not use the ss_parms
> which can be incorrect.
> The fix checks its return value and stops using ss_parms if api_parse
> fails.
> 
> Signed-off-by: Kangjie Lu 

This patch does not apply.


[PATCH] isdn: eicon: fix a missing check of api_parse

2018-12-25 Thread Kangjie Lu
api_parse can fail, and if it fails, we should not use the ss_parms
which can be incorrect.
The fix checks its return value and stops using ss_parms if api_parse
fails.

Signed-off-by: Kangjie Lu 
---
 drivers/isdn/hardware/eicon/message.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/eicon/message.c 
b/drivers/isdn/hardware/eicon/message.c
index def7992a38e6..afb4a7d88288 100644
--- a/drivers/isdn/hardware/eicon/message.c
+++ b/drivers/isdn/hardware/eicon/message.c
@@ -1846,7 +1846,13 @@ static byte facility_req(dword Id, word Number, 
DIVA_CAPI_ADAPTER *a,
break;
 
case S_HOLD:
-   api_parse(>info[1], (word)parms->length, 
"ws", ss_parms);
+   if (api_parse(>info[1],
+   (word)parms->length,
+   "ws", ss_parms)) {
+   dbug(1, dprintf("format wrong"));
+   Info = _WRONG_MESSAGE_FORMAT;
+   break;
+   }
if (plci && plci->State && plci->SuppState == 
IDLE)
{
plci->SuppState = HOLD_REQUEST;
-- 
2.17.2 (Apple Git-113)