[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-devel] [bug #52544] Incorrect sanity check in lib/data.c
From: |
Vladimir Markelov |
Subject: |
[gnuastro-devel] [bug #52544] Incorrect sanity check in lib/data.c |
Date: |
Tue, 28 Nov 2017 00:37:25 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0 |
URL:
<http://savannah.gnu.org/bugs/?52544>
Summary: Incorrect sanity check in lib/data.c
Project: GNU Astronomy Utilities
Submitted by: vvm
Submitted on: Mon 27 Nov 2017 09:37:24 PM PST
Category: Libraries
Severity: 2 - Minor
Item Group: Source code
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Starting from line 325 in lib/data.c
if(dsize[i]<=0)
error(EXIT_FAILURE, 0, "%s: the size of a dimension cannot be "
"zero or negative. dsize[%zu], but has a value of %zu",
__func__, i, dsize[i]);
dsize is size_t that is unsigned type and can never be negative. So, either we
change to 'if(dsize[i]==0)' and fix the error message, or we should think of
too big value and change to 'if (dsize[i] == 0 || dsize[i] > SOME_LIMIT)' and
fix the error message like '%s: the size of dimension must be between 1 and
SOME_LIMIT, but ....'.
It is an easy fix but I am not sure about high limit value.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52544>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [gnuastro-devel] [bug #52544] Incorrect sanity check in lib/data.c,
Vladimir Markelov <=