libdom: vendor patch (no longer exists on server) (#523036)
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
--- a/bindings/xml/expat_xmlparser.c
|
||||
+++ b/bindings/xml/expat_xmlparser.c
|
||||
@@ -484,7 +484,7 @@
|
||||
|
||||
UNUSED(int_enc);
|
||||
|
||||
- parser = calloc(sizeof(*parser), 1);
|
||||
+ parser = calloc(1, sizeof(*parser));
|
||||
if (parser == NULL) {
|
||||
msg(DOM_MSG_CRITICAL, mctx, "No memory for parser");
|
||||
return NULL;
|
||||
--- a/src/core/node.c
|
||||
+++ b/src/core/node.c
|
||||
@@ -2379,7 +2379,7 @@
|
||||
if (t == NULL) {
|
||||
/* Create the event target list */
|
||||
size = 64;
|
||||
- t = calloc(sizeof(*t), size);
|
||||
+ t = calloc(size, sizeof(*t));
|
||||
if (t == NULL) {
|
||||
return DOM_NO_MEM_ERR;
|
||||
}
|
||||
--- a/src/html/html_document.c
|
||||
+++ b/src/html/html_document.c
|
||||
@@ -134,13 +134,12 @@
|
||||
doc->cookie = NULL;
|
||||
doc->body = NULL;
|
||||
|
||||
- doc->memoised = calloc(sizeof(dom_string *), hds_COUNT);
|
||||
+ doc->memoised = calloc(hds_COUNT, sizeof(dom_string *));
|
||||
if (doc->memoised == NULL) {
|
||||
error = DOM_NO_MEM_ERR;
|
||||
goto out;
|
||||
}
|
||||
- doc->elements = calloc(sizeof(dom_string *),
|
||||
- DOM_HTML_ELEMENT_TYPE__COUNT);
|
||||
+ doc->elements = calloc(DOM_HTML_ELEMENT_TYPE__COUNT, sizeof(dom_string *));
|
||||
if (doc->elements == NULL) {
|
||||
error = DOM_NO_MEM_ERR;
|
||||
goto out;
|
||||
@@ -23,11 +23,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
patches = [
|
||||
# fixes libdom build on gcc 14 due to calloc-transposed-args warning
|
||||
# remove on next release
|
||||
(fetchpatch {
|
||||
name = "fix-calloc-transposed-args.patch";
|
||||
url = "https://source.netsurf-browser.org/libdom.git/patch/?id=2687282d56dfef19e26e9639a5c0cd81de957e22";
|
||||
hash = "sha256-1uAdLM9foplCVu8IQlMMlXh6OWHs5eUgsKp+0ZqM9yM=";
|
||||
})
|
||||
./fix-calloc-transposed-args.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
Reference in New Issue
Block a user