release: version 1.0.12 - Fix buffer corruption in dynbuf_append
- FIX: Copy null terminator during buffer reallocation (db->len + 1) - This fixes JSON corruption that caused double commas in output Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
%global spec_version 1.0.11
|
%global spec_version 1.0.12
|
||||||
|
|
||||||
Name: mod_reqin_log
|
Name: mod_reqin_log
|
||||||
Version: %{spec_version}
|
Version: %{spec_version}
|
||||||
@ -37,14 +37,14 @@ install -m 644 %{_pkgroot}/%{_sysconfdir}/httpd/conf.d/mod_reqin_log.conf %{buil
|
|||||||
%doc %{_docdir}/%{name}
|
%doc %{_docdir}/%{name}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Mar 02 2026 Developer <dev@example.com> - 1.0.11
|
* Mon Mar 02 2026 Developer <dev@example.com> - 1.0.12
|
||||||
|
- FIX: Fix buffer corruption in dynbuf_append by copying null terminator during reallocation
|
||||||
- PACKAGING: Mark config file as %config(noreplace) to preserve user modifications on upgrade
|
- PACKAGING: Mark config file as %config(noreplace) to preserve user modifications on upgrade
|
||||||
- FIX: Correct JSON string length parameters for query and fragment fields
|
- FIX: Correct JSON string length parameters for query and fragment fields
|
||||||
- FIX: Add null-termination after buffer reallocation in dynbuf_append
|
|
||||||
- CHANGE: Remove unparsed_uri, fragment, and content_length fields from JSON output
|
- CHANGE: Remove unparsed_uri, fragment, and content_length fields from JSON output
|
||||||
- TEST: Update unit tests to match dynbuf_append fix
|
- TEST: Update unit tests to match dynbuf_append fix
|
||||||
|
|
||||||
* Mon Mar 02 2026 Developer <dev@example.com> - 1.0.10
|
* Mon Mar 02 2026 Developer <dev@example.com> - 1.0.11
|
||||||
- FIX: Correct JSON string length parameters for query and fragment fields
|
- FIX: Correct JSON string length parameters for query and fragment fields
|
||||||
- FIX: Add null-termination after buffer reallocation in dynbuf_append
|
- FIX: Add null-termination after buffer reallocation in dynbuf_append
|
||||||
- CHANGE: Remove unparsed_uri, fragment, and content_length fields from JSON output
|
- CHANGE: Remove unparsed_uri, fragment, and content_length fields from JSON output
|
||||||
|
|||||||
@ -213,8 +213,7 @@ static void dynbuf_append(dynbuf_t *db, const char *str, apr_size_t len)
|
|||||||
if (db->len + len >= db->capacity) {
|
if (db->len + len >= db->capacity) {
|
||||||
apr_size_t new_capacity = (db->len + len + 1) * 2;
|
apr_size_t new_capacity = (db->len + len + 1) * 2;
|
||||||
char *new_data = apr_palloc(db->pool, new_capacity);
|
char *new_data = apr_palloc(db->pool, new_capacity);
|
||||||
memcpy(new_data, db->data, db->len);
|
memcpy(new_data, db->data, db->len + 1); /* Copy including null terminator */
|
||||||
new_data[db->len] = '\0';
|
|
||||||
db->data = new_data;
|
db->data = new_data;
|
||||||
db->capacity = new_capacity;
|
db->capacity = new_capacity;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,8 +43,7 @@ static void testbuf_append(testbuf_t *buf, const char *str, size_t len)
|
|||||||
if (buf->len + len + 1 > buf->cap) {
|
if (buf->len + len + 1 > buf->cap) {
|
||||||
size_t new_cap = (buf->len + len + 1) * 2;
|
size_t new_cap = (buf->len + len + 1) * 2;
|
||||||
char *new_data = apr_palloc(buf->pool, new_cap);
|
char *new_data = apr_palloc(buf->pool, new_cap);
|
||||||
memcpy(new_data, buf->data, buf->len);
|
memcpy(new_data, buf->data, buf->len + 1); /* Copy including null terminator */
|
||||||
new_data[buf->len] = '\0';
|
|
||||||
buf->data = new_data;
|
buf->data = new_data;
|
||||||
buf->cap = new_cap;
|
buf->cap = new_cap;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,8 +84,7 @@ static void dynbuf_append(dynbuf_t *db, const char *str, apr_size_t len)
|
|||||||
if (db->len + len >= db->capacity) {
|
if (db->len + len >= db->capacity) {
|
||||||
apr_size_t new_capacity = (db->len + len + 1) * 2;
|
apr_size_t new_capacity = (db->len + len + 1) * 2;
|
||||||
char *new_data = apr_palloc(db->pool, new_capacity);
|
char *new_data = apr_palloc(db->pool, new_capacity);
|
||||||
memcpy(new_data, db->data, db->len);
|
memcpy(new_data, db->data, db->len + 1); /* Copy including null terminator */
|
||||||
new_data[db->len] = '\0';
|
|
||||||
db->data = new_data;
|
db->data = new_data;
|
||||||
db->capacity = new_capacity;
|
db->capacity = new_capacity;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user