check Ruby strings for embedded null bytes #69
					 2 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -189,7 +189,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...)
 | 
			
		|||
			if (!RB_TYPE_P(tmp, RUBY_T_STRING))
 | 
			
		||||
				rb_raise(rb_eTypeError, "Argument %d: Expected string", argI);
 | 
			
		||||
 | 
			
		||||
			*s = RSTRING_PTR(tmp);
 | 
			
		||||
			*s = StringValueCStr(tmp);
 | 
			
		||||
			++argI;
 | 
			
		||||
 | 
			
		||||
			break;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,7 +32,7 @@ DEF_TYPE(Bitmap);
 | 
			
		|||
static const char *objAsStringPtr(VALUE obj)
 | 
			
		||||
{
 | 
			
		||||
	VALUE str = rb_obj_as_string(obj);
 | 
			
		||||
	return RSTRING_PTR(str);
 | 
			
		||||
	return StringValueCStr(str);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void bitmapInitProps(Bitmap *b, VALUE self)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue