Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/cvs/src fix pointer-to-int cast problem



details:   https://anonhg.NetBSD.org/src/rev/33aa34efdd2b
branches:  trunk
changeset: 539869:33aa34efdd2b
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu Nov 28 09:57:16 2002 +0000

description:
fix pointer-to-int cast problem

diffstat:

 gnu/dist/cvs/src/client.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r cef5ed9c829f -r 33aa34efdd2b gnu/dist/cvs/src/client.c
--- a/gnu/dist/cvs/src/client.c Thu Nov 28 07:02:20 2002 +0000
+++ b/gnu/dist/cvs/src/client.c Thu Nov 28 09:57:16 2002 +0000
@@ -3974,9 +3974,15 @@
     if (do_gssapi)
     {
 #ifdef HAVE_GSSAPI
-       int fd = (int) lto_server->closure;
+       int fd;
        struct stat s;
 
+       if ((intptr_t) lto_server->closure > INT_MAX)
+       {
+           error (1, 0, "file descriptor out of range");
+       }
+       fd = (intptr_t)lto_server->closure;
+
        if (fstat (fd, &s) < 0 || !S_ISSOCK(s.st_mode))
        {
            error (1, 0, "gserver currently only enabled for socket connections");



Home | Main Index | Thread Index | Old Index