From 1cde19228e6f46a9c0994566a941d9b63df9b68b Mon Sep 17 00:00:00 2001 From: correctmost <134317971+correctmost@users.noreply.github.com> Date: Wed, 31 Jan 2024 19:04:52 +0000 Subject: [PATCH] epub: Fix an incorrect sizeof call detected by AddressSanitizer (#635) This commit also fixes a build directory typo in INSTALL.md. --- INSTALL.md | 2 +- backend/epub/epub-document.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 1ec4215a..23f2550a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -47,7 +47,7 @@ cd xreader # libraries, and shared files into /usr/local, and # enables all available options: -meson buildir \ +meson builddir \ --prefix=/usr/local \ --buildtype=plain \ -D deprecated_warnings=false \ diff --git a/backend/epub/epub-document.c b/backend/epub/epub-document.c index 157209bc..a502aa10 100644 --- a/backend/epub/epub-document.c +++ b/backend/epub/epub-document.c @@ -1055,7 +1055,7 @@ setup_document_content_list(const gchar* content_uri, GError** error,gchar *docu } if ( xmlStrcmp(itemrefptr->name,(xmlChar*)"itemref") == 0) { - contentListNode *newnode = g_malloc0(sizeof(newnode)); + contentListNode *newnode = g_malloc0(sizeof(*newnode)); newnode->key = (gchar*)xml_get_data_from_node(itemrefptr,XML_ATTRIBUTE,(xmlChar*)"idref"); if ( newnode->key == NULL ) {