mirror of
https://github.com/samba-team/samba.git
synced 2025-10-23 11:33:16 +03:00
r21419: Give some more clue about what's going on
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
56ed4499d6
commit
76b377d5ad
@@ -185,7 +185,7 @@ static int ejs_substr(MprVarHandle eid, int argc, struct MprVar **argv)
|
||||
length = strlen(orig);
|
||||
if (start_offset < 0) start_offset += strlen(orig);
|
||||
if (start_offset < 0 || start_offset > strlen(orig)) {
|
||||
ejsSetErrorMsg(eid, "substr arg 2 out of bounds");
|
||||
ejsSetErrorMsg(eid, "substr arg 2 out of bounds ([%s], %d)", orig, start_offset);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ static int ejs_substr(MprVarHandle eid, int argc, struct MprVar **argv)
|
||||
length = mprToInt(argv[2]);
|
||||
if (length < 0) length += strlen(orig) - start_offset;
|
||||
if (length < 0 || length+start_offset > strlen(orig)) {
|
||||
ejsSetErrorMsg(eid, "substr arg 3 out of bounds");
|
||||
ejsSetErrorMsg(eid, "substr arg 3 out of bounds ([%s], %d, %d)", orig, start_offset, length);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user