Skip to content

Commit 59825d9

Browse files
committed
updated
1 parent bb6c0d2 commit 59825d9

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

modules/dav/main/util.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -599,12 +599,8 @@ DAV_DECLARE(dav_error *) dav_parse_locktoken(apr_pool_t *p,
599599
int has_open;
600600
int has_close;
601601

602-
if (output == NULL) {
603-
return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
604-
"DAV lock token parser called with NULL output pointer.");
605-
}
606602
*output = NULL;
607-
603+
608604
if (input == NULL) {
609605
return dav_new_error(p, HTTP_BAD_REQUEST, 0, 0,
610606
"No Lock-Token specified in header.");
@@ -617,14 +613,15 @@ DAV_DECLARE(dav_error *) dav_parse_locktoken(apr_pool_t *p,
617613

618614
if (len < 2 || !has_open || !has_close) {
619615
return dav_new_error(p, HTTP_BAD_REQUEST, 0, 0,
620-
"Malformed Lock-Token header.");
616+
"Malformed Lock-Token");
621617
}
622618

623-
token = apr_pstrndup(p, input + 1, len - 2);
619+
token = apr_pmemdup(p, input + 1, len - 2);
620+
token[len - 2] = '\0';
624621

625622
if (*token == '\0') {
626623
return dav_new_error(p, HTTP_BAD_REQUEST, 0, 0,
627-
"Malformed Lock-Token header.");
624+
"Malformed Lock-Token");
628625
}
629626

630627
*output = token;

0 commit comments

Comments
 (0)