[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#814792: *** stack smashing detected ***: /usr/lib/plan9/bin/sha1sum terminated



Package: 9base
Version: 1:6-6
Followup-For: Bug #814792

Dear Maintainer,

The problem is that the fmt string provided in sha1sum.c is wrong, supplied
is '%.2ux' when it should just be '%.2x':

http://man.cat-v.org/plan_9/2/fprintf

The attached patch fixes this, and also prints out the correct sha1, rather
than some unsigned 8 bit integer that partially overwrites its-self :)

Thanks

-- System Information:
Debian Release: 8.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 4.2.0-0.bpo.1-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages 9base depends on:
ii  libc6  2.19-18+deb8u4

9base recommends no packages.

Versions of packages 9base suggests:
pn  wmii2  <none>

-- no debconf information
--- sha1sum/sha1sum.c.orig	2016-06-10 16:45:08.799679149 +0100
+++ sha1sum/sha1sum.c	2016-06-10 16:44:52.479679562 +0100
@@ -12,7 +12,7 @@
 
 	p = va_arg(fmt->args, uchar*);
 	for(i=0; i<SHA1dlen; i++)
-		sprint(buf+2*i, "%.2ux", p[i]);
+		sprint(buf+2*i, "%.2x", p[i]);
 	return fmtstrcpy(fmt, buf);
 }
 

Reply to: