compr_lzo.c: allocate enough memory for lzo compressor.
PATCH 1/1 compr_lzo.c: allocate enough memory for lzo compressor.
This is the same bug as in kernel, pointed out the LZO author (Markus Oberhumer):
--- compr_lzo.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
compr_lzo.c +1 -1
@@ -97,7 +97,7 @@ int jffs2_lzo_init(void)return -1 ;/* Worse case LZO compression size from their FAQ */ - lzo_compress_buf =malloc (page_size + (page_size /64 ) +16 +3 ); + lzo_compress_buf =malloc (page_size + (page_size /16 ) +64 +3 );if (!lzo_compress_buf) {free (lzo_mem);return -1 ;
Signature · 5 lines
1.5.4.5 -- "rm -rf" only sounds scary if you don't have backups
Quoted 13 lines · Riku Voipio
This is the same bug as in kernel, pointed out the LZO author (Markus Oberhumer):
--- compr_lzo.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)compr_lzo.c +0
-0
compr_lzo.c int jffs2_lzo_init(void) · line 103
Quoted 8 lines
compr_lzo.c +1
-1@@ -97,7 +97,7 @@ int jffs2_lzo_init(void)return -1 ;/* Worse case LZO compression size from their FAQ */ - lzo_compress_buf =malloc (page_size + (page_size /64 ) +16 +3 ); + lzo_compress_buf =malloc (page_size + (page_size /16 ) +64 +3 );if (!lzo_compress_buf) {free (lzo_mem);return -1 ;
I think you should use lzo1x_worst_compress() from the link you posted above.
Jocke
Quoted 17 lines · Joakim Tjernlund
Quoted 15 lines · Riku Voipio
This is the same bug as in kernel, pointed out the LZO author (Markus Oberhumer):
--- compr_lzo.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)compr_lzo.c +0
-0@@ -97,7 +97,7 @@ int jffs2_lzo_init(void)return -1 ;
Quoted 9 lines
compr_lzo.c int jffs2_lzo_init(void) · line 103
Quoted 6 lines
compr_lzo.c +1
-1/* Worse case LZO compression size from their FAQ */ - lzo_compress_buf =malloc (page_size + (page_size /64 ) +16 +3 ); + lzo_compress_buf =malloc (page_size + (page_size /16 ) +64 +3 );if (!lzo_compress_buf) {free (lzo_mem);return -1 ;I think you should use
lzo1x_worst_compress()from the link you posted above.
lzo1x_worst_compress() is in the kernel header, while patch is for the userland mtd-utils. The kernel header doesn't seem to get installed with make headers_install, so I can't use it from userland. Also, liblzo2 headers don't provide such function (although IMO they should).
Signature · 1 line
"rm -rf" only sounds scary if you don't have backups
Quoted 7 lines · Riku Voipio
This is the same bug as in kernel, pointed out the LZO author (Markus Oberhumer):
--- compr_lzo.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Both patches are pushed, thanks.
Signature · 2 lines
Best regards, Artem Bityutskiy (Битюцкий Артём)