diff options
author | krj <krj@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-05-18 08:22:42 +0000 |
---|---|---|
committer | krj <krj@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-05-18 08:22:42 +0000 |
commit | 9fec2d229c3b530260b2dd26abc83f960ba7afad (patch) | |
tree | d1f7f007a69d02c724ea133129f39696c2efadc1 /epan/dissectors/dcerpc | |
parent | 51ac32fc4d151175761ebbfd5e0a3305f6c962d5 (diff) |
Handle fgets() error path
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32867 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/dcerpc')
-rw-r--r-- | epan/dissectors/dcerpc/idl2wrs.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/epan/dissectors/dcerpc/idl2wrs.c b/epan/dissectors/dcerpc/idl2wrs.c index 9955b7c7dc..bccef64a0a 100644 --- a/epan/dissectors/dcerpc/idl2wrs.c +++ b/epan/dissectors/dcerpc/idl2wrs.c @@ -3055,10 +3055,9 @@ readcnffile(FILE *fh) FPRINTF(NULL, "Reading conformance file\n=======================\n"); while(!feof(fh)){ cnfline[0]=0; - fgets(cnfline, 1023, fh); - if(!cnfline[0]){ - continue; - } + if(!fgets(cnfline, 1023, fh) || !cnfline[0]){ + continue; + } if(cnfline[0]=='#'){ /* ignore all comments */ } else if(!strncmp(cnfline, "NOEMIT", 6)){ @@ -3345,7 +3344,9 @@ int main(int argc, char *argv[]) } while(!feof(tfh)){ line[0]=0; - fgets(line, 1024, tfh); + if(!fgets(line, 1024, tfh) || !line[0]){ + continue; + } if(!strncmp(line, "ETH_CODE", 8)){ mergefile("ETH_CODE",fh); } else if(!strncmp(line, "ETH_HDR", 7)){ @@ -3378,8 +3379,10 @@ int main(int argc, char *argv[]) exit(10); } while(!feof(tfh)){ - line[0]=0; - fgets(line, 1024, tfh); + line[0]=0; + if(!fgets(line, 1024, tfh) || !line[0]){ + continue; + } if(!strncmp(line, "ETH_CODE", 8)){ mergefile("ETH_CODE",fh); } else if(!strncmp(line, "ETH_HDR", 7)){ |