fix non-working strtoint conversion in webdav_xattr_parse_data by switching to cx_strtoi64

Wed, 25 Jun 2025 21:00:29 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 25 Jun 2025 21:00:29 +0200
changeset 612
d647ba7f0db6
parent 611
b446daba6839
child 613
b649d66c433e

fix non-working strtoint conversion in webdav_xattr_parse_data by switching to cx_strtoi64

src/server/webdav/xattrbackend.c file | annotate | diff | comparison | revisions
--- a/src/server/webdav/xattrbackend.c	Wed Jun 25 20:45:21 2025 +0200
+++ b/src/server/webdav/xattrbackend.c	Wed Jun 25 21:00:29 2025 +0200
@@ -634,10 +634,8 @@
             } else if(cx_strprefix(line, s_data)) {
                 line = cx_strsubs(line, 5);
                 
-                // util_strtoint just works here, because the line ends with \n
-                // the xattr content data is also garanteed to be 0-terminated
                 int64_t data_len = 0;
-                if(!util_strtoint(line.ptr, &data_len)) {
+                if(cx_strtoi64(line, &data_len, 10)) {
                     log_ereport(
                             LOG_FAILURE,
                             "webdav xattr backend: file %s: invalid xattr format[%d]: number expected after data",

mercurial