Bug 11880 - Typo in tape.c potential hazard...
Summary: Typo in tape.c potential hazard...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: dump
Version: 6.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-06-03 03:35 UTC by SB
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-06-03 22:30:09 UTC
Embargoed:


Attachments (Terms of Use)

Description SB 2000-06-03 03:35:39 UTC
Here's the descrepency I noticed:

/usr/include/stdio.h:
line 77: # define BUFSIZ _IO_BUFSIZ

/usr/include/libio.h:
line 43: #define _IO_BUFSIZ _G_BUFSIZ

/usr/include/_G_config.h:
line 85: #define _G_BUFSIZ 8192

/usr/src/redhat/BUILD/dump-0.4b15/compat/include/protocols/dumprestore.h:
line 53: #define TP_BSIZE        1024

/usr/src/redhat/BUILD/dump-0.4b15/restore/restore.h:
line 74: extern FILE        *terminal;

/usr/src/redhat/BUILD/dump-0.4b15/restore/tape.c:
line 311:         char buf[TP_BSIZE];
line 357:                         (void) fgets(buf, BUFSIZ, terminal);

Now isn't putting potentially 8192 bytes of data in a 1024 byte
variable a bit much?  Anyway, either change line 311 in tape.c to:
        char buf[BUFSIZ];
or change line 357 of tape.c to:
                        (void) fgets(buf, TP_BSIZE, terminal);
I expect either one should do the job.

-Stan Bubrouski

Comment 1 Stelian Pop 2000-06-03 22:30:09 UTC
You are absolutely right. Thanks for the bug report.

Could you in the future send a copy of this kind of bug reports directly
to the dump maintainer. It would be easier for me to get the patches...
I know, it's the job of RedHat's guys but...

Stelian.

Comment 2 Preston Brown 2000-06-27 16:09:07 UTC
fixed in rawhide.


Note You need to log in before you can comment on or make changes to this bug.