diff options
author | Zoltan Puskas <zoltan@sinustrom.info> | 2022-06-28 21:52:27 -0700 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2022-09-14 16:01:11 +0200 |
commit | a020c595903fd11dedc3d33bc3f898651fc8eb36 (patch) | |
tree | 298b1e0409de4338fb9f467ab891d314384eb460 /app-text/aha/files | |
parent | www-servers/nginx-unit: add 1.28.0 (diff) | |
download | gentoo-a020c595903fd11dedc3d33bc3f898651fc8eb36.tar.gz gentoo-a020c595903fd11dedc3d33bc3f898651fc8eb36.tar.bz2 gentoo-a020c595903fd11dedc3d33bc3f898651fc8eb36.zip |
app-text/aha: new package, add 0.5.1
Signed-off-by: Zoltan Puskas <zoltan@sinustrom.info>
Closes: https://github.com/gentoo/gentoo/pull/26131
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'app-text/aha/files')
-rw-r--r-- | app-text/aha/files/aha-0.5.1-null-ptr-dereference-fix.patch | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/app-text/aha/files/aha-0.5.1-null-ptr-dereference-fix.patch b/app-text/aha/files/aha-0.5.1-null-ptr-dereference-fix.patch new file mode 100644 index 000000000000..6ec2ca9cae1d --- /dev/null +++ b/app-text/aha/files/aha-0.5.1-null-ptr-dereference-fix.patch @@ -0,0 +1,105 @@ +diff --git a/aha.c b/aha.c +index 46e43c0..2bfebb7 100644 +--- a/aha.c ++++ b/aha.c +@@ -138,6 +138,15 @@ pelem parseInsert(char* s) + return firstelem; + } + ++int parseDepthAtLeast(pelem elem, unsigned int wanted) { ++ while (elem != NULL) { ++ if (wanted == 0) return 1; ++ elem = elem->next; ++ --wanted; ++ } ++ return 0; ++} ++ + void deleteParse(pelem elem) + { + while (elem!=NULL) +@@ -831,27 +840,20 @@ int main(int argc,char* args[]) + } + else + if (momelem->value == 38 && +- momelem->next && +- momelem->next->value == 2 && +- momelem->next->next)// 38;2;<n> -> 24 Bit ++ parseDepthAtLeast(momelem, 4) && ++ momelem->next->value == 2)// 38;2;<r>;<g>;<b> -> 24 Bit + { +- momelem = momelem->next->next; +- pelem r,g,b; +- r = momelem; +- momelem = momelem->next; +- g = momelem; +- if ( momelem ) +- momelem = momelem->next; +- b = momelem; +- if ( r && g && b ) +- { +- state.highlighted = 0; +- state.fc_colormode = MODE_24BIT; +- *dest = +- (r->value & 255) * 65536 + +- (g->value & 255) * 256 + +- (b->value & 255); +- } ++ pelem r = momelem->next->next; ++ pelem g = r->next; ++ pelem b = g->next; ++ momelem = b; ++ ++ state.highlighted = 0; ++ state.fc_colormode = MODE_24BIT; ++ *dest = ++ (r->value & 255) * 65536 + ++ (g->value & 255) * 256 + ++ (b->value & 255); + } + else + { +@@ -899,27 +901,20 @@ int main(int argc,char* args[]) + } + else + if (momelem->value == 48 && +- momelem->next && +- momelem->next->value == 2 && +- momelem->next->next)// 48;2;<n> -> 24 Bit ++ parseDepthAtLeast(momelem, 4) && ++ momelem->next->value == 2)// 48;2;<r>;<g>;<b> -> 24 Bit + { +- momelem = momelem->next->next; +- pelem r,g,b; +- r = momelem; +- momelem = momelem->next; +- g = momelem; +- if ( momelem ) +- momelem = momelem->next; +- b = momelem; +- if ( r && g && b ) +- { +- state.bc_colormode = MODE_24BIT; +- state.highlighted = 0; +- *dest = +- (r->value & 255) * 65536 + +- (g->value & 255) * 256 + +- (b->value & 255); +- } ++ pelem r = momelem->next->next; ++ pelem g = r->next; ++ pelem b = g->next; ++ momelem = b; ++ ++ state.bc_colormode = MODE_24BIT; ++ state.highlighted = 0; ++ *dest = ++ (r->value & 255) * 65536 + ++ (g->value & 255) * 256 + ++ (b->value & 255); + } + else + { +-- +2.35.1 + |