check for bad read in readSignature()
authorroot <devnull@localhost>
Wed, 21 Feb 1996 22:20:37 +0000 (22:20 +0000)
committerroot <devnull@localhost>
Wed, 21 Feb 1996 22:20:37 +0000 (22:20 +0000)
CVS patchset: 384
CVS date: 1996/02/21 22:20:37

lib/signature.c

index be62737..2f7ec5e 100644 (file)
@@ -34,7 +34,9 @@ int readSignature(int fd, short sig_type, void **sig)
        }
        break;
     case RPMSIG_PGP262_1024:
-       read(fd, pgpbuf, 256);
+       if (read(fd, pgpbuf, 256) != 256) {
+          return 0;
+       }
        if (sig) {
            *sig = malloc(152);
            memcpy(*sig, pgpbuf, 152);