~sircmpwn/public-inbox

fdicons: Fix buffer overflow for extension criterias v1 PROPOSED

Tom Lebreux
Tom Lebreux: 2
 Fix buffer overflow for extension criterias
 Update README.md usage

 2 files changed, 3 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/public-inbox/patches/9904/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH fdicons 1/2] Fix buffer overflow for extension criterias Export this patch

Tom Lebreux
---
 fdicons.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fdicons.c b/fdicons.c
index ce3a46738113..09b56420ef72 100644
--- a/fdicons.c
+++ b/fdicons.c
@@ -223,7 +223,8 @@ get_icon(struct fd_icon_database *database, int argc, char **argv)
				*p = '\0';
				++nexts;
			}
			criteria.extensions = malloc(nexts + 1);
			criteria.extensions =
				malloc(sizeof(char *) * (nexts + 1));
			for (int i = 0; i < nexts; ++i) {
				criteria.extensions[i] = optarg;
				optarg = strchr(optarg, '\0') + 1;
-- 
2.25.0

[PATCH fdicons 2/2] Update README.md usage Export this patch

Tom Lebreux
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 51e2689d8a49..32a60abc2db0 100644
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ icon = fd_icon_database_get_icon_criteria(db, &criteria);
## Basic Usage (CLI)

```sh
$ fdicons find-icon -e png,svg -S 2 64 firefox web-browser application
$ fdicons get-icon -x png,svg -S 2 64 firefox web-browser application
/usr/share/icons/hicolor/64x64@2/apps/firefox.png
```

-- 
2.25.0