summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 25412b261..336df5e4e 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -916,7 +916,7 @@ get_devn (const char *name, int &unit)
devn = FH_MEM;
unit = 4;
}
- else if (deveqn ("com", 3) && (unit = digits (name + 3)) >= 0)
+ else if (deveqn ("com", 3) && (unit = digits (name + 3)) >= 0 && unit < 100)
devn = FH_SERIAL;
else if (deveqn ("ttyS", 4) && (unit = digits (name + 4)) >= 0)
{
@@ -1070,7 +1070,7 @@ get_device_number (const char *unix_path, const char *w32_path, int &unit)
if (p)
unix_path = p + 1;
if (udeveqn ("com", 3)
- && (unit = digits (unix_path + 3)) >= 0)
+ && (unit = digits (unix_path + 3)) >= 0 && unit < 100)
devn = FH_SERIAL;
}