Displaying 20 results from an estimated 170 matches for "long_max".
Did you mean:
ulong_max
2020 Aug 30
4
[Bug 3206] New: sftp client(32bit) chown command does not support uid >LONG_MAX
https://bugzilla.mindrot.org/show_bug.cgi?id=3206
Bug ID: 3206
Summary: sftp client(32bit) chown command does not support uid
>LONG_MAX
Product: Portable OpenSSH
Version: 6.9p1
Hardware: 68k
OS: All
Status: NEW
Severity: normal
Priority: P5
Component: sftp
Assignee: unassigned-bugs at mindrot.org
Reporter: booking00 at sina....
2014 May 12
4
[PATCH] isohybrid: fix overflow on 32 bit system
When call isohybrid with option '-u', it overflows on a 32 bits host. It
seeks to 512 bytes before the end of the image to install gpt header. If
the size of image is larger than LONG_MAX, it overflows fseek() and
cause error:
isohybrid: wrlinux-image-x86-64-20140505110100.iso: seek error - 8: Invalid argument
Check the offset and call fseek() multi-times if offset is too large.
Signed-off-by: Kai Kang <kai.kang at windriver.com>
---
utils/isohybrid.c | 14 +++++++++++---...
2004 Jul 15
2
[LLVMdev] Constants.cpp:368: error: `INT8_MAX' undeclared(firstuse this function)
.../* max value for unsigned short */
#define INT_MIN (-2147483647-1) /* min value for (signed) int */
#define INT_MAX 2147483647 /* max value for (signed) int */
#define UINT_MAX 0xffffffff /* max value for unsigned int */
#define LONG_MIN (-2147483647L-1) /* minimum (signed) long */
#define LONG_MAX 2147483647L /* maximum (signed) long */
#define ULONG_MAX 0xffffffffUL /* maximum unsigned long */
#if defined(_ALL_SOURCE) \
|| (__STDC__ - 0 == 0) && !defined(_POSIX_C_SOURCE) \
&& !defined(_XOPEN_SOURCE)
/*
* Minimum and maximum values for 64-bit types
* Define a...
2014 Jun 20
3
[PATCH] isohybrid: fix overflow on 32 bit system
When call isohybrid with option '-u', it overflows on a 32 bits host. It
seeks to 512 bytes before the end of the image to install gpt header. If
the size of image is larger than LONG_MAX, it overflows fseek() and
cause error:
isohybrid: image-x86-64-20140505110100.iso: seek error - 8: Invalid argument
Replace fseek with fseeko to fix this issue.
Signed-off-by: Kai Kang <kai.kang at windriver.com>
---
utils/isohybrid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)...
2014 May 12
2
[PATCH] isohybrid: fix overflow on 32 bit system
...2014?05?12? 10:49, H. Peter Anvin wrote:
> On 05/11/2014 06:56 PM, Kai Kang wrote:
>> When call isohybrid with option '-u', it overflows on a 32 bits host. It
>> seeks to 512 bytes before the end of the image to install gpt header. If
>> the size of image is larger than LONG_MAX, it overflows fseek() and
>> cause error:
>>
>> isohybrid: wrlinux-image-x86-64-20140505110100.iso: seek error - 8: Invalid argument
>>
>> Check the offset and call fseek() multi-times if offset is too large.
>>
>> Signed-off-by: Kai Kang <kai.kang at wi...
2009 May 02
1
integer ranges in R vs C and Java
Hello,
I'm using R-2.9 and have a question about integer ranges. On C, (OS X
platform),
LONG_MIN and LONG_MAX(from limits.h) correspond to -2147483648(-2^31)
and 2147483647 (2^31-1)
In Java(1.4), Integer.MIN_VALUE and Integer.MAX_VALUE have the same values.
On R, as.integer(2^31-1) is the maximum (without returning NA) but the
lowest is -2147483647 (-2^31+1)
> as.integer((-2)^31)
[1] NA
So in both...
2004 Apr 13
1
shared mem advice
...IPC_CREAT);
shared = (SEXP) shmat(shared_mem_id, (void *)0, 0);
my_allocVector(SEXPTYPE type, int length, SEXP
shared) {
SEXP s=shared;
....
And erase this if:
#################################################
if(size >=
(LONG_MAX / sizeof(VECREC))-sizeof(SEXPREC_ALIGN)
||
(s =
malloc(sizeof(SEXPREC_ALIGN) + size *
sizeof(VECREC))
)
== NULL) { {
#################################################
Alex
2014 May 13
2
[PATCH] isohybrid: fix overflow on 32 bit system
...gt; On 05/11/2014 06:56 PM, Kai Kang wrote:
>>>> When call isohybrid with option '-u', it overflows on a 32 bits
>> host. It
>>>> seeks to 512 bytes before the end of the image to install gpt
>> header. If
>>>> the size of image is larger than LONG_MAX, it overflows fseek() and
>>>> cause error:
>>>>
>>>> isohybrid: wrlinux-image-x86-64-20140505110100.iso: seek error - 8:
>> Invalid argument
>>>> Check the offset and call fseek() multi-times if offset is too
>> large.
>>>> Si...
2004 Jul 14
0
[LLVMdev] Constants.cpp:368: error: `INT8_MAX' undeclared(firstuse this function)
.../* max value for unsigned short */
#define INT_MIN (-2147483647-1) /* min value for (signed) int */
#define INT_MAX 2147483647 /* max value for (signed) int */
#define UINT_MAX 0xffffffff /* max value for unsigned int */
#define LONG_MIN (-2147483647L-1) /* minimum (signed) long */
#define LONG_MAX 2147483647L /* maximum (signed) long */
#define ULONG_MAX 0xffffffffUL /* maximum unsigned long */
#if defined(_ALL_SOURCE) \
|| (__STDC__ - 0 == 0) && !defined(_POSIX_C_SOURCE) \
&& !defined(_XOPEN_SOURCE)
/*
* Minimum and maximum values for 64-bit types
* Define a...
2019 Sep 23
2
[PATCH nbdkit v2] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...t;%ld", &timeout) != 1) {
- nbdkit_error ("cannot parse timeout: %s", value);
+ if (nbdkit_parse_uint32_t ("timeout", value, &timeout) == -1)
+ return -1;
+ /* Because we have to cast it to long before calling the libssh API. */
+ if (timeout > LONG_MAX) {
+ nbdkit_error ("timeout too large");
return -1;
}
}
@@ -403,9 +407,10 @@ ssh_open (int readonly)
}
}
if (timeout > 0) {
- r = ssh_options_set (h->session, SSH_OPTIONS_TIMEOUT, &timeout);
+ long arg = timeout;
+ r = ssh_options_set (h-&...
2004 Jul 15
0
[LLVMdev] Constants.cpp:368: error: `INT8_MAX' undeclared(firstuse this function)
...*/
>
> #define INT_MIN (-2147483647-1) /* min value for (signed) int */
> #define INT_MAX 2147483647 /* max value for (signed) int */
> #define UINT_MAX 0xffffffff /* max value for unsigned int */
>
> #define LONG_MIN (-2147483647L-1) /* minimum (signed) long */
> #define LONG_MAX 2147483647L /* maximum (signed) long */
> #define ULONG_MAX 0xffffffffUL /* maximum unsigned long */
>
> #if defined(_ALL_SOURCE) \
> || (__STDC__ - 0 == 0) && !defined(_POSIX_C_SOURCE) \
> && !defined(_XOPEN_SOURCE)
> /*
> * Minimum and maximum...
2019 Sep 23
0
Re: [PATCH nbdkit v2] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...) != 1) {
> - nbdkit_error ("cannot parse timeout: %s", value);
> + if (nbdkit_parse_uint32_t ("timeout", value, &timeout) == -1)
> + return -1;
> + /* Because we have to cast it to long before calling the libssh API. */
> + if (timeout > LONG_MAX) {
> + nbdkit_error ("timeout too large");
C17 5.2.4.2.1 requires 'long' to be at least 32 bits. Ergo, (uint32_t)
timeout > LONG_MAX is always false. You could assert() rather than
trying to use nbdkit_error().
> return -1;
> }
> }
> @@ -4...
2020 Oct 02
54
[Bug 3217] New: Tracking bug for 8.5 release
https://bugzilla.mindrot.org/show_bug.cgi?id=3217
Bug ID: 3217
Summary: Tracking bug for 8.5 release
Product: Portable OpenSSH
Version: -current
Hardware: All
OS: All
Status: NEW
Keywords: meta
Severity: enhancement
Priority: P5
Component: Miscellaneous
Assignee:
2019 Sep 21
2
[PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...\
+ *rp = r; \
+ return 0
+
+/* Functions for parsing signed integers. */
+int
+nbdkit_parse_int (const char *what, const char *str, int *rp)
+{
+ long r;
+ char *end;
+
+ errno = 0;
+ r = strtol (str, &end, 0);
+#if INT_MAX != LONG_MAX
+ if (r < INT_MIN || r > INT_MAX)
+ errno = ERANGE;
+#endif
+ PARSE_COMMON_TAIL;
+}
+
+int
+nbdkit_parse_long (const char *what, const char *str, long *rp)
+{
+ long r;
+ char *end;
+
+ errno = 0;
+ r = strtol (str, &end, 0);
+ PARSE_COMMON_TAIL;
+}
+
+int
+nbdkit_parse_int16_t...
2019 Sep 23
0
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...nk we
should document it as intentional.
> +/* Functions for parsing signed integers. */
> +int
> +nbdkit_parse_int (const char *what, const char *str, int *rp)
> +{
> + long r;
> + char *end;
> +
> + errno = 0;
> + r = strtol (str, &end, 0);
> +#if INT_MAX != LONG_MAX
> + if (r < INT_MIN || r > INT_MAX)
> + errno = ERANGE;
> +#endif
> + PARSE_COMMON_TAIL;
> +}
Looks correct.
> +
> +int
> +nbdkit_parse_long (const char *what, const char *str, long *rp)
> +{
> + long r;
> + char *end;
> +
> + errno = 0;
> +...
1999 May 15
2
vsize and nsize
I am running R version ??? under Redhat 5.2. It seems as though the
--nsize object has no effct on the size of the allocated Ncells as
determined using gc(). Yes, I have that much data....
That is if I envoke R with
R --vsize 100 --nsize 5000000
then type
gc()
I get
free total
Ncells 92202 200000
Vcells 12928414 13107200
Thanks
Tony Long
Ecology and Evolutionary Biology
Steinhaus
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 2/5] lib: Move code for parsing, passwords and paths into libnbdkit.so.
...\
- *rp = r; \
- return 0
-
-/* Functions for parsing signed integers. */
-int
-nbdkit_parse_int (const char *what, const char *str, int *rp)
-{
- long r;
- char *end;
-
- errno = 0;
- r = strtol (str, &end, 0);
-#if INT_MAX != LONG_MAX
- if (r < INT_MIN || r > INT_MAX)
- errno = ERANGE;
-#endif
- PARSE_COMMON_TAIL;
-}
-
-int
-nbdkit_parse_int8_t (const char *what, const char *str, int8_t *rp)
-{
- long r;
- char *end;
-
- errno = 0;
- r = strtol (str, &end, 0);
- if (r < INT8_MIN || r > INT8_MAX)
- er...
2012 Dec 27
1
[patch] patch for fskip_ahead()
...ed = (long)min(offset, sizeof(dump));
- if((long)fread(dump, 1, need, f) < need)
- return false;
- offset -= need;
- }
- }
- else
-#endif
+ if(fstat(fileno(f), &stb) == 0 && (stb.st_mode & S_IFMT) == S_IFREG)
{
- while(offset > 0) {
- long need = (long)min(offset, LONG_MAX);
- if(fseeko(f, need, SEEK_CUR) < 0) {
- need = (long)min(offset, sizeof(dump));
- if((long)fread(dump, 1, need, f) < need)
- return false;
- }
- offset -= need;
- }
+ if(fseeko(f, offset, SEEK_CUR) == 0)
+ return true;
+ }
+ while(offset > 0) {
+ const long need = (l...
2014 May 12
0
[PATCH] isohybrid: fix overflow on 32 bit system
On 05/11/2014 06:56 PM, Kai Kang wrote:
> When call isohybrid with option '-u', it overflows on a 32 bits host. It
> seeks to 512 bytes before the end of the image to install gpt header. If
> the size of image is larger than LONG_MAX, it overflows fseek() and
> cause error:
>
> isohybrid: wrlinux-image-x86-64-20140505110100.iso: seek error - 8: Invalid argument
>
> Check the offset and call fseek() multi-times if offset is too large.
>
> Signed-off-by: Kai Kang <kai.kang at windriver.com>
NAK.
Th...
2014 May 12
0
[PATCH] isohybrid: fix overflow on 32 bit system
...ter Anvin wrote:
>> On 05/11/2014 06:56 PM, Kai Kang wrote:
>>> When call isohybrid with option '-u', it overflows on a 32 bits
>host. It
>>> seeks to 512 bytes before the end of the image to install gpt
>header. If
>>> the size of image is larger than LONG_MAX, it overflows fseek() and
>>> cause error:
>>>
>>> isohybrid: wrlinux-image-x86-64-20140505110100.iso: seek error - 8:
>Invalid argument
>>>
>>> Check the offset and call fseek() multi-times if offset is too
>large.
>>>
>>> Signed...