projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
15333a9
)
readvp2 should always initialise pfiledone in all cases
author
Arran Cudbard-Bell
<a.cudbardb@freeradius.org>
Mon, 2 Feb 2015 05:50:46 +0000
(12:50 +0700)
committer
Arran Cudbard-Bell
<a.cudbardb@freeradius.org>
Mon, 2 Feb 2015 06:01:45 +0000
(13:01 +0700)
src/lib/pair.c
patch
|
blob
|
history
diff --git
a/src/lib/pair.c
b/src/lib/pair.c
index
48af2a1
..
ad473ae
100644
(file)
--- a/
src/lib/pair.c
+++ b/
src/lib/pair.c
@@
-1762,7
+1762,6
@@
int readvp2(TALLOC_CTX *ctx, VALUE_PAIR **out, FILE *fp, bool *pfiledone)
vp_cursor_t cursor;
VALUE_PAIR *vp = NULL;
-
fr_cursor_init(&cursor, out);
while (fgets(buf, sizeof(buf), fp) != NULL) {
@@
-1771,7
+1770,10
@@
int readvp2(TALLOC_CTX *ctx, VALUE_PAIR **out, FILE *fp, bool *pfiledone)
* the end of that VP
*/
if (buf[0] == '\n') {
- if (vp) return 0;
+ if (vp) {
+ *pfiledone = false;
+ return 0;
+ }
continue;
}
@@
-1793,12
+1795,12
@@
int readvp2(TALLOC_CTX *ctx, VALUE_PAIR **out, FILE *fp, bool *pfiledone)
fr_cursor_merge(&cursor, vp);
buf[0] = '\0';
}
-
*pfiledone = true;
return 0;
error:
+ *pfiledone = false;
vp = fr_cursor_first(&cursor);
if (vp) pairfree(&vp);