* [PATCH] isdn: eicon: fix a missing check of api_parse
@ 2018-12-26 6:40 Kangjie Lu
2018-12-28 0:27 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Kangjie Lu @ 2018-12-26 6:40 UTC (permalink / raw)
To: kjlu; +Cc: pakki001, Armin Schindler, Karsten Keil, netdev, linux-kernel
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 <kjlu@umn.edu>
---
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(&parms->info[1], (word)parms->length, "ws", ss_parms);
+ if (api_parse(&parms->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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] isdn: eicon: fix a missing check of api_parse
2018-12-26 6:40 [PATCH] isdn: eicon: fix a missing check of api_parse Kangjie Lu
@ 2018-12-28 0:27 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-12-28 0:27 UTC (permalink / raw)
To: kjlu; +Cc: pakki001, mac, isdn, netdev, linux-kernel
From: Kangjie Lu <kjlu@umn.edu>
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 <kjlu@umn.edu>
This patch does not apply.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-28 0:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-26 6:40 [PATCH] isdn: eicon: fix a missing check of api_parse Kangjie Lu
2018-12-28 0:27 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).