forked from polkit-org/polkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turn local modifications of mocklibc into patches and apply them via …
…diff_files The local copy of mocklibc was changed in 63ee649 5b8cd1a 0d78d1e Turn those into patches and apply them via the diff_files mechanism. This requires Meson 0.63.0, so bump the version accordingly. https://mesonbuild.com/Wrap-dependency-system-manual.html#diff-files
- Loading branch information
Showing
5 changed files
with
135 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= <mitr@redhat.com> | ||
Date: Sat, 13 Apr 2013 03:19:17 +0200 | ||
Subject: [PATCH 1/3] Fix various memory leaks. | ||
|
||
The XML_ParserCreate_MM one was found by Florian Weimer in | ||
https://bugzilla.redhat.com/show_bug.cgi?id=888728 . | ||
|
||
This should cover everything found by valgrind on the JS authority | ||
test, augmented with a call to | ||
polkit_backend_authority_enumerate_actions() to verify the | ||
XML_ParserCreate_MM case. | ||
|
||
https://bugs.freedesktop.org/show_bug.cgi?id=63492 | ||
--- | ||
src/netgroup.c | 5 ++++- | ||
1 file changed, 4 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/src/netgroup.c b/src/netgroup.c | ||
index f2ee857..bc99555 100644 | ||
--- a/src/netgroup.c | ||
+++ b/src/netgroup.c | ||
@@ -122,7 +122,10 @@ struct netgroup *netgroup_parse_all() { | ||
char * line = NULL; | ||
ssize_t line_size = getline(&line, &line_alloc, stream); | ||
if (line_size == -1) | ||
- break; | ||
+ { | ||
+ free(line); | ||
+ break; | ||
+ } | ||
|
||
struct netgroup *nextgroup = netgroup_parse_line(line); | ||
free(line); | ||
-- | ||
2.43.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From: Colin Walters <walters@verbum.org> | ||
Date: Wed, 3 Jun 2015 16:31:12 -0400 | ||
Subject: [PATCH 2/3] tests: Correct boundary test for overflow | ||
|
||
The offset has to be strictly less than the max. | ||
|
||
https://bugs.freedesktop.org/show_bug.cgi?id=87716 | ||
--- | ||
src/netgroup.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/src/netgroup.c b/src/netgroup.c | ||
index bc99555..06a8a89 100644 | ||
--- a/src/netgroup.c | ||
+++ b/src/netgroup.c | ||
@@ -326,7 +326,7 @@ struct entry *netgroup_iter_next(struct netgroup_iter *iter) { | ||
|
||
// Grow the stack | ||
iter->depth++; | ||
- if (iter->depth > NETGROUP_MAX_DEPTH) { | ||
+ if (iter->depth >= NETGROUP_MAX_DEPTH) { | ||
iter->depth = -1; | ||
return NULL; // Too much recursion | ||
} | ||
-- | ||
2.43.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
From: Vincent Mihalkovic <vmihalko@redhat.com> | ||
Date: Fri, 8 Mar 2024 14:04:33 +0100 | ||
Subject: [PATCH 3/3] mocklibc: move the print_indent function to the file | ||
where it is used | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
This fixes build error with GCC >= 14 and clang >= 17, | ||
failing on: | ||
``` | ||
../subprojects/mocklibc-1.0/src/netgroup-debug.c:25:3: error: implicit declaration of function ‘print_indent’ [-Wimplicit-function-declaration] | ||
25 | print_indent(stream, indent); | ||
| ^~~~~~~~~~~~ | ||
``` | ||
|
||
Closes: #6 | ||
--- | ||
src/netgroup-debug.c | 11 +++++++++++ | ||
src/netgroup.c | 11 ----------- | ||
2 files changed, 11 insertions(+), 11 deletions(-) | ||
|
||
diff --git a/src/netgroup-debug.c b/src/netgroup-debug.c | ||
index 81d6e72..46e5b25 100644 | ||
--- a/src/netgroup-debug.c | ||
+++ b/src/netgroup-debug.c | ||
@@ -21,6 +21,17 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
+/** | ||
+ * Print a varaible indentation to the stream. | ||
+ * @param stream Stream to print to | ||
+ * @param indent Number of indents to use | ||
+ */ | ||
+static void print_indent(FILE *stream, unsigned int indent) { | ||
+ int i; | ||
+ for (i = 0; i < indent; i++) | ||
+ fprintf(stream, " "); | ||
+} | ||
+ | ||
void netgroup_debug_print_entry(struct entry *entry, FILE *stream, unsigned int indent) { | ||
print_indent(stream, indent); | ||
|
||
diff --git a/src/netgroup.c b/src/netgroup.c | ||
index 06a8a89..e16e451 100644 | ||
--- a/src/netgroup.c | ||
+++ b/src/netgroup.c | ||
@@ -71,17 +71,6 @@ static char *parser_copy_word(char **cur) { | ||
return result; | ||
} | ||
|
||
-/** | ||
- * Print a varaible indentation to the stream. | ||
- * @param stream Stream to print to | ||
- * @param indent Number of indents to use | ||
- */ | ||
-void print_indent(FILE *stream, unsigned int indent) { | ||
- int i; | ||
- for (i = 0; i < indent; i++) | ||
- fprintf(stream, " "); | ||
-} | ||
- | ||
/** | ||
* Connect entries with 'child' type to their child entries. | ||
* @param headentry Head of list of entries that need to be connected | ||
-- | ||
2.43.0 | ||
|