Patch for repquota.c (quota-utils), fixes segmentation fault.

Simon Josefsson (jas@tanken.canit.se)
07 May 96 01:08:41 +0100


Starting with kernel somewhere 1.3.[56789]x i started to get segmentation
faults in repquota (when running "repquota -a"). The patch is below.

(if someone wants the patch to get 1.51 to compile (problems with include-files
and #defines), mail me. This patch alone doesn't make quota-utils 1.51
compile..).

*** quota-1.51-fixed/repquota.c Sun Mar 17 20:26:07 1996
--- repquota.c Mon May 6 23:45:46 1996
***************
*** 288,294 ****
if (id > highid[type])
highid[type] = id;
if (name) {
! memcpy(fup->fu_name, name, 10);
} else {
sprintf(fup->fu_name, "%u", id);
}
--- 288,295 ----
if (id > highid[type])
highid[type] = id;
if (name) {
! strncpy(fup->fu_name, name, 10);
! fup->fu_name[10] = '\0';
} else {
sprintf(fup->fu_name, "%u", id);
}

// JaS