Mailinglist Archive: opensuse-packaging (202 mails)

< Previous Next >
Re: [opensuse-packaging] boinc-client: bnc#689499
El 10/05/11 15:15, David Haller escribió:

==== Top of file: ====
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1
#endif
#include <limits.h>
#include <errno.h>
[..: former line 373]
#else
char filename[NAME_MAX], subdir[PATH_MAX];
[..]
if (retval) break;
retval = snprintf(subdir, PATH_MAX-2, "%s/%s", dirpath, filename);
if(retval >= PATH_MAX-2) {
errno = ENAMETOOLONG; perror(""); /* oder so ähnlich */
break;
}
[..]
====

Someone who knows C better should check that though. AFAIK the limit
of PATH_MAX-2 ('/' + '\0' + dirpath (w/o '\0') + filename (w/o '\0'))
should be ok, but ...

There is other problems with this stuff that upstream has to fix, see
the function definition

int dir_size(const char* dirpath, double& size, bool recurse) .. that's
going to fail with an integer overflow sooner or later...


** off_t *** dir_size ... and fix the underlying code that is not going
to handle stuff correctly in its currrent incarnation...


--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >