Bug 1652624 - There is an illegal READ memory access at caca/dither.c:1337 (function:get_rgba_default )in libcaca latest version.
Summary: There is an illegal READ memory access at caca/dither.c:1337 (function:get_rg...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: libcaca
Version: 31
Hardware: All
OS: All
unspecified
urgent
Target Milestone: ---
Assignee: Matthias Saou
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-22 13:28 UTC by shuitao gan
Modified: 2020-11-24 17:47 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-24 17:47:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
./img2txt POC3 (74 bytes, image/bmp)
2018-11-22 13:28 UTC, shuitao gan
no flags Details

Description shuitao gan 2018-11-22 13:28:06 UTC
Created attachment 1507961 [details]
./img2txt POC3

version: libcaca0.99beta19
Summary: 

There is an illegal READ memory access at caca/dither.c:1337 (function:get_rgba_default )in libcaca latest version.

Description:

The asan debug is as follows:

$./img2txt POC3

==27737==ERROR: AddressSanitizer: SEGV on unknown address 0x7f71ea60cc0e (pc 0x7f71eeaafdf4 bp 0x0000000002a3 sp 0x7ffd06944bf0 T0)
==27737==The signal is caused by a READ memory access.
    #0 0x7f71eeaafdf3 in get_rgba_default /home/company/real/libcaca-master/caca/dither.c:1337
    #1 0x7f71eeab2a16 in caca_dither_bitmap /home/company/real/libcaca-master/caca/dither.c:1009
    #2 0x56414976496e in main /home/company/real/libcaca-master/src/img2txt.c:210
    #3 0x7f71ee6d01c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)
    #4 0x564149764f09 in _start (/home/company/real/libcaca-master/install_asan/bin/img2txt+0x2f09)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/company/real/libcaca-master/caca/dither.c:1337 in get_rgba_default
==27737==ABORTING




 static void get_rgba_default(caca_dither_t const *d, uint8_t const *pixels,
1313                              int x, int y, unsigned int *rgba)
1314 {
1315     uint32_t bits;
1316 
1317     pixels += (d->bpp / 8) * x + d->pitch * y;
1318 
1319     switch(d->bpp / 8)
1320     {
1321         case 4:
1322             bits = *(uint32_t const *)pixels;
1323             break;
1324         case 3:
1325         {
1326 #if defined(HAVE_ENDIAN_H)
1327             if(__BYTE_ORDER == __BIG_ENDIAN)
1328 #else
1329             /* This is compile-time optimised with at least -O1 or -Os */
1330             uint32_t const tmp = 0x12345678;
1331             if(*(uint8_t const *)&tmp == 0x12)
1332 #endif
1333                 bits = ((uint32_t)pixels[0] << 16) |
1334                        ((uint32_t)pixels[1] << 8) |
1335                        ((uint32_t)pixels[2]);
1336             else
1337                 bits = ((uint32_t)pixels[2] << 16) |   //illegal READ memory access
1338                        ((uint32_t)pixels[1] << 8) |
1339                        ((uint32_t)pixels[0]);
1340             break;
1341         }
1342         case 2:
1343             bits = *(uint16_t const *)pixels;
1344             break;
1345         case 1:
1346         default:
1347             bits = pixels[0];
1348             break;
1349     }
1350 
1351     if(d->has_palette)

Comment 1 Leonardo Taccari 2018-12-28 22:39:47 UTC
Hello shuitao!
was this reported upstream?  If not, can you please share this problem also with them?


Thank you!

Comment 2 Henri Salo 2018-12-29 03:29:07 UTC
Reported to upstream https://github.com/cacalabs/libcaca/issues/39

Comment 3 Leonardo Taccari 2018-12-29 14:20:13 UTC
Thank you very much Henri!

Comment 4 Ben Cotton 2019-08-13 16:54:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 5 Ben Cotton 2019-08-13 19:38:46 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 6 Ben Cotton 2020-11-03 16:47:02 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Ben Cotton 2020-11-24 17:47:50 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.