Skip to content

Commit

Permalink
DMC-1133: validate that error string coming from davix is utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-manzi committed Jan 18, 2019
1 parent 108503e commit e88ebf7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugins/http/gfal_http_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,11 @@ static int davix2errno(StatusCode::Code code)

void davix2gliberr(const DavixError* daverr, GError** err)
{

std::string error_string= g_utf8_validate(daverr->getErrMsg().c_str(), daverr->getErrMsg().length(),NULL) ?
daverr->getErrMsg().c_str(): "Error string contains not UTF8 chars";
gfal2_set_error(err, http_plugin_domain, davix2errno(daverr->getStatus()), __func__,
"%s", daverr->getErrMsg().c_str());
"%s", error_string.c_str());
}


Expand Down

0 comments on commit e88ebf7

Please sign in to comment.