Skip to content

Commit 80fa26c

Browse files
committed
Fix various bugs found by OSS-Fuze.
1 parent 00f937e commit 80fa26c

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Diff for: common/config.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ namespace acommon {
763763
}
764764
res.append(':');
765765
}
766-
if (res.back() == ':') res.pop_back();
766+
if (!res.empty() && res.back() == ':') res.pop_back();
767767
}
768768

769769
struct ListAddHelper : public AddableContainer

Diff for: common/file_util.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ namespace acommon {
181181
while ( (dir = els.next()) != 0 )
182182
{
183183
path = dir;
184+
if (path.empty()) continue;
184185
if (path.back() != '/') path += '/';
185186
unsigned dir_len = path.size();
186187
path += filename;

Diff for: common/getdata.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ namespace acommon {
6464
char * unescape(char * dest, const char * src)
6565
{
6666
while (*src) {
67-
if (*src == '\\') {
67+
if (*src == '\\' && src[1]) {
6868
++src;
6969
switch (*src) {
7070
case 'n': *dest = '\n'; break;

0 commit comments

Comments
 (0)