[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 13/98: term: fix error handling in hurdio_mdmctl
From: |
Samuel Thibault |
Subject: |
[hurd] 13/98: term: fix error handling in hurdio_mdmctl |
Date: |
Tue, 14 Jan 2014 01:59:58 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit aaba23a7f450d43d0062d66a712e5d0de62f7e87
Author: Justus Winter <address@hidden>
Date: Wed Nov 6 10:37:42 2013 +0100
term: fix error handling in hurdio_mdmctl
hurdio_mdmctl allows one to set and clear bits from the modem control
bit vector. However, plausible code paths exist that leave oldbits
uninitialized. Fix this by returning an error instead if retrieving
the oldbits failed and the bit set or clear operation was selected.
Found using the Clang Static Analyzer.
* term/hurdio.c (hurdio_mdmctl): Fix error handling.
---
term/hurdio.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/term/hurdio.c b/term/hurdio.c
index 357ab38..b34854c 100644
--- a/term/hurdio.c
+++ b/term/hurdio.c
@@ -585,10 +585,15 @@ hurdio_mdmctl (int how, int bits)
{
error_t err = tioctl_tiocmodg (ioport, &oldbits);
if (err && (err == EMIG_BAD_ID || err == EOPNOTSUPP))
- tioc_caps &= ~TIOC_CAP_MODG;
+ {
+ tioc_caps &= ~TIOC_CAP_MODG;
+ return EOPNOTSUPP;
+ }
else if (err)
return err;
}
+ else
+ return EOPNOTSUPP;
}
if (how == MDMCTL_BIS)
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 71/98: trans: fix locking in fakeroot's netfs_S_dir_lookup, (continued)
- [hurd] 71/98: trans: fix locking in fakeroot's netfs_S_dir_lookup, Samuel Thibault, 2014/01/13
- [hurd] 70/98: trans: fix reference counting and destruction of fake nodes, Samuel Thibault, 2014/01/13
- [hurd] 77/98: trans/fakeroot: fix ownership of newly created files, Samuel Thibault, 2014/01/13
- [hurd] 64/98: libihash: remove dead code, Samuel Thibault, 2014/01/13
- [hurd] 74/98: trans: unlock nodes with faked attributes in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 75/98: console-client: remove spurious pthread_spin_unlocks, Samuel Thibault, 2014/01/13
- [hurd] 62/98: trans: make the fakeroot environment more transparent, Samuel Thibault, 2014/01/13
- [hurd] 14/98: proc: turn count_up and store_pid into normal functions, Samuel Thibault, 2014/01/13
- [hurd] 67/98: trans: handle invalid responses to dir_lookup requests in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 78/98: trans/fakeroot: drop else, Samuel Thibault, 2014/01/13
- [hurd] 13/98: term: fix error handling in hurdio_mdmctl,
Samuel Thibault <=
- [hurd] 08/98: proc: fix error handling in S_proc_exception_raise, Samuel Thibault, 2014/01/13
- [hurd] 07/98: proc: fix a use-after-free error, Samuel Thibault, 2014/01/13
- [hurd] 18/98: libdiskfs: remove dead assignment, Samuel Thibault, 2014/01/13
- [hurd] 60/98: trans: fix the creation of files in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 69/98: trans: return nodes locked when creating fake nodes in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 20/98: ext2fs: fix error handling, Samuel Thibault, 2014/01/13
- [hurd] 21/98: libshouldbeinlibc: fix dead assignment, Samuel Thibault, 2014/01/13
- [hurd] 93/98: trans/mtab: make the translator multithreaded, Samuel Thibault, 2014/01/13
- [hurd] 05/98: proc: remove declaration of nested functions from proc.h, Samuel Thibault, 2014/01/13
- [hurd] 15/98: mach-defpager: include errno.h, Samuel Thibault, 2014/01/13