On Sat, 2011-07-02 at 15:54 +0400, Michael Tokarev wrote: > Package: nfs-common > Version: 1:1.2.3-3 > Severity: normal > Tags: upstream > > mount.nfs segfaults if kernel version number does not contain > at least 3 components delimited with a dot. > > The following patch fixes it somehow, but it's wrong because > it does not take into account that a dot may be part of, say, > debian release number like 3.0-debian3.0.1 for example. [...]
I think the correct way to do this is something like: unsigned int p, q, r = 0; ... if (sscanf(my_utsname.release, "%u.%u.%u", &p, &q, &r) < 2) return 0; return MAKE_VERSION(p, q, r); Ben. -- Ben Hutchings Never attribute to conspiracy what can adequately be explained by stupidity.
signature.asc
Description: This is a digitally signed message part