summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2003-08-03 23:48:33 +0000
committerNathan Scott <nathans@sgi.com>2003-08-03 23:48:33 +0000
commitc061323a613bdf17b35dea9aece285f06273a0d1 (patch)
tree5bca5c1dbfc0011f7283510059c8a6dab60992da
parentd141df65f1b4ebb05f57d74b4afd1e8812f327d5 (diff)
downloadattr-c061323a613bdf17b35dea9aece285f06273a0d1.tar.gz
Fix up quote/unquote routines to handle NULL as input, fixes SEGVs in several ACL tools
-rw-r--r--VERSION2
-rw-r--r--debian/changelog6
-rw-r--r--doc/CHANGES3
-rw-r--r--libmisc/quote.c3
-rw-r--r--libmisc/unquote.c3
5 files changed, 16 insertions, 1 deletions
diff --git a/VERSION b/VERSION
index 678f35b..911b3ed 100644
--- a/VERSION
+++ b/VERSION
@@ -3,5 +3,5 @@
#
PKG_MAJOR=2
PKG_MINOR=4
-PKG_REVISION=7
+PKG_REVISION=8
PKG_BUILD=0
diff --git a/debian/changelog b/debian/changelog
index c36e6ee..cb97f59 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+attr (2.4.8-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Nathan Scott <nathans@debian.org> Mon, 04 Aug 2003 09:18:00 +1000
+
attr (2.4.7-1) unstable; urgency=low
* New upstream release
diff --git a/doc/CHANGES b/doc/CHANGES
index 21d1912..33ff44c 100644
--- a/doc/CHANGES
+++ b/doc/CHANGES
@@ -1,3 +1,6 @@
+attr-2.4.8 (04 August 2003)
+ - Make quote/unquote return NULL if passed NULL.
+
attr-2.4.7 (29 July 2003)
- Make quote return NULL if out of memory instead of exiting.
diff --git a/libmisc/quote.c b/libmisc/quote.c
index 633f941..fdd3af9 100644
--- a/libmisc/quote.c
+++ b/libmisc/quote.c
@@ -31,6 +31,9 @@ const char *quote(const char *str)
char *q;
size_t nonpr;
+ if (!str)
+ return str;
+
for (nonpr = 0, s = (unsigned char *)str; *s != '\0'; s++)
if (!isprint(*s) || isspace(*s) || *s == '\\')
nonpr++;
diff --git a/libmisc/unquote.c b/libmisc/unquote.c
index a3bf6fe..a6992da 100644
--- a/libmisc/unquote.c
+++ b/libmisc/unquote.c
@@ -27,6 +27,9 @@ char *unquote(char *str)
{
unsigned char *s, *t;
+ if (!str)
+ return str;
+
for (s = (unsigned char *)str; *s != '\0'; s++)
if (*s == '\\')
break;