[udftools: 2/4] fixed some most obvious issues from static analysis

Jan Horak hhorak at fedoraproject.org
Fri Jan 27 12:21:05 UTC 2012


commit f712e003993817f208152d0ac346699ff17a251b
Author: Honza HorĂ¡k <hhorak at redhat.com>
Date:   Fri Jan 27 13:17:28 2012 +0100

    fixed some most obvious issues from static analysis

 udftools-1.0.0b3-extsize.patch |   19 +++++++++++++++++++
 udftools.spec                  |    3 +++
 2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/udftools-1.0.0b3-extsize.patch b/udftools-1.0.0b3-extsize.patch
index 6316f66..eecac4b 100644
--- a/udftools-1.0.0b3-extsize.patch
+++ b/udftools-1.0.0b3-extsize.patch
@@ -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)
+@@ -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)
+
diff --git a/udftools.spec b/udftools.spec
index 5edad91..b559efd 100644
--- a/udftools.spec
+++ b/udftools.spec
@@ -13,6 +13,7 @@ Patch3: udftools-1.0.0b3-warningfixes.patch
 Patch4: udftools-1.0.0b3-fixcompile.patch
 Patch5: udftools-1.0.0b3-warningfixes2.patch
 Patch6: udftools-1.0.0b3-extsize.patch
+Patch7: udftools-1.0.0b3-staticanal.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildRequires: readline-devel, ncurses-devel
 
@@ -29,6 +30,7 @@ Linux UDF Filesystem userspace utilities.
 %patch4 -p1 -b .fixcompile
 %patch5 -p1 -b .warningfixes2
 %patch6 -p1 -b .extsize
+%patch7 -p1 -b .staticanal
 
 
 %build
@@ -59,6 +61,7 @@ export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
 * Thu Jan 26 2012 Honza Horak <hhorak at redhat.com> - 1.0.0b3-14
 - fixed segmentation fault
   Resolves: #685005
+- fixed some most obvious issues from static analysis
 
 * Mon Feb 07 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0.0b3-13
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild


More information about the scm-commits mailing list