fixed some most obvious issues from static analysis

This commit is contained in:
Honza Horák 2012-01-27 13:17:28 +01:00
parent ec629e8ed8
commit f712e00399
2 changed files with 22 additions and 0 deletions

View File

@ -19,3 +19,22 @@ diff -up udftools-1.0.0b3/libudffs/extent.c.extsize udftools-1.0.0b3/libudffs/ex
} }
struct udf_extent *prev_extent(struct udf_extent *start_ext, enum udf_space_type type) struct udf_extent *prev_extent(struct udf_extent *start_ext, enum udf_space_type type)
@@ -81,7 +81,7 @@ cont:
while (start_ext != NULL && start_ext->blocks < blocks)
start_ext = prev_extent(start_ext->prev, type);
- if ((start_ext->start + start_ext->blocks) % offset)
+ if (start_ext != NULL && (start_ext->start + start_ext->blocks) % offset)
{
dec = (start_ext->start + start_ext->blocks) % offset;
if (start_ext->blocks - dec < blocks)
@@ -93,7 +93,7 @@ cont:
else
dec = 0;
- return start_ext->start + start_ext->blocks - dec - blocks;
+ return start_ext ? start_ext->start + start_ext->blocks - dec - blocks : NULL;
}
struct udf_extent *find_extent(struct udf_disc *disc, uint32_t start)

View File

@ -13,6 +13,7 @@ Patch3: udftools-1.0.0b3-warningfixes.patch
Patch4: udftools-1.0.0b3-fixcompile.patch Patch4: udftools-1.0.0b3-fixcompile.patch
Patch5: udftools-1.0.0b3-warningfixes2.patch Patch5: udftools-1.0.0b3-warningfixes2.patch
Patch6: udftools-1.0.0b3-extsize.patch Patch6: udftools-1.0.0b3-extsize.patch
Patch7: udftools-1.0.0b3-staticanal.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: readline-devel, ncurses-devel BuildRequires: readline-devel, ncurses-devel
@ -29,6 +30,7 @@ Linux UDF Filesystem userspace utilities.
%patch4 -p1 -b .fixcompile %patch4 -p1 -b .fixcompile
%patch5 -p1 -b .warningfixes2 %patch5 -p1 -b .warningfixes2
%patch6 -p1 -b .extsize %patch6 -p1 -b .extsize
%patch7 -p1 -b .staticanal
%build %build
@ -59,6 +61,7 @@ export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
* Thu Jan 26 2012 Honza Horak <hhorak@redhat.com> - 1.0.0b3-14 * Thu Jan 26 2012 Honza Horak <hhorak@redhat.com> - 1.0.0b3-14
- fixed segmentation fault - fixed segmentation fault
Resolves: #685005 Resolves: #685005
- fixed some most obvious issues from static analysis
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0b3-13 * Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0b3-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild