-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy path045-CR7025778.patch
44 lines (43 loc) · 1.3 KB
/
045-CR7025778.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--- a/src/lib/libcmd/cmp.c Mon Apr 12 15:39:53 2010
+++ b/src/lib/libcmd/cmp.c Tue Jun 28 13:59:47 2011
@@ -1,3 +1,7 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+
/***********************************************************************
* *
* This software is part of the ast package *
@@ -164,6 +168,10 @@
return ret;
if (!(p1 = (unsigned char*)sfreserve(f1, SF_UNBOUND, 0)) || (c1 = sfvalue(f1)) <= 0)
{
+ if (sferror(f1)) {
+ error(ERROR_exit(2),
+ "read error on %s", file1);
+ }
if ((e2 - p2) > 0 || sfreserve(f2, SF_UNBOUND, 0) && sfvalue(f2) > 0)
{
ret = 1;
@@ -170,6 +178,10 @@
if (!(flags & CMP_SILENT))
error(ERROR_exit(1), "EOF on %s", file1);
}
+ if (sferror(f2)) {
+ error(ERROR_exit(2),
+ "read error on %s", file2);
+ }
return ret;
}
if (count > 0 && c1 > count)
@@ -181,6 +193,10 @@
{
if (!(p2 = (unsigned char*)sfreserve(f2, SF_UNBOUND, 0)) || (c2 = sfvalue(f2)) <= 0)
{
+ if (sferror(f2)) {
+ error(ERROR_exit(2),
+ "read error on %s", file2);
+ }
if (!(flags & CMP_SILENT))
error(ERROR_exit(1), "EOF on %s", file2);
return 1;