Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
c78b9fed
Commit
c78b9fed
authored
Aug 15, 2015
by
Davis King
Browse files
Fixed a bug in parse_xml(). It failed to check if the given input stream was
valid before trying to parse it.
parent
ecdfdea6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
dlib/xml_parser/xml_parser_kernel_1.h
dlib/xml_parser/xml_parser_kernel_1.h
+8
-0
dlib/xml_parser/xml_parser_kernel_abstract.h
dlib/xml_parser/xml_parser_kernel_abstract.h
+4
-5
No files found.
dlib/xml_parser/xml_parser_kernel_1.h
View file @
c78b9fed
...
...
@@ -1412,6 +1412,8 @@ namespace dlib
error_handler
&
eh
)
{
if
(
!
in
)
throw
xml_parse_error
(
"Unexpected end of file during xml parsing."
);
xml_parser
parser
;
parser
.
add_document_handler
(
dh
);
parser
.
add_error_handler
(
eh
);
...
...
@@ -1424,6 +1426,8 @@ namespace dlib
document_handler
&
dh
)
{
if
(
!
in
)
throw
xml_parse_error
(
"Unexpected end of file during xml parsing."
);
xml_parser
parser
;
parser
.
add_document_handler
(
dh
);
parser
.
add_error_handler
(
eh
);
...
...
@@ -1435,6 +1439,8 @@ namespace dlib
error_handler
&
eh
)
{
if
(
!
in
)
throw
xml_parse_error
(
"Unexpected end of file during xml parsing."
);
xml_parser
parser
;
parser
.
add_error_handler
(
eh
);
parser
.
parse
(
in
);
...
...
@@ -1445,6 +1451,8 @@ namespace dlib
document_handler
&
dh
)
{
if
(
!
in
)
throw
xml_parse_error
(
"Unexpected end of file during xml parsing."
);
xml_parser
parser
;
parser
.
add_document_handler
(
dh
);
impl
::
default_xml_error_handler
eh
;
...
...
dlib/xml_parser/xml_parser_kernel_abstract.h
View file @
c78b9fed
...
...
@@ -223,7 +223,7 @@ namespace dlib
supplied error_handler and document_handler.
throws
- xml_parse_error
Thrown if there is a problem
open
ing the input file.
Thrown if there is a problem
pars
ing the input file.
!*/
void
parse_xml
(
...
...
@@ -237,7 +237,7 @@ namespace dlib
supplied error_handler and document_handler.
throws
- xml_parse_error
Thrown if there is a problem
open
ing the input file.
Thrown if there is a problem
pars
ing the input file.
!*/
void
parse_xml
(
...
...
@@ -250,7 +250,7 @@ namespace dlib
supplied error_handler.
throws
- xml_parse_error
Thrown if there is a problem
open
ing the input file.
Thrown if there is a problem
pars
ing the input file.
!*/
void
parse_xml
(
...
...
@@ -265,8 +265,7 @@ namespace dlib
if a fatal parsing error is encountered.
throws
- xml_parse_error
Thrown if a fatal parsing error is encountered or if there is a problem
opening the input file.
Thrown if there is a problem parsing the input file.
!*/
// ----------------------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment