Wrong error upload filesize > filesize in config Wrong error upload filesize > filesize in config
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Wrong error upload filesize > filesize in config

Started by altenae, November 10, 2011, 09:26:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

altenae

This issue still excists on all of my three coppermine galleries (1.5.16)

http://forum.coppermine-gallery.net/index.php/topic,61711.0.html

The only thing wrong is the filesize.
In the config 512kb
If I upload 600 kb I would expect to get this error:

if (filesize($uploaded_pic) > ($CONFIG['max_upl_size'] << 10)) {

        @unlink($uploaded_pic);
        cpg_die(ERROR, sprintf($lang_db_input_php['err_imgsize_too_large'], $CONFIG['max_upl_size']), __FILE__, __LINE__);

Αndré

I assume this is exactly the same issue like here, so please try that fix and report if it works as expected.

altenae

Changed in the db_input.php

if (filesize($uploaded_pic) > ($CONFIG['max_upl_size'] << 10))

into

if (filesize($uploaded_pic) > ($CONFIG['max_upl_size'] * 1024))

The result is the same.
I have put a print statement and it looks like it never comes to this code.
Strange, because the only thing wrong is the filesize which is larger than I have configured in the config.

Edward

Αndré

Don't forget to add
die();
after your print statement. I'll also perform some tests asap (which might take some time these days).


altenae

Hi Andre,

The line you are referring to is present in the upload.php ?

If so , I can.t find any line with "name="MAX_FILE_SIZE" in it...

Edward

Αndré

It's that line in upload.php:
array('MAX_FILE_SIZE', $max_file_size, 4),

altenae