LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File openjpeg-bsc999817-cve2016-7445-null-deref.patch of Package openjpeg (Project home:linux4humans:rebuilds_of_some_packman_apps)

diff --git a/applications/codec/convert.c b/applications/codec/convert.c
index 082aa2c..d4c850c 100644
--- a/applications/codec/convert.c
+++ b/applications/codec/convert.c
@@ -1652,8 +1652,10 @@ static void read_pnm_header(FILE *reader, struct pnm_header *ph)
     if( !have_wh)
   {
     s = skip_int(s, &ph->width);
+	if (s == NULL || *s == 0) return;
 
     s = skip_int(s, &ph->height);
+	if (s == NULL || *s == 0) return;
 
     have_wh = 1;
 
@@ -1665,6 +1667,7 @@ static void read_pnm_header(FILE *reader, struct pnm_header *ph)
   {
 /* P2, P3, P5, P6: */
     s = skip_int(s, &ph->maxval);
+	if (s == NULL || *s == 0) return;
 
     if(ph->maxval > 65535) return;
   }