]> TLD Linux GIT Repositories - packages/rpm.git/blob - rpm-div0.patch
54775bd071ecfd2efe8b60f9204e1eb47b5f5616
[packages/rpm.git] / rpm-div0.patch
1 diff -ur rpm-4.5.orig/lib/rpmds.c rpm-4.5/lib/rpmds.c
2 --- rpm-4.5.orig/lib/rpmds.c    2019-06-01 18:55:39.433000000 +0200
3 +++ rpm-4.5/lib/rpmds.c 2019-08-16 10:50:36.274000000 +0200
4 @@ -3008,6 +3008,8 @@
5         case SHT_DYNAMIC:
6             data = NULL;
7             while ((data = elf_getdata (scn, data)) != NULL) {
8 +               if (shdr->sh_entsize == 0)
9 +                   continue;
10  /*@-boundswrite@*/
11                 for (cnt = 0; cnt < (shdr->sh_size / shdr->sh_entsize); ++cnt) {
12                     dyn = gelf_getdyn (data, cnt, &dyn_mem);
13 diff -ur rpm-4.5.orig/rpmdb/legacy.c rpm-4.5/rpmdb/legacy.c
14 --- rpm-4.5.orig/rpmdb/legacy.c 2007-07-30 04:28:13.000000000 +0200
15 +++ rpm-4.5/rpmdb/legacy.c      2019-08-16 10:35:01.076000000 +0200
16 @@ -99,7 +99,7 @@
17      /*@-branchstate -uniondef @*/
18      while (!bingo && (scn = elf_nextscn(elf, scn)) != NULL) {
19         (void) gelf_getshdr(scn, &shdr);
20 -       if (shdr.sh_type != SHT_DYNAMIC)
21 +       if (shdr.sh_type != SHT_DYNAMIC || shdr.sh_entsize == 0)
22             continue;
23         while (!bingo && (data = elf_getdata (scn, data)) != NULL) {
24             int maxndx = data->d_size / shdr.sh_entsize;